From 27ecfe786b22d9dd1f55b75ae4474bd54c53148a Mon Sep 17 00:00:00 2001 From: Sotirios Mantziaris Date: Wed, 24 Jan 2024 22:27:15 +0200 Subject: [PATCH] Upgrades (#670) ## Which problem is this PR solving? ## Short description of the changes --- go.mod | 31 +- go.sum | 69 +- .../aws/aws-sdk-go-v2/config/CHANGELOG.md | 17 + .../config/go_module_metadata.go | 2 +- .../aws-sdk-go-v2/credentials/CHANGELOG.md | 12 + .../endpointcreds/internal/client/auth.go | 48 + .../endpointcreds/internal/client/client.go | 1 + .../internal/client/endpoints.go | 20 + .../internal/client/middleware.go | 16 + .../credentials/go_module_metadata.go | 2 +- .../feature/ec2/imds/CHANGELOG.md | 4 + .../feature/ec2/imds/api_op_GetDynamicData.go | 1 + .../feature/ec2/imds/api_op_GetIAMInfo.go | 1 + .../api_op_GetInstanceIdentityDocument.go | 1 + .../feature/ec2/imds/api_op_GetMetadata.go | 1 + .../feature/ec2/imds/api_op_GetRegion.go | 1 + .../feature/ec2/imds/api_op_GetToken.go | 1 + .../feature/ec2/imds/api_op_GetUserData.go | 1 + .../aws-sdk-go-v2/feature/ec2/imds/auth.go | 48 + .../feature/ec2/imds/endpoints.go | 20 + .../feature/ec2/imds/go_module_metadata.go | 2 +- .../feature/ec2/imds/request_middleware.go | 24 +- .../aws-sdk-go-v2/internal/ini/CHANGELOG.md | 4 + .../internal/ini/go_module_metadata.go | 2 +- .../aws/aws-sdk-go-v2/internal/ini/strings.go | 4 - .../internal/presigned-url/CHANGELOG.md | 4 + .../presigned-url/go_module_metadata.go | 2 +- .../aws-sdk-go-v2/service/sqs/CHANGELOG.md | 4 + .../service/sqs/go_module_metadata.go | 2 +- .../aws-sdk-go-v2/service/sso/CHANGELOG.md | 8 + .../service/sso/go_module_metadata.go | 2 +- .../sso/internal/endpoints/endpoints.go | 8 + .../service/ssooidc/CHANGELOG.md | 8 + .../service/ssooidc/go_module_metadata.go | 2 +- .../ssooidc/internal/endpoints/endpoints.go | 8 + .../aws-sdk-go-v2/service/sts/CHANGELOG.md | 4 + .../aws-sdk-go-v2/service/sts/api_client.go | 6 + .../service/sts/go_module_metadata.go | 2 +- .../v8/elastictransport/elastictransport.go | 19 + .../v8/elastictransport/instrumentation.go | 215 ++ .../v8/elastictransport/version/version.go | 2 +- .../elastic/go-elasticsearch/v8/CHANGELOG.md | 57 + .../go-elasticsearch/v8/CONTRIBUTING.md | 2 +- .../elastic/go-elasticsearch/v8/Makefile | 2 +- .../go-elasticsearch/v8/catalog-info.yaml | 19 + .../go-elasticsearch/v8/elasticsearch.go | 56 +- .../go-elasticsearch/v8/esapi/api._.go | 48 +- .../go-elasticsearch/v8/esapi/api.bulk.go | 70 +- .../v8/esapi/api.cat.aliases.go | 35 +- .../v8/esapi/api.cat.allocation.go | 35 +- .../v8/esapi/api.cat.component_templates.go | 35 +- .../v8/esapi/api.cat.count.go | 35 +- .../v8/esapi/api.cat.fielddata.go | 35 +- .../v8/esapi/api.cat.health.go | 32 +- .../go-elasticsearch/v8/esapi/api.cat.help.go | 32 +- .../v8/esapi/api.cat.indices.go | 35 +- .../v8/esapi/api.cat.master.go | 32 +- .../v8/esapi/api.cat.nodeattrs.go | 32 +- .../v8/esapi/api.cat.nodes.go | 32 +- .../v8/esapi/api.cat.pending_tasks.go | 32 +- .../v8/esapi/api.cat.plugins.go | 32 +- .../v8/esapi/api.cat.recovery.go | 35 +- .../v8/esapi/api.cat.repositories.go | 32 +- .../v8/esapi/api.cat.segments.go | 35 +- .../v8/esapi/api.cat.shards.go | 35 +- .../v8/esapi/api.cat.snapshots.go | 35 +- .../v8/esapi/api.cat.tasks.go | 32 +- .../v8/esapi/api.cat.templates.go | 35 +- .../v8/esapi/api.cat.thread_pool.go | 35 +- .../v8/esapi/api.clear_scroll.go | 38 +- .../esapi/api.cluster.allocation_explain.go | 35 +- .../api.cluster.delete_component_template.go | 35 +- ...cluster.delete_voting_config_exclusions.go | 32 +- .../api.cluster.exists_component_template.go | 35 +- .../api.cluster.get_component_template.go | 35 +- .../v8/esapi/api.cluster.get_settings.go | 32 +- .../v8/esapi/api.cluster.health.go | 35 +- .../v8/esapi/api.cluster.info.go | 35 +- .../v8/esapi/api.cluster.pending_tasks.go | 32 +- ...i.cluster.post_voting_config_exclusions.go | 32 +- .../api.cluster.put_component_template.go | 38 +- .../v8/esapi/api.cluster.put_settings.go | 35 +- .../v8/esapi/api.cluster.remote_info.go | 32 +- .../v8/esapi/api.cluster.reroute.go | 35 +- .../v8/esapi/api.cluster.state.go | 38 +- .../v8/esapi/api.cluster.stats.go | 32 +- .../v8/esapi/api.connector.check_in.go | 227 ++ .../v8/esapi/api.connector.delete.go | 225 ++ .../v8/esapi/api.connector.get.go | 225 ++ .../v8/esapi/api.connector.last_sync.go | 237 ++ .../v8/esapi/api.connector.list.go | 243 ++ .../v8/esapi/api.connector.post.go | 227 ++ .../v8/esapi/api.connector.put.go | 235 ++ .../api.connector.update_configuration.go | 237 ++ .../v8/esapi/api.connector.update_error.go | 237 ++ .../esapi/api.connector.update_filtering.go | 237 ++ .../v8/esapi/api.connector.update_name.go | 237 ++ .../v8/esapi/api.connector.update_pipeline.go | 237 ++ .../esapi/api.connector.update_scheduling.go | 237 ++ .../v8/esapi/api.connector_sync_job.cancel.go | 229 ++ .../esapi/api.connector_sync_job.check_in.go | 229 ++ .../v8/esapi/api.connector_sync_job.delete.go | 227 ++ .../v8/esapi/api.connector_sync_job.error.go | 239 ++ .../v8/esapi/api.connector_sync_job.get.go | 227 ++ .../v8/esapi/api.connector_sync_job.list.go | 267 ++ .../v8/esapi/api.connector_sync_job.post.go | 227 ++ .../api.connector_sync_job.update_stats.go | 239 ++ .../go-elasticsearch/v8/esapi/api.count.go | 38 +- .../go-elasticsearch/v8/esapi/api.create.go | 41 +- ....dangling_indices.delete_dangling_index.go | 35 +- ....dangling_indices.import_dangling_index.go | 35 +- ....dangling_indices.list_dangling_indices.go | 32 +- .../go-elasticsearch/v8/esapi/api.delete.go | 38 +- .../v8/esapi/api.delete_by_query.go | 38 +- .../esapi/api.delete_by_query_rethrottle.go | 35 +- .../v8/esapi/api.delete_script.go | 35 +- .../go-elasticsearch/v8/esapi/api.exists.go | 38 +- .../v8/esapi/api.exists_source.go | 38 +- .../go-elasticsearch/v8/esapi/api.explain.go | 41 +- .../v8/esapi/api.features.get_features.go | 32 +- .../v8/esapi/api.features.reset_features.go | 32 +- .../v8/esapi/api.field_caps.go | 38 +- .../v8/esapi/api.fleet.delete_secret.go | 35 +- .../v8/esapi/api.fleet.get_secret.go | 35 +- .../v8/esapi/api.fleet.global_checkpoints.go | 35 +- .../v8/esapi/api.fleet.msearch.go | 38 +- .../v8/esapi/api.fleet.post_secret.go | 35 +- .../v8/esapi/api.fleet.search.go | 38 +- .../go-elasticsearch/v8/esapi/api.get.go | 38 +- .../v8/esapi/api.get_script.go | 35 +- .../v8/esapi/api.get_script_context.go | 32 +- .../v8/esapi/api.get_script_languages.go | 32 +- .../v8/esapi/api.get_source.go | 38 +- .../v8/esapi/api.health_report.go | 35 +- .../go-elasticsearch/v8/esapi/api.index.go | 41 +- .../v8/esapi/api.indices.add_block.go | 38 +- .../v8/esapi/api.indices.analyze.go | 38 +- .../v8/esapi/api.indices.clear_cache.go | 35 +- .../v8/esapi/api.indices.clone.go | 41 +- .../v8/esapi/api.indices.close.go | 35 +- .../v8/esapi/api.indices.create.go | 38 +- .../v8/esapi/api.indices.delete.go | 35 +- .../v8/esapi/api.indices.delete_alias.go | 38 +- .../api.indices.delete_data_lifecycle.go | 35 +- .../api.indices.delete_index_template.go | 35 +- .../v8/esapi/api.indices.delete_template.go | 35 +- .../v8/esapi/api.indices.disk_usage.go | 35 +- .../v8/esapi/api.indices.downsample.go | 41 +- .../v8/esapi/api.indices.exists.go | 35 +- .../v8/esapi/api.indices.exists_alias.go | 38 +- .../api.indices.exists_index_template.go | 35 +- .../v8/esapi/api.indices.exists_template.go | 35 +- .../api.indices.explain_data_lifecycle.go | 35 +- .../v8/esapi/api.indices.field_usage_stats.go | 35 +- .../v8/esapi/api.indices.flush.go | 35 +- .../v8/esapi/api.indices.forcemerge.go | 35 +- .../v8/esapi/api.indices.get.go | 35 +- .../v8/esapi/api.indices.get_alias.go | 38 +- .../esapi/api.indices.get_data_lifecycle.go | 35 +- .../v8/esapi/api.indices.get_field_mapping.go | 38 +- .../esapi/api.indices.get_index_template.go | 35 +- .../v8/esapi/api.indices.get_mapping.go | 35 +- .../v8/esapi/api.indices.get_settings.go | 38 +- .../v8/esapi/api.indices.get_template.go | 35 +- .../esapi/api.indices.modify_data_stream.go | 35 +- .../v8/esapi/api.indices.open.go | 35 +- .../v8/esapi/api.indices.put_alias.go | 41 +- .../esapi/api.indices.put_data_lifecycle.go | 38 +- .../esapi/api.indices.put_index_template.go | 38 +- .../v8/esapi/api.indices.put_mapping.go | 35 +- .../v8/esapi/api.indices.put_settings.go | 50 +- .../v8/esapi/api.indices.put_template.go | 38 +- .../v8/esapi/api.indices.recovery.go | 35 +- .../v8/esapi/api.indices.refresh.go | 35 +- .../v8/esapi/api.indices.resolve_index.go | 35 +- .../v8/esapi/api.indices.rollover.go | 41 +- .../v8/esapi/api.indices.segments.go | 35 +- .../v8/esapi/api.indices.shard_stores.go | 35 +- .../v8/esapi/api.indices.shrink.go | 41 +- .../api.indices.simulate_index_template.go | 38 +- .../v8/esapi/api.indices.simulate_template.go | 38 +- .../v8/esapi/api.indices.split.go | 41 +- .../v8/esapi/api.indices.stats.go | 38 +- .../v8/esapi/api.indices.update_aliases.go | 35 +- .../v8/esapi/api.indices.validate_query.go | 38 +- .../v8/esapi/api.inference.delete_model.go | 38 +- .../v8/esapi/api.inference.get_model.go | 38 +- .../v8/esapi/api.inference.inference.go | 41 +- .../v8/esapi/api.inference.put_model.go | 41 +- .../go-elasticsearch/v8/esapi/api.info.go | 32 +- .../v8/esapi/api.ingest.delete_pipeline.go | 35 +- .../v8/esapi/api.ingest.geo_ip_stats.go | 32 +- .../v8/esapi/api.ingest.get_pipeline.go | 35 +- .../v8/esapi/api.ingest.processor_grok.go | 32 +- .../v8/esapi/api.ingest.put_pipeline.go | 38 +- .../v8/esapi/api.ingest.simulate.go | 38 +- .../v8/esapi/api.knn_search.go | 38 +- .../go-elasticsearch/v8/esapi/api.mget.go | 38 +- .../go-elasticsearch/v8/esapi/api.msearch.go | 38 +- .../v8/esapi/api.msearch_template.go | 38 +- .../v8/esapi/api.mtermvectors.go | 38 +- ...des.clear_repositories_metering_archive.go | 38 +- ...pi.nodes.get_repositories_metering_info.go | 35 +- .../v8/esapi/api.nodes.hot_threads.go | 35 +- .../v8/esapi/api.nodes.info.go | 38 +- .../esapi/api.nodes.reload_secure_settings.go | 38 +- .../v8/esapi/api.nodes.stats.go | 41 +- .../v8/esapi/api.nodes.usage.go | 38 +- .../go-elasticsearch/v8/esapi/api.ping.go | 32 +- .../v8/esapi/api.profiling.status.go | 254 ++ .../v8/esapi/api.put_script.go | 41 +- .../v8/esapi/api.query_ruleset.delete.go | 35 +- .../v8/esapi/api.query_ruleset.get.go | 35 +- .../v8/esapi/api.query_ruleset.list.go | 32 +- .../v8/esapi/api.query_ruleset.put.go | 38 +- .../v8/esapi/api.rank_eval.go | 38 +- .../go-elasticsearch/v8/esapi/api.reindex.go | 35 +- .../v8/esapi/api.reindex_rethrottle.go | 35 +- .../v8/esapi/api.render_search_template.go | 38 +- .../v8/esapi/api.scripts_painless_execute.go | 35 +- .../go-elasticsearch/v8/esapi/api.scroll.go | 35 +- .../go-elasticsearch/v8/esapi/api.search.go | 38 +- .../v8/esapi/api.search_application.delete.go | 35 +- ...application.delete_behavioral_analytics.go | 35 +- .../v8/esapi/api.search_application.get.go | 35 +- ...ch_application.get_behavioral_analytics.go | 35 +- .../v8/esapi/api.search_application.list.go | 32 +- ...ication.post_behavioral_analytics_event.go | 41 +- .../v8/esapi/api.search_application.put.go | 38 +- ...ch_application.put_behavioral_analytics.go | 35 +- .../api.search_application.render_query.go | 38 +- .../v8/esapi/api.search_application.search.go | 38 +- .../v8/esapi/api.search_mvt.go | 50 +- .../v8/esapi/api.search_shards.go | 35 +- .../v8/esapi/api.search_template.go | 38 +- .../v8/esapi/api.shutdown.delete_node.go | 35 +- .../v8/esapi/api.shutdown.get_node.go | 35 +- .../v8/esapi/api.shutdown.put_node.go | 38 +- .../v8/esapi/api.simulate.ingest.go | 259 ++ .../esapi/api.snapshot.cleanup_repository.go | 35 +- .../v8/esapi/api.snapshot.clone.go | 44 +- .../v8/esapi/api.snapshot.create.go | 41 +- .../esapi/api.snapshot.create_repository.go | 38 +- .../v8/esapi/api.snapshot.delete.go | 38 +- .../esapi/api.snapshot.delete_repository.go | 35 +- .../v8/esapi/api.snapshot.get.go | 38 +- .../v8/esapi/api.snapshot.get_repository.go | 35 +- .../esapi/api.snapshot.repository_analyze.go | 35 +- .../v8/esapi/api.snapshot.restore.go | 41 +- .../v8/esapi/api.snapshot.status.go | 38 +- .../esapi/api.snapshot.verify_repository.go | 35 +- .../v8/esapi/api.synonyms.delete_synonym.go | 35 +- .../esapi/api.synonyms.delete_synonym_rule.go | 38 +- .../v8/esapi/api.synonyms.get_synonym.go | 35 +- .../v8/esapi/api.synonyms.get_synonym_rule.go | 38 +- .../esapi/api.synonyms.get_synonyms_sets.go | 32 +- .../v8/esapi/api.synonyms.put_synonym.go | 38 +- .../v8/esapi/api.synonyms.put_synonym_rule.go | 41 +- .../v8/esapi/api.tasks.cancel.go | 35 +- .../v8/esapi/api.tasks.get.go | 35 +- .../v8/esapi/api.tasks.list.go | 32 +- .../v8/esapi/api.terms_enum.go | 38 +- .../v8/esapi/api.termvectors.go | 41 +- .../go-elasticsearch/v8/esapi/api.update.go | 41 +- .../v8/esapi/api.update_by_query.go | 38 +- .../esapi/api.update_by_query_rethrottle.go | 35 +- .../v8/esapi/api.xpack.async_search.delete.go | 35 +- .../v8/esapi/api.xpack.async_search.get.go | 35 +- .../v8/esapi/api.xpack.async_search.status.go | 35 +- .../v8/esapi/api.xpack.async_search.submit.go | 38 +- ...k.autoscaling.delete_autoscaling_policy.go | 35 +- ...ck.autoscaling.get_autoscaling_capacity.go | 32 +- ...pack.autoscaling.get_autoscaling_policy.go | 35 +- ...pack.autoscaling.put_autoscaling_policy.go | 38 +- .../api.xpack.cat.ml_data_frame_analytics.go | 35 +- .../v8/esapi/api.xpack.cat.ml_datafeeds.go | 35 +- .../v8/esapi/api.xpack.cat.ml_jobs.go | 35 +- .../esapi/api.xpack.cat.ml_trained_models.go | 35 +- .../v8/esapi/api.xpack.cat.transforms.go | 35 +- ...pi.xpack.ccr.delete_auto_follow_pattern.go | 35 +- .../v8/esapi/api.xpack.ccr.follow.go | 38 +- .../v8/esapi/api.xpack.ccr.follow_info.go | 35 +- .../v8/esapi/api.xpack.ccr.follow_stats.go | 35 +- .../v8/esapi/api.xpack.ccr.forget_follower.go | 38 +- .../api.xpack.ccr.get_auto_follow_pattern.go | 35 +- ...api.xpack.ccr.pause_auto_follow_pattern.go | 35 +- .../v8/esapi/api.xpack.ccr.pause_follow.go | 35 +- .../api.xpack.ccr.put_auto_follow_pattern.go | 38 +- ...pi.xpack.ccr.resume_auto_follow_pattern.go | 35 +- .../v8/esapi/api.xpack.ccr.resume_follow.go | 38 +- .../v8/esapi/api.xpack.ccr.stats.go | 32 +- .../v8/esapi/api.xpack.ccr.unfollow.go | 35 +- .../v8/esapi/api.xpack.close_point_in_time.go | 35 +- .../esapi/api.xpack.enrich.delete_policy.go | 35 +- .../esapi/api.xpack.enrich.execute_policy.go | 35 +- .../v8/esapi/api.xpack.enrich.get_policy.go | 35 +- .../v8/esapi/api.xpack.enrich.put_policy.go | 38 +- .../v8/esapi/api.xpack.enrich.stats.go | 32 +- .../v8/esapi/api.xpack.eql.delete.go | 35 +- .../v8/esapi/api.xpack.eql.get.go | 35 +- .../v8/esapi/api.xpack.eql.get_status.go | 35 +- .../v8/esapi/api.xpack.eql.search.go | 38 +- .../v8/esapi/api.xpack.esql.query.go | 35 +- .../v8/esapi/api.xpack.graph.explore.go | 38 +- .../esapi/api.xpack.ilm.delete_lifecycle.go | 35 +- .../esapi/api.xpack.ilm.explain_lifecycle.go | 35 +- .../v8/esapi/api.xpack.ilm.get_lifecycle.go | 35 +- .../v8/esapi/api.xpack.ilm.get_status.go | 32 +- .../api.xpack.ilm.migrate_to_data_tiers.go | 35 +- .../v8/esapi/api.xpack.ilm.move_to_step.go | 38 +- .../v8/esapi/api.xpack.ilm.put_lifecycle.go | 38 +- .../v8/esapi/api.xpack.ilm.remove_policy.go | 35 +- .../v8/esapi/api.xpack.ilm.retry.go | 35 +- .../v8/esapi/api.xpack.ilm.start.go | 32 +- .../v8/esapi/api.xpack.ilm.stop.go | 32 +- .../api.xpack.indices.create_data_stream.go | 35 +- .../api.xpack.indices.data_streams_stats.go | 35 +- .../api.xpack.indices.delete_data_stream.go | 35 +- .../api.xpack.indices.get_data_stream.go | 35 +- ...pi.xpack.indices.migrate_to_data_stream.go | 35 +- .../api.xpack.indices.promote_data_stream.go | 35 +- ...i.xpack.indices.reload_search_analyzers.go | 35 +- .../v8/esapi/api.xpack.indices.unfreeze.go | 35 +- .../v8/esapi/api.xpack.license.delete.go | 32 +- .../v8/esapi/api.xpack.license.get.go | 32 +- .../api.xpack.license.get_basic_status.go | 32 +- .../api.xpack.license.get_trial_status.go | 32 +- .../v8/esapi/api.xpack.license.post.go | 35 +- .../api.xpack.license.post_start_basic.go | 32 +- .../api.xpack.license.post_start_trial.go | 32 +- .../api.xpack.logstash.delete_pipeline.go | 35 +- .../esapi/api.xpack.logstash.get_pipeline.go | 35 +- .../esapi/api.xpack.logstash.put_pipeline.go | 38 +- .../esapi/api.xpack.migration.deprecations.go | 35 +- ...ck.migration.get_feature_upgrade_status.go | 32 +- ...pi.xpack.migration.post_feature_upgrade.go | 32 +- ...ml.clear_trained_model_deployment_cache.go | 35 +- .../v8/esapi/api.xpack.ml.close_job.go | 38 +- .../v8/esapi/api.xpack.ml.delete_calendar.go | 35 +- .../api.xpack.ml.delete_calendar_event.go | 38 +- .../esapi/api.xpack.ml.delete_calendar_job.go | 38 +- ...pi.xpack.ml.delete_data_frame_analytics.go | 35 +- .../v8/esapi/api.xpack.ml.delete_datafeed.go | 35 +- .../esapi/api.xpack.ml.delete_expired_data.go | 38 +- .../v8/esapi/api.xpack.ml.delete_filter.go | 35 +- .../v8/esapi/api.xpack.ml.delete_forecast.go | 38 +- .../v8/esapi/api.xpack.ml.delete_job.go | 35 +- .../api.xpack.ml.delete_model_snapshot.go | 38 +- .../api.xpack.ml.delete_trained_model.go | 35 +- ...api.xpack.ml.delete_trained_model_alias.go | 38 +- .../api.xpack.ml.estimate_model_memory.go | 35 +- .../esapi/api.xpack.ml.evaluate_data_frame.go | 35 +- ...i.xpack.ml.explain_data_frame_analytics.go | 38 +- .../v8/esapi/api.xpack.ml.flush_job.go | 38 +- .../v8/esapi/api.xpack.ml.forecast.go | 38 +- .../v8/esapi/api.xpack.ml.get_buckets.go | 41 +- .../esapi/api.xpack.ml.get_calendar_events.go | 35 +- .../v8/esapi/api.xpack.ml.get_calendars.go | 38 +- .../v8/esapi/api.xpack.ml.get_categories.go | 41 +- .../api.xpack.ml.get_data_frame_analytics.go | 35 +- ...xpack.ml.get_data_frame_analytics_stats.go | 35 +- .../esapi/api.xpack.ml.get_datafeed_stats.go | 35 +- .../v8/esapi/api.xpack.ml.get_datafeeds.go | 35 +- .../v8/esapi/api.xpack.ml.get_filters.go | 35 +- .../v8/esapi/api.xpack.ml.get_influencers.go | 38 +- .../v8/esapi/api.xpack.ml.get_job_stats.go | 35 +- .../v8/esapi/api.xpack.ml.get_jobs.go | 35 +- .../v8/esapi/api.xpack.ml.get_memory_stats.go | 35 +- ...ack.ml.get_model_snapshot_upgrade_stats.go | 38 +- .../esapi/api.xpack.ml.get_model_snapshots.go | 41 +- .../esapi/api.xpack.ml.get_overall_buckets.go | 38 +- .../v8/esapi/api.xpack.ml.get_records.go | 38 +- .../esapi/api.xpack.ml.get_trained_models.go | 35 +- .../api.xpack.ml.get_trained_models_stats.go | 35 +- .../esapi/api.xpack.ml.infer_trained_model.go | 38 +- .../v8/esapi/api.xpack.ml.info.go | 32 +- .../v8/esapi/api.xpack.ml.open_job.go | 38 +- .../api.xpack.ml.post_calendar_events.go | 38 +- .../v8/esapi/api.xpack.ml.post_data.go | 38 +- ...i.xpack.ml.preview_data_frame_analytics.go | 38 +- .../v8/esapi/api.xpack.ml.preview_datafeed.go | 38 +- .../v8/esapi/api.xpack.ml.put_calendar.go | 38 +- .../v8/esapi/api.xpack.ml.put_calendar_job.go | 38 +- .../api.xpack.ml.put_data_frame_analytics.go | 38 +- .../v8/esapi/api.xpack.ml.put_datafeed.go | 38 +- .../v8/esapi/api.xpack.ml.put_filter.go | 38 +- .../v8/esapi/api.xpack.ml.put_job.go | 38 +- .../esapi/api.xpack.ml.put_trained_model.go | 38 +- .../api.xpack.ml.put_trained_model_alias.go | 38 +- ...ck.ml.put_trained_model_definition_part.go | 41 +- ...i.xpack.ml.put_trained_model_vocabulary.go | 38 +- .../v8/esapi/api.xpack.ml.reset_job.go | 35 +- .../api.xpack.ml.revert_model_snapshot.go | 41 +- .../v8/esapi/api.xpack.ml.set_upgrade_mode.go | 32 +- ...api.xpack.ml.start_data_frame_analytics.go | 38 +- .../v8/esapi/api.xpack.ml.start_datafeed.go | 38 +- ...xpack.ml.start_trained_model_deployment.go | 35 +- .../api.xpack.ml.stop_data_frame_analytics.go | 38 +- .../v8/esapi/api.xpack.ml.stop_datafeed.go | 38 +- ....xpack.ml.stop_trained_model_deployment.go | 38 +- ...pi.xpack.ml.update_data_frame_analytics.go | 38 +- .../v8/esapi/api.xpack.ml.update_datafeed.go | 38 +- .../v8/esapi/api.xpack.ml.update_filter.go | 38 +- .../v8/esapi/api.xpack.ml.update_job.go | 38 +- .../api.xpack.ml.update_model_snapshot.go | 41 +- ...pack.ml.update_trained_model_deployment.go | 38 +- .../api.xpack.ml.upgrade_job_snapshot.go | 38 +- .../v8/esapi/api.xpack.ml.validate.go | 35 +- .../esapi/api.xpack.ml.validate_detector.go | 35 +- .../v8/esapi/api.xpack.monitoring.bulk.go | 38 +- .../v8/esapi/api.xpack.open_point_in_time.go | 54 +- .../v8/esapi/api.xpack.rollup.delete_job.go | 35 +- .../v8/esapi/api.xpack.rollup.get_jobs.go | 35 +- .../esapi/api.xpack.rollup.get_rollup_caps.go | 35 +- .../api.xpack.rollup.get_rollup_index_caps.go | 35 +- .../v8/esapi/api.xpack.rollup.put_job.go | 38 +- .../esapi/api.xpack.rollup.rollup_search.go | 38 +- .../v8/esapi/api.xpack.rollup.start_job.go | 35 +- .../v8/esapi/api.xpack.rollup.stop_job.go | 35 +- ....xpack.searchable_snapshots.cache_stats.go | 35 +- ....xpack.searchable_snapshots.clear_cache.go | 35 +- .../api.xpack.searchable_snapshots.mount.go | 41 +- .../api.xpack.searchable_snapshots.stats.go | 35 +- ...pi.xpack.security.activate_user_profile.go | 35 +- .../esapi/api.xpack.security.authenticate.go | 32 +- ...api.xpack.security.bulk_update_api_keys.go | 35 +- .../api.xpack.security.change_password.go | 38 +- .../api.xpack.security.clear_api_key_cache.go | 35 +- ....xpack.security.clear_cached_privileges.go | 35 +- .../api.xpack.security.clear_cached_realms.go | 35 +- .../api.xpack.security.clear_cached_roles.go | 35 +- ...ck.security.clear_cached_service_tokens.go | 41 +- .../api.xpack.security.create_api_key.go | 35 +- ...k.security.create_cross_cluster_api_key.go | 35 +- ...api.xpack.security.create_service_token.go | 41 +- .../api.xpack.security.delete_privileges.go | 38 +- .../esapi/api.xpack.security.delete_role.go | 35 +- .../api.xpack.security.delete_role_mapping.go | 35 +- ...api.xpack.security.delete_service_token.go | 41 +- .../esapi/api.xpack.security.delete_user.go | 35 +- .../esapi/api.xpack.security.disable_user.go | 35 +- ...api.xpack.security.disable_user_profile.go | 35 +- .../esapi/api.xpack.security.enable_user.go | 35 +- .../api.xpack.security.enable_user_profile.go | 35 +- .../esapi/api.xpack.security.enroll_kibana.go | 32 +- .../esapi/api.xpack.security.enroll_node.go | 32 +- .../esapi/api.xpack.security.get_api_key.go | 44 +- ...i.xpack.security.get_builtin_privileges.go | 32 +- .../api.xpack.security.get_privileges.go | 38 +- .../v8/esapi/api.xpack.security.get_role.go | 35 +- .../api.xpack.security.get_role_mapping.go | 35 +- ...api.xpack.security.get_service_accounts.go | 38 +- ....xpack.security.get_service_credentials.go | 38 +- .../esapi/api.xpack.security.get_settings.go | 32 +- .../v8/esapi/api.xpack.security.get_token.go | 35 +- .../v8/esapi/api.xpack.security.get_user.go | 35 +- .../api.xpack.security.get_user_privileges.go | 32 +- .../api.xpack.security.get_user_profile.go | 35 +- .../esapi/api.xpack.security.grant_api_key.go | 35 +- .../api.xpack.security.has_privileges.go | 38 +- ...ck.security.has_privileges_user_profile.go | 35 +- .../api.xpack.security.invalidate_api_key.go | 35 +- .../api.xpack.security.invalidate_token.go | 35 +- .../api.xpack.security.oidc_authenticate.go | 35 +- .../esapi/api.xpack.security.oidc_logout.go | 35 +- ...ck.security.oidc_prepare_authentication.go | 35 +- .../api.xpack.security.put_privileges.go | 35 +- .../v8/esapi/api.xpack.security.put_role.go | 38 +- .../api.xpack.security.put_role_mapping.go | 38 +- .../v8/esapi/api.xpack.security.put_user.go | 38 +- .../api.xpack.security.query_api_keys.go | 35 +- .../api.xpack.security.saml_authenticate.go | 35 +- ...api.xpack.security.saml_complete_logout.go | 35 +- .../api.xpack.security.saml_invalidate.go | 35 +- .../esapi/api.xpack.security.saml_logout.go | 35 +- ...ck.security.saml_prepare_authentication.go | 35 +- ...security.saml_service_provider_metadata.go | 35 +- ...pi.xpack.security.suggest_user_profiles.go | 35 +- .../api.xpack.security.update_api_key.go | 38 +- ...k.security.update_cross_cluster_api_key.go | 38 +- .../api.xpack.security.update_settings.go | 35 +- ...xpack.security.update_user_profile_data.go | 38 +- .../esapi/api.xpack.slm.delete_lifecycle.go | 35 +- .../esapi/api.xpack.slm.execute_lifecycle.go | 35 +- .../esapi/api.xpack.slm.execute_retention.go | 32 +- .../v8/esapi/api.xpack.slm.get_lifecycle.go | 35 +- .../v8/esapi/api.xpack.slm.get_stats.go | 32 +- .../v8/esapi/api.xpack.slm.get_status.go | 32 +- .../v8/esapi/api.xpack.slm.put_lifecycle.go | 38 +- .../v8/esapi/api.xpack.slm.start.go | 32 +- .../v8/esapi/api.xpack.slm.stop.go | 32 +- .../v8/esapi/api.xpack.sql.clear_cursor.go | 35 +- .../v8/esapi/api.xpack.sql.delete_async.go | 35 +- .../v8/esapi/api.xpack.sql.get_async.go | 35 +- .../esapi/api.xpack.sql.get_async_status.go | 35 +- .../v8/esapi/api.xpack.sql.query.go | 35 +- .../v8/esapi/api.xpack.sql.translate.go | 35 +- .../v8/esapi/api.xpack.ssl.certificates.go | 32 +- ...api.xpack.text_structure.find_structure.go | 35 +- .../api.xpack.transform.delete_transform.go | 35 +- .../api.xpack.transform.get_transform.go | 35 +- ...api.xpack.transform.get_transform_stats.go | 35 +- .../api.xpack.transform.preview_transform.go | 38 +- .../api.xpack.transform.put_transform.go | 38 +- .../api.xpack.transform.reset_transform.go | 35 +- ....xpack.transform.schedule_now_transform.go | 35 +- .../api.xpack.transform.start_transform.go | 35 +- .../api.xpack.transform.stop_transform.go | 35 +- .../api.xpack.transform.update_transform.go | 38 +- .../api.xpack.transform.upgrade_transforms.go | 32 +- .../v8/esapi/api.xpack.watcher.ack_watch.go | 38 +- .../esapi/api.xpack.watcher.activate_watch.go | 35 +- .../api.xpack.watcher.deactivate_watch.go | 35 +- .../esapi/api.xpack.watcher.delete_watch.go | 35 +- .../esapi/api.xpack.watcher.execute_watch.go | 38 +- .../esapi/api.xpack.watcher.get_settings.go | 32 +- .../v8/esapi/api.xpack.watcher.get_watch.go | 35 +- .../v8/esapi/api.xpack.watcher.put_watch.go | 38 +- .../esapi/api.xpack.watcher.query_watches.go | 35 +- .../v8/esapi/api.xpack.watcher.start.go | 32 +- .../v8/esapi/api.xpack.watcher.stats.go | 35 +- .../v8/esapi/api.xpack.watcher.stop.go | 32 +- .../api.xpack.watcher.update_settings.go | 35 +- .../v8/esapi/api.xpack.xpack.info.go | 32 +- .../v8/esapi/api.xpack.xpack.usage.go | 32 +- .../go-elasticsearch/v8/esapi/esapi.go | 12 +- .../v8/internal/version/version.go | 2 +- .../go-elasticsearch/v8/typedapi/api._.go | 80 +- .../v8/typedapi/asyncsearch/delete/delete.go | 97 +- .../typedapi/asyncsearch/delete/response.go | 4 +- .../v8/typedapi/asyncsearch/get/get.go | 97 +- .../v8/typedapi/asyncsearch/get/response.go | 4 +- .../typedapi/asyncsearch/status/response.go | 4 +- .../v8/typedapi/asyncsearch/status/status.go | 97 +- .../v8/typedapi/asyncsearch/submit/request.go | 4 +- .../typedapi/asyncsearch/submit/response.go | 4 +- .../v8/typedapi/asyncsearch/submit/submit.go | 90 +- .../delete_autoscaling_policy.go | 97 +- .../deleteautoscalingpolicy/response.go | 4 +- .../get_autoscaling_capacity.go | 94 +- .../getautoscalingcapacity/response.go | 4 +- .../get_autoscaling_policy.go | 97 +- .../getautoscalingpolicy/response.go | 4 +- .../put_autoscaling_policy.go | 90 +- .../putautoscalingpolicy/request.go | 4 +- .../putautoscalingpolicy/response.go | 4 +- .../v8/typedapi/cat/aliases/aliases.go | 97 +- .../v8/typedapi/cat/aliases/response.go | 4 +- .../v8/typedapi/cat/allocation/allocation.go | 97 +- .../v8/typedapi/cat/allocation/response.go | 4 +- .../componenttemplates/component_templates.go | 97 +- .../cat/componenttemplates/response.go | 4 +- .../v8/typedapi/cat/count/count.go | 97 +- .../v8/typedapi/cat/count/response.go | 4 +- .../v8/typedapi/cat/fielddata/fielddata.go | 97 +- .../v8/typedapi/cat/fielddata/response.go | 4 +- .../v8/typedapi/cat/health/health.go | 94 +- .../v8/typedapi/cat/health/response.go | 4 +- .../v8/typedapi/cat/help/help.go | 94 +- .../v8/typedapi/cat/help/response.go | 4 +- .../v8/typedapi/cat/indices/indices.go | 97 +- .../v8/typedapi/cat/indices/response.go | 4 +- .../v8/typedapi/cat/master/master.go | 94 +- .../v8/typedapi/cat/master/response.go | 4 +- .../typedapi/cat/mldatafeeds/ml_datafeeds.go | 97 +- .../v8/typedapi/cat/mldatafeeds/response.go | 4 +- .../ml_data_frame_analytics.go | 97 +- .../cat/mldataframeanalytics/response.go | 4 +- .../v8/typedapi/cat/mljobs/ml_jobs.go | 97 +- .../v8/typedapi/cat/mljobs/response.go | 4 +- .../cat/mltrainedmodels/ml_trained_models.go | 97 +- .../typedapi/cat/mltrainedmodels/response.go | 4 +- .../v8/typedapi/cat/nodeattrs/nodeattrs.go | 94 +- .../v8/typedapi/cat/nodeattrs/response.go | 4 +- .../v8/typedapi/cat/nodes/nodes.go | 94 +- .../v8/typedapi/cat/nodes/response.go | 4 +- .../cat/pendingtasks/pending_tasks.go | 94 +- .../v8/typedapi/cat/pendingtasks/response.go | 4 +- .../v8/typedapi/cat/plugins/plugins.go | 94 +- .../v8/typedapi/cat/plugins/response.go | 4 +- .../v8/typedapi/cat/recovery/recovery.go | 97 +- .../v8/typedapi/cat/recovery/response.go | 4 +- .../typedapi/cat/repositories/repositories.go | 94 +- .../v8/typedapi/cat/repositories/response.go | 4 +- .../v8/typedapi/cat/segments/response.go | 4 +- .../v8/typedapi/cat/segments/segments.go | 97 +- .../v8/typedapi/cat/shards/response.go | 4 +- .../v8/typedapi/cat/shards/shards.go | 97 +- .../v8/typedapi/cat/snapshots/response.go | 4 +- .../v8/typedapi/cat/snapshots/snapshots.go | 97 +- .../v8/typedapi/cat/tasks/response.go | 4 +- .../v8/typedapi/cat/tasks/tasks.go | 94 +- .../v8/typedapi/cat/templates/response.go | 4 +- .../v8/typedapi/cat/templates/templates.go | 97 +- .../v8/typedapi/cat/threadpool/response.go | 4 +- .../v8/typedapi/cat/threadpool/thread_pool.go | 97 +- .../v8/typedapi/cat/transforms/response.go | 4 +- .../v8/typedapi/cat/transforms/transforms.go | 97 +- .../delete_auto_follow_pattern.go | 97 +- .../ccr/deleteautofollowpattern/response.go | 4 +- .../v8/typedapi/ccr/follow/follow.go | 90 +- .../v8/typedapi/ccr/follow/request.go | 4 +- .../v8/typedapi/ccr/follow/response.go | 4 +- .../v8/typedapi/ccr/followinfo/follow_info.go | 97 +- .../v8/typedapi/ccr/followinfo/response.go | 4 +- .../typedapi/ccr/followstats/follow_stats.go | 97 +- .../v8/typedapi/ccr/followstats/response.go | 4 +- .../ccr/forgetfollower/forget_follower.go | 90 +- .../v8/typedapi/ccr/forgetfollower/request.go | 4 +- .../typedapi/ccr/forgetfollower/response.go | 4 +- .../get_auto_follow_pattern.go | 97 +- .../ccr/getautofollowpattern/response.go | 4 +- .../pause_auto_follow_pattern.go | 97 +- .../ccr/pauseautofollowpattern/response.go | 4 +- .../typedapi/ccr/pausefollow/pause_follow.go | 97 +- .../v8/typedapi/ccr/pausefollow/response.go | 4 +- .../put_auto_follow_pattern.go | 90 +- .../ccr/putautofollowpattern/request.go | 4 +- .../ccr/putautofollowpattern/response.go | 4 +- .../ccr/resumeautofollowpattern/response.go | 4 +- .../resume_auto_follow_pattern.go | 97 +- .../v8/typedapi/ccr/resumefollow/request.go | 4 +- .../v8/typedapi/ccr/resumefollow/response.go | 4 +- .../ccr/resumefollow/resume_follow.go | 90 +- .../v8/typedapi/ccr/stats/response.go | 4 +- .../v8/typedapi/ccr/stats/stats.go | 94 +- .../v8/typedapi/ccr/unfollow/response.go | 4 +- .../v8/typedapi/ccr/unfollow/unfollow.go | 97 +- .../allocationexplain/allocation_explain.go | 87 +- .../cluster/allocationexplain/request.go | 4 +- .../cluster/allocationexplain/response.go | 4 +- .../delete_component_template.go | 97 +- .../deletecomponenttemplate/response.go | 4 +- .../delete_voting_config_exclusions.go | 71 +- .../exists_component_template.go | 74 +- .../get_component_template.go | 97 +- .../cluster/getcomponenttemplate/response.go | 4 +- .../cluster/getsettings/get_settings.go | 94 +- .../typedapi/cluster/getsettings/response.go | 4 +- .../v8/typedapi/cluster/health/health.go | 108 +- .../v8/typedapi/cluster/health/response.go | 4 +- .../v8/typedapi/cluster/info/info.go | 97 +- .../v8/typedapi/cluster/info/response.go | 4 +- .../cluster/pendingtasks/pending_tasks.go | 94 +- .../typedapi/cluster/pendingtasks/response.go | 4 +- .../post_voting_config_exclusions.go | 71 +- .../put_component_template.go | 90 +- .../cluster/putcomponenttemplate/request.go | 4 +- .../cluster/putcomponenttemplate/response.go | 4 +- .../cluster/putsettings/put_settings.go | 87 +- .../typedapi/cluster/putsettings/request.go | 4 +- .../typedapi/cluster/putsettings/response.go | 4 +- .../cluster/remoteinfo/remote_info.go | 94 +- .../typedapi/cluster/remoteinfo/response.go | 4 +- .../v8/typedapi/cluster/reroute/request.go | 4 +- .../v8/typedapi/cluster/reroute/reroute.go | 87 +- .../v8/typedapi/cluster/reroute/response.go | 4 +- .../v8/typedapi/cluster/state/response.go | 4 +- .../v8/typedapi/cluster/state/state.go | 103 +- .../v8/typedapi/cluster/stats/response.go | 4 +- .../v8/typedapi/cluster/stats/stats.go | 97 +- .../v8/typedapi/core/bulk/bulk.go | 90 +- .../v8/typedapi/core/bulk/request.go | 4 +- .../v8/typedapi/core/bulk/response.go | 4 +- .../typedapi/core/clearscroll/clear_scroll.go | 102 +- .../v8/typedapi/core/clearscroll/request.go | 4 +- .../v8/typedapi/core/clearscroll/response.go | 4 +- .../closepointintime/close_point_in_time.go | 99 +- .../typedapi/core/closepointintime/request.go | 4 +- .../core/closepointintime/response.go | 4 +- .../v8/typedapi/core/count/count.go | 90 +- .../v8/typedapi/core/count/request.go | 4 +- .../v8/typedapi/core/count/response.go | 4 +- .../v8/typedapi/core/create/create.go | 93 +- .../v8/typedapi/core/create/request.go | 4 +- .../v8/typedapi/core/create/response.go | 4 +- .../v8/typedapi/core/delete/delete.go | 111 +- .../v8/typedapi/core/delete/response.go | 4 +- .../core/deletebyquery/delete_by_query.go | 90 +- .../v8/typedapi/core/deletebyquery/request.go | 4 +- .../typedapi/core/deletebyquery/response.go | 4 +- .../delete_by_query_rethrottle.go | 97 +- .../core/deletebyqueryrethrottle/response.go | 4 +- .../core/deletescript/delete_script.go | 97 +- .../v8/typedapi/core/deletescript/response.go | 4 +- .../v8/typedapi/core/exists/exists.go | 77 +- .../core/existssource/exists_source.go | 77 +- .../v8/typedapi/core/explain/explain.go | 93 +- .../v8/typedapi/core/explain/request.go | 4 +- .../v8/typedapi/core/explain/response.go | 4 +- .../v8/typedapi/core/fieldcaps/field_caps.go | 90 +- .../v8/typedapi/core/fieldcaps/request.go | 4 +- .../v8/typedapi/core/fieldcaps/response.go | 4 +- .../v8/typedapi/core/get/get.go | 111 +- .../v8/typedapi/core/get/response.go | 4 +- .../v8/typedapi/core/getscript/get_script.go | 97 +- .../v8/typedapi/core/getscript/response.go | 4 +- .../getscriptcontext/get_script_context.go | 94 +- .../core/getscriptcontext/response.go | 4 +- .../get_script_languages.go | 94 +- .../core/getscriptlanguages/response.go | 4 +- .../v8/typedapi/core/getsource/get_source.go | 100 +- .../v8/typedapi/core/getsource/response.go | 4 +- .../core/healthreport/health_report.go | 97 +- .../v8/typedapi/core/healthreport/response.go | 4 +- .../v8/typedapi/core/index/index.go | 96 +- .../v8/typedapi/core/index/request.go | 4 +- .../v8/typedapi/core/index/response.go | 4 +- .../v8/typedapi/core/info/info.go | 94 +- .../v8/typedapi/core/info/response.go | 4 +- .../v8/typedapi/core/knnsearch/knn_search.go | 90 +- .../v8/typedapi/core/knnsearch/request.go | 4 +- .../v8/typedapi/core/knnsearch/response.go | 4 +- .../v8/typedapi/core/mget/mget.go | 90 +- .../v8/typedapi/core/mget/request.go | 4 +- .../v8/typedapi/core/mget/response.go | 69 +- .../v8/typedapi/core/msearch/msearch.go | 90 +- .../v8/typedapi/core/msearch/request.go | 4 +- .../v8/typedapi/core/msearch/response.go | 85 +- .../core/msearchtemplate/msearch_template.go | 90 +- .../typedapi/core/msearchtemplate/request.go | 4 +- .../typedapi/core/msearchtemplate/response.go | 85 +- .../core/mtermvectors/mtermvectors.go | 90 +- .../v8/typedapi/core/mtermvectors/request.go | 4 +- .../v8/typedapi/core/mtermvectors/response.go | 4 +- .../openpointintime/open_point_in_time.go | 97 +- .../typedapi/core/openpointintime/response.go | 4 +- .../v8/typedapi/core/ping/ping.go | 71 +- .../v8/typedapi/core/putscript/put_script.go | 96 +- .../v8/typedapi/core/putscript/request.go | 4 +- .../v8/typedapi/core/putscript/response.go | 4 +- .../v8/typedapi/core/rankeval/rank_eval.go | 90 +- .../v8/typedapi/core/rankeval/request.go | 4 +- .../v8/typedapi/core/rankeval/response.go | 4 +- .../v8/typedapi/core/reindex/reindex.go | 87 +- .../v8/typedapi/core/reindex/request.go | 4 +- .../v8/typedapi/core/reindex/response.go | 4 +- .../reindexrethrottle/reindex_rethrottle.go | 97 +- .../core/reindexrethrottle/response.go | 4 +- .../render_search_template.go | 90 +- .../core/rendersearchtemplate/request.go | 4 +- .../core/rendersearchtemplate/response.go | 4 +- .../core/scriptspainlessexecute/request.go | 4 +- .../core/scriptspainlessexecute/response.go | 4 +- .../scripts_painless_execute.go | 87 +- .../v8/typedapi/core/scroll/request.go | 4 +- .../v8/typedapi/core/scroll/response.go | 4 +- .../v8/typedapi/core/scroll/scroll.go | 90 +- .../v8/typedapi/core/search/request.go | 4 +- .../v8/typedapi/core/search/response.go | 4 +- .../v8/typedapi/core/search/search.go | 90 +- .../v8/typedapi/core/searchmvt/request.go | 4 +- .../v8/typedapi/core/searchmvt/response.go | 4 +- .../v8/typedapi/core/searchmvt/search_mvt.go | 102 +- .../v8/typedapi/core/searchshards/response.go | 4 +- .../core/searchshards/search_shards.go | 97 +- .../typedapi/core/searchtemplate/request.go | 4 +- .../typedapi/core/searchtemplate/response.go | 4 +- .../core/searchtemplate/search_template.go | 90 +- .../v8/typedapi/core/termsenum/request.go | 4 +- .../v8/typedapi/core/termsenum/response.go | 4 +- .../v8/typedapi/core/termsenum/terms_enum.go | 90 +- .../v8/typedapi/core/termvectors/request.go | 4 +- .../v8/typedapi/core/termvectors/response.go | 4 +- .../typedapi/core/termvectors/termvectors.go | 96 +- .../v8/typedapi/core/update/request.go | 4 +- .../v8/typedapi/core/update/response.go | 4 +- .../v8/typedapi/core/update/update.go | 93 +- .../v8/typedapi/core/updatebyquery/request.go | 4 +- .../typedapi/core/updatebyquery/response.go | 4 +- .../core/updatebyquery/update_by_query.go | 90 +- .../core/updatebyqueryrethrottle/response.go | 4 +- .../update_by_query_rethrottle.go | 97 +- .../delete_dangling_index.go | 97 +- .../deletedanglingindex/response.go | 4 +- .../import_dangling_index.go | 97 +- .../importdanglingindex/response.go | 4 +- .../list_dangling_indices.go | 94 +- .../listdanglingindices/response.go | 4 +- .../enrich/deletepolicy/delete_policy.go | 97 +- .../typedapi/enrich/deletepolicy/response.go | 4 +- .../enrich/executepolicy/execute_policy.go | 97 +- .../typedapi/enrich/executepolicy/response.go | 4 +- .../typedapi/enrich/getpolicy/get_policy.go | 97 +- .../v8/typedapi/enrich/getpolicy/response.go | 4 +- .../typedapi/enrich/putpolicy/put_policy.go | 90 +- .../v8/typedapi/enrich/putpolicy/request.go | 4 +- .../v8/typedapi/enrich/putpolicy/response.go | 4 +- .../v8/typedapi/enrich/stats/response.go | 4 +- .../v8/typedapi/enrich/stats/stats.go | 94 +- .../v8/typedapi/eql/delete/delete.go | 97 +- .../v8/typedapi/eql/delete/response.go | 4 +- .../v8/typedapi/eql/get/get.go | 97 +- .../v8/typedapi/eql/get/response.go | 4 +- .../v8/typedapi/eql/getstatus/get_status.go | 97 +- .../v8/typedapi/eql/getstatus/response.go | 4 +- .../v8/typedapi/eql/search/request.go | 4 +- .../v8/typedapi/eql/search/response.go | 4 +- .../v8/typedapi/eql/search/search.go | 90 +- .../v8/typedapi/esql/query/query.go | 356 +++ .../v8/typedapi/esql/query/request.go | 69 + .../v8/typedapi/esql/query/response.go | 33 + .../features/getfeatures/get_features.go | 94 +- .../typedapi/features/getfeatures/response.go | 4 +- .../features/resetfeatures/reset_features.go | 94 +- .../features/resetfeatures/response.go | 4 +- .../globalcheckpoints/global_checkpoints.go | 99 +- .../fleet/globalcheckpoints/response.go | 4 +- .../v8/typedapi/fleet/msearch/msearch.go | 90 +- .../v8/typedapi/fleet/msearch/request.go | 4 +- .../v8/typedapi/fleet/msearch/response.go | 69 +- .../typedapi/fleet/postsecret/post_secret.go | 226 ++ .../v8/typedapi/fleet/search/request.go | 4 +- .../v8/typedapi/fleet/search/response.go | 4 +- .../v8/typedapi/fleet/search/search.go | 90 +- .../v8/typedapi/graph/explore/explore.go | 90 +- .../v8/typedapi/graph/explore/request.go | 4 +- .../v8/typedapi/graph/explore/response.go | 4 +- .../ilm/deletelifecycle/delete_lifecycle.go | 97 +- .../typedapi/ilm/deletelifecycle/response.go | 4 +- .../ilm/explainlifecycle/explain_lifecycle.go | 97 +- .../typedapi/ilm/explainlifecycle/response.go | 4 +- .../ilm/getlifecycle/get_lifecycle.go | 97 +- .../v8/typedapi/ilm/getlifecycle/response.go | 4 +- .../v8/typedapi/ilm/getstatus/get_status.go | 94 +- .../v8/typedapi/ilm/getstatus/response.go | 4 +- .../migrate_to_data_tiers.go | 87 +- .../ilm/migratetodatatiers/request.go | 4 +- .../ilm/migratetodatatiers/response.go | 4 +- .../typedapi/ilm/movetostep/move_to_step.go | 90 +- .../v8/typedapi/ilm/movetostep/request.go | 4 +- .../v8/typedapi/ilm/movetostep/response.go | 4 +- .../ilm/putlifecycle/put_lifecycle.go | 90 +- .../v8/typedapi/ilm/putlifecycle/request.go | 4 +- .../v8/typedapi/ilm/putlifecycle/response.go | 4 +- .../ilm/removepolicy/remove_policy.go | 97 +- .../v8/typedapi/ilm/removepolicy/response.go | 4 +- .../v8/typedapi/ilm/retry/response.go | 4 +- .../v8/typedapi/ilm/retry/retry.go | 97 +- .../v8/typedapi/ilm/start/response.go | 4 +- .../v8/typedapi/ilm/start/start.go | 94 +- .../v8/typedapi/ilm/stop/response.go | 4 +- .../v8/typedapi/ilm/stop/stop.go | 94 +- .../v8/typedapi/indices/addblock/add_block.go | 100 +- .../v8/typedapi/indices/addblock/response.go | 4 +- .../v8/typedapi/indices/analyze/analyze.go | 90 +- .../v8/typedapi/indices/analyze/request.go | 4 +- .../v8/typedapi/indices/analyze/response.go | 4 +- .../indices/clearcache/clear_cache.go | 97 +- .../typedapi/indices/clearcache/response.go | 4 +- .../v8/typedapi/indices/clone/clone.go | 93 +- .../v8/typedapi/indices/clone/request.go | 4 +- .../v8/typedapi/indices/clone/response.go | 4 +- .../v8/typedapi/indices/close/close.go | 97 +- .../v8/typedapi/indices/close/response.go | 4 +- .../v8/typedapi/indices/create/create.go | 90 +- .../v8/typedapi/indices/create/request.go | 4 +- .../v8/typedapi/indices/create/response.go | 4 +- .../createdatastream/create_data_stream.go | 97 +- .../indices/createdatastream/response.go | 4 +- .../datastreamsstats/data_streams_stats.go | 97 +- .../indices/datastreamsstats/response.go | 4 +- .../v8/typedapi/indices/delete/delete.go | 97 +- .../v8/typedapi/indices/delete/response.go | 4 +- .../indices/deletealias/delete_alias.go | 106 +- .../typedapi/indices/deletealias/response.go | 4 +- .../delete_data_lifecycle.go | 97 +- .../indices/deletedatalifecycle/response.go | 4 +- .../deletedatastream/delete_data_stream.go | 97 +- .../indices/deletedatastream/response.go | 4 +- .../delete_index_template.go | 99 +- .../indices/deleteindextemplate/response.go | 4 +- .../indices/deletetemplate/delete_template.go | 99 +- .../indices/deletetemplate/response.go | 4 +- .../typedapi/indices/diskusage/disk_usage.go | 97 +- .../v8/typedapi/indices/diskusage/response.go | 4 +- .../typedapi/indices/downsample/downsample.go | 93 +- .../v8/typedapi/indices/downsample/request.go | 4 +- .../typedapi/indices/downsample/response.go | 4 +- .../v8/typedapi/indices/exists/exists.go | 74 +- .../indices/existsalias/exists_alias.go | 80 +- .../exists_index_template.go | 76 +- .../indices/existstemplate/exists_template.go | 76 +- .../explain_data_lifecycle.go | 97 +- .../indices/explaindatalifecycle/response.go | 4 +- .../fieldusagestats/field_usage_stats.go | 97 +- .../indices/fieldusagestats/response.go | 4 +- .../v8/typedapi/indices/flush/flush.go | 97 +- .../v8/typedapi/indices/flush/response.go | 4 +- .../typedapi/indices/forcemerge/forcemerge.go | 97 +- .../typedapi/indices/forcemerge/response.go | 4 +- .../v8/typedapi/indices/get/get.go | 97 +- .../v8/typedapi/indices/get/response.go | 4 +- .../v8/typedapi/indices/getalias/get_alias.go | 117 +- .../v8/typedapi/indices/getalias/response.go | 4 +- .../getdatalifecycle/get_data_lifecycle.go | 97 +- .../indices/getdatalifecycle/response.go | 4 +- .../indices/getdatastream/get_data_stream.go | 97 +- .../indices/getdatastream/response.go | 4 +- .../getfieldmapping/get_field_mapping.go | 103 +- .../indices/getfieldmapping/response.go | 4 +- .../getindextemplate/get_index_template.go | 99 +- .../indices/getindextemplate/response.go | 4 +- .../indices/getmapping/get_mapping.go | 97 +- .../typedapi/indices/getmapping/response.go | 4 +- .../indices/getsettings/get_settings.go | 106 +- .../typedapi/indices/getsettings/response.go | 4 +- .../indices/gettemplate/get_template.go | 99 +- .../typedapi/indices/gettemplate/response.go | 4 +- .../migrate_to_data_stream.go | 97 +- .../indices/migratetodatastream/response.go | 4 +- .../modifydatastream/modify_data_stream.go | 87 +- .../indices/modifydatastream/request.go | 4 +- .../indices/modifydatastream/response.go | 4 +- .../v8/typedapi/indices/open/open.go | 97 +- .../v8/typedapi/indices/open/response.go | 4 +- .../promotedatastream/promote_data_stream.go | 97 +- .../indices/promotedatastream/response.go | 4 +- .../v8/typedapi/indices/putalias/put_alias.go | 99 +- .../v8/typedapi/indices/putalias/request.go | 4 +- .../v8/typedapi/indices/putalias/response.go | 4 +- .../putdatalifecycle/put_data_lifecycle.go | 88 +- .../indices/putdatalifecycle/request.go | 4 +- .../indices/putdatalifecycle/response.go | 4 +- .../putindextemplate/put_index_template.go | 92 +- .../indices/putindextemplate/request.go | 4 +- .../indices/putindextemplate/response.go | 4 +- .../indices/putmapping/put_mapping.go | 90 +- .../v8/typedapi/indices/putmapping/request.go | 4 +- .../typedapi/indices/putmapping/response.go | 4 +- .../indices/putsettings/put_settings.go | 90 +- .../typedapi/indices/putsettings/request.go | 4 +- .../typedapi/indices/putsettings/response.go | 4 +- .../indices/puttemplate/put_template.go | 92 +- .../typedapi/indices/puttemplate/request.go | 4 +- .../typedapi/indices/puttemplate/response.go | 4 +- .../v8/typedapi/indices/recovery/recovery.go | 97 +- .../v8/typedapi/indices/recovery/response.go | 4 +- .../v8/typedapi/indices/refresh/refresh.go | 97 +- .../v8/typedapi/indices/refresh/response.go | 4 +- .../reload_search_analyzers.go | 97 +- .../indices/reloadsearchanalyzers/response.go | 4 +- .../indices/resolveindex/resolve_index.go | 97 +- .../typedapi/indices/resolveindex/response.go | 4 +- .../v8/typedapi/indices/rollover/request.go | 4 +- .../v8/typedapi/indices/rollover/response.go | 4 +- .../v8/typedapi/indices/rollover/rollover.go | 96 +- .../v8/typedapi/indices/segments/response.go | 4 +- .../v8/typedapi/indices/segments/segments.go | 97 +- .../typedapi/indices/shardstores/response.go | 4 +- .../indices/shardstores/shard_stores.go | 97 +- .../v8/typedapi/indices/shrink/request.go | 4 +- .../v8/typedapi/indices/shrink/response.go | 4 +- .../v8/typedapi/indices/shrink/shrink.go | 93 +- .../indices/simulateindextemplate/request.go | 4 +- .../indices/simulateindextemplate/response.go | 4 +- .../simulate_index_template.go | 92 +- .../indices/simulatetemplate/request.go | 4 +- .../indices/simulatetemplate/response.go | 4 +- .../simulatetemplate/simulate_template.go | 92 +- .../v8/typedapi/indices/split/request.go | 4 +- .../v8/typedapi/indices/split/response.go | 4 +- .../v8/typedapi/indices/split/split.go | 93 +- .../v8/typedapi/indices/stats/response.go | 4 +- .../v8/typedapi/indices/stats/stats.go | 106 +- .../v8/typedapi/indices/unfreeze/response.go | 4 +- .../v8/typedapi/indices/unfreeze/unfreeze.go | 97 +- .../typedapi/indices/updatealiases/request.go | 4 +- .../indices/updatealiases/response.go | 4 +- .../indices/updatealiases/update_aliases.go | 87 +- .../typedapi/indices/validatequery/request.go | 4 +- .../indices/validatequery/response.go | 4 +- .../indices/validatequery/validate_query.go | 90 +- .../inference/deletemodel/delete_model.go | 318 ++ .../inference/deletemodel/response.go | 37 + .../typedapi/inference/getmodel/get_model.go | 318 ++ .../typedapi/inference/getmodel/response.go | 38 + .../typedapi/inference/inference/inference.go | 344 ++ .../typedapi/inference/inference/request.go | 56 + .../typedapi/inference/inference/response.go | 39 + .../typedapi/inference/putmodel/put_model.go | 350 ++ .../v8/typedapi/inference/putmodel/request.go | 30 + .../typedapi/inference/putmodel/response.go | 50 + .../ingest/deletepipeline/delete_pipeline.go | 97 +- .../ingest/deletepipeline/response.go | 4 +- .../ingest/geoipstats/geo_ip_stats.go | 94 +- .../v8/typedapi/ingest/geoipstats/response.go | 4 +- .../ingest/getpipeline/get_pipeline.go | 97 +- .../typedapi/ingest/getpipeline/response.go | 4 +- .../ingest/processorgrok/processor_grok.go | 94 +- .../typedapi/ingest/processorgrok/response.go | 4 +- .../ingest/putpipeline/put_pipeline.go | 90 +- .../v8/typedapi/ingest/putpipeline/request.go | 4 +- .../typedapi/ingest/putpipeline/response.go | 4 +- .../v8/typedapi/ingest/simulate/request.go | 4 +- .../v8/typedapi/ingest/simulate/response.go | 4 +- .../v8/typedapi/ingest/simulate/simulate.go | 90 +- .../v8/typedapi/license/delete/delete.go | 94 +- .../v8/typedapi/license/delete/response.go | 4 +- .../v8/typedapi/license/get/get.go | 94 +- .../v8/typedapi/license/get/response.go | 4 +- .../getbasicstatus/get_basic_status.go | 94 +- .../license/getbasicstatus/response.go | 4 +- .../gettrialstatus/get_trial_status.go | 94 +- .../license/gettrialstatus/response.go | 4 +- .../v8/typedapi/license/post/post.go | 87 +- .../v8/typedapi/license/post/request.go | 4 +- .../v8/typedapi/license/post/response.go | 4 +- .../poststartbasic/post_start_basic.go | 94 +- .../license/poststartbasic/response.go | 4 +- .../poststarttrial/post_start_trial.go | 94 +- .../license/poststarttrial/response.go | 4 +- .../deletepipeline/delete_pipeline.go | 74 +- .../logstash/getpipeline/get_pipeline.go | 105 +- .../typedapi/logstash/getpipeline/response.go | 4 +- .../logstash/putpipeline/put_pipeline.go | 67 +- .../typedapi/logstash/putpipeline/request.go | 4 +- .../migration/deprecations/deprecations.go | 97 +- .../migration/deprecations/response.go | 4 +- .../get_feature_upgrade_status.go | 94 +- .../getfeatureupgradestatus/response.go | 4 +- .../post_feature_upgrade.go | 94 +- .../migration/postfeatureupgrade/response.go | 4 +- .../clear_trained_model_deployment_cache.go | 99 +- .../response.go | 4 +- .../v8/typedapi/ml/closejob/close_job.go | 90 +- .../v8/typedapi/ml/closejob/request.go | 4 +- .../v8/typedapi/ml/closejob/response.go | 4 +- .../ml/deletecalendar/delete_calendar.go | 97 +- .../v8/typedapi/ml/deletecalendar/response.go | 4 +- .../delete_calendar_event.go | 100 +- .../ml/deletecalendarevent/response.go | 4 +- .../deletecalendarjob/delete_calendar_job.go | 100 +- .../typedapi/ml/deletecalendarjob/response.go | 4 +- .../ml/deletedatafeed/delete_datafeed.go | 97 +- .../v8/typedapi/ml/deletedatafeed/response.go | 4 +- .../delete_data_frame_analytics.go | 97 +- .../ml/deletedataframeanalytics/response.go | 4 +- .../deleteexpireddata/delete_expired_data.go | 90 +- .../typedapi/ml/deleteexpireddata/request.go | 4 +- .../typedapi/ml/deleteexpireddata/response.go | 4 +- .../typedapi/ml/deletefilter/delete_filter.go | 97 +- .../v8/typedapi/ml/deletefilter/response.go | 4 +- .../ml/deleteforecast/delete_forecast.go | 103 +- .../v8/typedapi/ml/deleteforecast/response.go | 4 +- .../v8/typedapi/ml/deletejob/delete_job.go | 97 +- .../v8/typedapi/ml/deletejob/response.go | 4 +- .../delete_model_snapshot.go | 100 +- .../ml/deletemodelsnapshot/response.go | 4 +- .../delete_trained_model.go | 97 +- .../ml/deletetrainedmodel/response.go | 4 +- .../delete_trained_model_alias.go | 102 +- .../ml/deletetrainedmodelalias/response.go | 4 +- .../estimate_model_memory.go | 87 +- .../ml/estimatemodelmemory/request.go | 4 +- .../ml/estimatemodelmemory/response.go | 4 +- .../evaluatedataframe/evaluate_data_frame.go | 87 +- .../typedapi/ml/evaluatedataframe/request.go | 4 +- .../typedapi/ml/evaluatedataframe/response.go | 4 +- .../explain_data_frame_analytics.go | 90 +- .../ml/explaindataframeanalytics/request.go | 4 +- .../ml/explaindataframeanalytics/response.go | 4 +- .../v8/typedapi/ml/flushjob/flush_job.go | 90 +- .../v8/typedapi/ml/flushjob/request.go | 4 +- .../v8/typedapi/ml/flushjob/response.go | 4 +- .../v8/typedapi/ml/forecast/forecast.go | 90 +- .../v8/typedapi/ml/forecast/request.go | 4 +- .../v8/typedapi/ml/forecast/response.go | 4 +- .../v8/typedapi/ml/getbuckets/get_buckets.go | 96 +- .../v8/typedapi/ml/getbuckets/request.go | 4 +- .../v8/typedapi/ml/getbuckets/response.go | 4 +- .../getcalendarevents/get_calendar_events.go | 97 +- .../typedapi/ml/getcalendarevents/response.go | 4 +- .../typedapi/ml/getcalendars/get_calendars.go | 90 +- .../v8/typedapi/ml/getcalendars/request.go | 4 +- .../v8/typedapi/ml/getcalendars/response.go | 4 +- .../ml/getcategories/get_categories.go | 96 +- .../v8/typedapi/ml/getcategories/request.go | 4 +- .../v8/typedapi/ml/getcategories/response.go | 4 +- .../typedapi/ml/getdatafeeds/get_datafeeds.go | 97 +- .../v8/typedapi/ml/getdatafeeds/response.go | 4 +- .../ml/getdatafeedstats/get_datafeed_stats.go | 97 +- .../typedapi/ml/getdatafeedstats/response.go | 4 +- .../get_data_frame_analytics.go | 97 +- .../ml/getdataframeanalytics/response.go | 4 +- .../get_data_frame_analytics_stats.go | 97 +- .../ml/getdataframeanalyticsstats/response.go | 4 +- .../v8/typedapi/ml/getfilters/get_filters.go | 97 +- .../v8/typedapi/ml/getfilters/response.go | 4 +- .../ml/getinfluencers/get_influencers.go | 90 +- .../v8/typedapi/ml/getinfluencers/request.go | 4 +- .../v8/typedapi/ml/getinfluencers/response.go | 4 +- .../v8/typedapi/ml/getjobs/get_jobs.go | 97 +- .../v8/typedapi/ml/getjobs/response.go | 4 +- .../typedapi/ml/getjobstats/get_job_stats.go | 97 +- .../v8/typedapi/ml/getjobstats/response.go | 4 +- .../ml/getmemorystats/get_memory_stats.go | 97 +- .../v8/typedapi/ml/getmemorystats/response.go | 4 +- .../getmodelsnapshots/get_model_snapshots.go | 96 +- .../typedapi/ml/getmodelsnapshots/request.go | 4 +- .../typedapi/ml/getmodelsnapshots/response.go | 4 +- .../get_model_snapshot_upgrade_stats.go | 100 +- .../getmodelsnapshotupgradestats/response.go | 4 +- .../getoverallbuckets/get_overall_buckets.go | 90 +- .../typedapi/ml/getoverallbuckets/request.go | 4 +- .../typedapi/ml/getoverallbuckets/response.go | 4 +- .../v8/typedapi/ml/getrecords/get_records.go | 90 +- .../v8/typedapi/ml/getrecords/request.go | 4 +- .../v8/typedapi/ml/getrecords/response.go | 4 +- .../ml/gettrainedmodels/get_trained_models.go | 97 +- .../typedapi/ml/gettrainedmodels/response.go | 4 +- .../get_trained_models_stats.go | 97 +- .../ml/gettrainedmodelsstats/response.go | 4 +- .../infertrainedmodel/infer_trained_model.go | 93 +- .../typedapi/ml/infertrainedmodel/request.go | 4 +- .../typedapi/ml/infertrainedmodel/response.go | 4 +- .../v8/typedapi/ml/info/info.go | 94 +- .../v8/typedapi/ml/info/response.go | 4 +- .../v8/typedapi/ml/openjob/open_job.go | 90 +- .../v8/typedapi/ml/openjob/request.go | 4 +- .../v8/typedapi/ml/openjob/response.go | 4 +- .../post_calendar_events.go | 90 +- .../typedapi/ml/postcalendarevents/request.go | 4 +- .../ml/postcalendarevents/response.go | 4 +- .../v8/typedapi/ml/postdata/post_data.go | 90 +- .../v8/typedapi/ml/postdata/request.go | 4 +- .../v8/typedapi/ml/postdata/response.go | 4 +- .../ml/previewdatafeed/preview_datafeed.go | 90 +- .../v8/typedapi/ml/previewdatafeed/request.go | 4 +- .../typedapi/ml/previewdatafeed/response.go | 4 +- .../preview_data_frame_analytics.go | 90 +- .../ml/previewdataframeanalytics/request.go | 4 +- .../ml/previewdataframeanalytics/response.go | 4 +- .../typedapi/ml/putcalendar/put_calendar.go | 90 +- .../v8/typedapi/ml/putcalendar/request.go | 4 +- .../v8/typedapi/ml/putcalendar/response.go | 4 +- .../ml/putcalendarjob/put_calendar_job.go | 100 +- .../v8/typedapi/ml/putcalendarjob/response.go | 4 +- .../typedapi/ml/putdatafeed/put_datafeed.go | 90 +- .../v8/typedapi/ml/putdatafeed/request.go | 4 +- .../v8/typedapi/ml/putdatafeed/response.go | 4 +- .../put_data_frame_analytics.go | 90 +- .../ml/putdataframeanalytics/request.go | 4 +- .../ml/putdataframeanalytics/response.go | 4 +- .../v8/typedapi/ml/putfilter/put_filter.go | 90 +- .../v8/typedapi/ml/putfilter/request.go | 4 +- .../v8/typedapi/ml/putfilter/response.go | 4 +- .../v8/typedapi/ml/putjob/put_job.go | 90 +- .../v8/typedapi/ml/putjob/request.go | 4 +- .../v8/typedapi/ml/putjob/response.go | 4 +- .../ml/puttrainedmodel/put_trained_model.go | 90 +- .../v8/typedapi/ml/puttrainedmodel/request.go | 4 +- .../typedapi/ml/puttrainedmodel/response.go | 4 +- .../put_trained_model_alias.go | 102 +- .../ml/puttrainedmodelalias/response.go | 4 +- .../put_trained_model_definition_part.go | 93 +- .../puttrainedmodeldefinitionpart/request.go | 4 +- .../puttrainedmodeldefinitionpart/response.go | 4 +- .../put_trained_model_vocabulary.go | 90 +- .../ml/puttrainedmodelvocabulary/request.go | 4 +- .../ml/puttrainedmodelvocabulary/response.go | 4 +- .../v8/typedapi/ml/resetjob/reset_job.go | 97 +- .../v8/typedapi/ml/resetjob/response.go | 4 +- .../ml/revertmodelsnapshot/request.go | 4 +- .../ml/revertmodelsnapshot/response.go | 4 +- .../revert_model_snapshot.go | 93 +- .../v8/typedapi/ml/setupgrademode/response.go | 4 +- .../ml/setupgrademode/set_upgrade_mode.go | 94 +- .../v8/typedapi/ml/startdatafeed/request.go | 4 +- .../v8/typedapi/ml/startdatafeed/response.go | 4 +- .../ml/startdatafeed/start_datafeed.go | 90 +- .../ml/startdataframeanalytics/response.go | 4 +- .../start_data_frame_analytics.go | 99 +- .../starttrainedmodeldeployment/response.go | 4 +- .../start_trained_model_deployment.go | 99 +- .../v8/typedapi/ml/stopdatafeed/request.go | 4 +- .../v8/typedapi/ml/stopdatafeed/response.go | 4 +- .../typedapi/ml/stopdatafeed/stop_datafeed.go | 90 +- .../ml/stopdataframeanalytics/response.go | 4 +- .../stop_data_frame_analytics.go | 99 +- .../ml/stoptrainedmodeldeployment/response.go | 4 +- .../stop_trained_model_deployment.go | 99 +- .../v8/typedapi/ml/updatedatafeed/request.go | 4 +- .../v8/typedapi/ml/updatedatafeed/response.go | 4 +- .../ml/updatedatafeed/update_datafeed.go | 90 +- .../ml/updatedataframeanalytics/request.go | 4 +- .../ml/updatedataframeanalytics/response.go | 4 +- .../update_data_frame_analytics.go | 90 +- .../v8/typedapi/ml/updatefilter/request.go | 4 +- .../v8/typedapi/ml/updatefilter/response.go | 4 +- .../typedapi/ml/updatefilter/update_filter.go | 90 +- .../v8/typedapi/ml/updatejob/request.go | 4 +- .../v8/typedapi/ml/updatejob/response.go | 4 +- .../v8/typedapi/ml/updatejob/update_job.go | 90 +- .../ml/updatemodelsnapshot/request.go | 4 +- .../ml/updatemodelsnapshot/response.go | 4 +- .../update_model_snapshot.go | 93 +- .../ml/upgradejobsnapshot/response.go | 4 +- .../upgrade_job_snapshot.go | 100 +- .../v8/typedapi/ml/validate/request.go | 4 +- .../v8/typedapi/ml/validate/response.go | 4 +- .../v8/typedapi/ml/validate/validate.go | 87 +- .../typedapi/ml/validatedetector/request.go | 4 +- .../typedapi/ml/validatedetector/response.go | 4 +- .../ml/validatedetector/validate_detector.go | 87 +- .../v8/typedapi/monitoring/bulk/bulk.go | 90 +- .../v8/typedapi/monitoring/bulk/request.go | 4 +- .../v8/typedapi/monitoring/bulk/response.go | 4 +- .../clear_repositories_metering_archive.go | 100 +- .../response.go | 4 +- .../get_repositories_metering_info.go | 97 +- .../getrepositoriesmeteringinfo/response.go | 4 +- .../typedapi/nodes/hotthreads/hot_threads.go | 97 +- .../v8/typedapi/nodes/hotthreads/response.go | 4 +- .../v8/typedapi/nodes/info/info.go | 106 +- .../v8/typedapi/nodes/info/response.go | 4 +- .../reload_secure_settings.go | 90 +- .../nodes/reloadsecuresettings/request.go | 4 +- .../nodes/reloadsecuresettings/response.go | 46 +- .../v8/typedapi/nodes/stats/response.go | 4 +- .../v8/typedapi/nodes/stats/stats.go | 121 +- .../v8/typedapi/nodes/usage/response.go | 4 +- .../v8/typedapi/nodes/usage/usage.go | 106 +- .../v8/typedapi/queryruleset/delete/delete.go | 97 +- .../typedapi/queryruleset/delete/response.go | 4 +- .../v8/typedapi/queryruleset/get/get.go | 97 +- .../v8/typedapi/queryruleset/get/response.go | 4 +- .../v8/typedapi/queryruleset/list/list.go | 94 +- .../v8/typedapi/queryruleset/list/response.go | 4 +- .../v8/typedapi/queryruleset/put/put.go | 90 +- .../v8/typedapi/queryruleset/put/request.go | 4 +- .../v8/typedapi/queryruleset/put/response.go | 4 +- .../typedapi/rollup/deletejob/delete_job.go | 97 +- .../v8/typedapi/rollup/deletejob/response.go | 4 +- .../v8/typedapi/rollup/getjobs/get_jobs.go | 97 +- .../v8/typedapi/rollup/getjobs/response.go | 4 +- .../rollup/getrollupcaps/get_rollup_caps.go | 97 +- .../typedapi/rollup/getrollupcaps/response.go | 4 +- .../get_rollup_index_caps.go | 97 +- .../rollup/getrollupindexcaps/response.go | 4 +- .../v8/typedapi/rollup/putjob/put_job.go | 90 +- .../v8/typedapi/rollup/putjob/request.go | 4 +- .../v8/typedapi/rollup/putjob/response.go | 4 +- .../typedapi/rollup/rollupsearch/request.go | 4 +- .../typedapi/rollup/rollupsearch/response.go | 4 +- .../rollup/rollupsearch/rollup_search.go | 90 +- .../v8/typedapi/rollup/startjob/response.go | 4 +- .../v8/typedapi/rollup/startjob/start_job.go | 97 +- .../v8/typedapi/rollup/stopjob/response.go | 4 +- .../v8/typedapi/rollup/stopjob/stop_job.go | 97 +- .../cachestats/cache_stats.go | 97 +- .../cachestats/response.go | 4 +- .../clearcache/clear_cache.go | 97 +- .../clearcache/response.go | 4 +- .../searchablesnapshots/mount/mount.go | 93 +- .../searchablesnapshots/mount/request.go | 4 +- .../searchablesnapshots/mount/response.go | 4 +- .../searchablesnapshots/stats/response.go | 4 +- .../searchablesnapshots/stats/stats.go | 97 +- .../searchapplication/delete/delete.go | 99 +- .../searchapplication/delete/response.go | 4 +- .../delete_behavioral_analytics.go | 97 +- .../deletebehavioralanalytics/response.go | 4 +- .../v8/typedapi/searchapplication/get/get.go | 97 +- .../searchapplication/get/response.go | 4 +- .../get_behavioral_analytics.go | 97 +- .../getbehavioralanalytics/response.go | 4 +- .../typedapi/searchapplication/list/list.go | 94 +- .../searchapplication/list/response.go | 4 +- .../v8/typedapi/searchapplication/put/put.go | 90 +- .../typedapi/searchapplication/put/request.go | 4 +- .../searchapplication/put/response.go | 4 +- .../put_behavioral_analytics.go | 97 +- .../putbehavioralanalytics/response.go | 4 +- .../searchapplication/search/request.go | 4 +- .../searchapplication/search/response.go | 4 +- .../searchapplication/search/search.go | 90 +- .../activate_user_profile.go | 87 +- .../security/activateuserprofile/request.go | 4 +- .../security/activateuserprofile/response.go | 4 +- .../security/authenticate/authenticate.go | 94 +- .../security/authenticate/response.go | 4 +- .../bulkupdateapikeys/bulk_update_api_keys.go | 73 +- .../changepassword/change_password.go | 90 +- .../security/changepassword/request.go | 4 +- .../security/changepassword/response.go | 4 +- .../clearapikeycache/clear_api_key_cache.go | 97 +- .../security/clearapikeycache/response.go | 4 +- .../clear_cached_privileges.go | 97 +- .../clearcachedprivileges/response.go | 4 +- .../clearcachedrealms/clear_cached_realms.go | 97 +- .../security/clearcachedrealms/response.go | 4 +- .../clearcachedroles/clear_cached_roles.go | 97 +- .../security/clearcachedroles/response.go | 4 +- .../clear_cached_service_tokens.go | 103 +- .../clearcachedservicetokens/response.go | 4 +- .../security/createapikey/create_api_key.go | 87 +- .../typedapi/security/createapikey/request.go | 4 +- .../security/createapikey/response.go | 4 +- .../create_cross_cluster_api_key.go | 73 +- .../create_service_token.go | 109 +- .../security/createservicetoken/response.go | 4 +- .../deleteprivileges/delete_privileges.go | 100 +- .../security/deleteprivileges/response.go | 4 +- .../security/deleterole/delete_role.go | 97 +- .../typedapi/security/deleterole/response.go | 4 +- .../deleterolemapping/delete_role_mapping.go | 97 +- .../security/deleterolemapping/response.go | 4 +- .../delete_service_token.go | 103 +- .../security/deleteservicetoken/response.go | 4 +- .../security/deleteuser/delete_user.go | 97 +- .../typedapi/security/deleteuser/response.go | 4 +- .../security/disableuser/disable_user.go | 97 +- .../typedapi/security/disableuser/response.go | 4 +- .../disable_user_profile.go | 97 +- .../security/disableuserprofile/response.go | 4 +- .../security/enableuser/enable_user.go | 97 +- .../typedapi/security/enableuser/response.go | 4 +- .../enableuserprofile/enable_user_profile.go | 97 +- .../security/enableuserprofile/response.go | 4 +- .../security/enrollkibana/enroll_kibana.go | 96 +- .../security/enrollkibana/response.go | 4 +- .../security/enrollnode/enroll_node.go | 96 +- .../typedapi/security/enrollnode/response.go | 4 +- .../security/getapikey/get_api_key.go | 106 +- .../typedapi/security/getapikey/response.go | 4 +- .../get_builtin_privileges.go | 94 +- .../security/getbuiltinprivileges/response.go | 4 +- .../security/getprivileges/get_privileges.go | 103 +- .../security/getprivileges/response.go | 4 +- .../v8/typedapi/security/getrole/get_role.go | 97 +- .../v8/typedapi/security/getrole/response.go | 4 +- .../getrolemapping/get_role_mapping.go | 97 +- .../security/getrolemapping/response.go | 4 +- .../get_service_accounts.go | 103 +- .../security/getserviceaccounts/response.go | 4 +- .../get_service_credentials.go | 100 +- .../getservicecredentials/response.go | 4 +- .../security/getsettings/get_settings.go | 232 ++ .../typedapi/security/gettoken/get_token.go | 87 +- .../v8/typedapi/security/gettoken/request.go | 4 +- .../v8/typedapi/security/gettoken/response.go | 4 +- .../v8/typedapi/security/getuser/get_user.go | 97 +- .../v8/typedapi/security/getuser/response.go | 4 +- .../getuserprivileges/get_user_privileges.go | 94 +- .../security/getuserprivileges/response.go | 4 +- .../getuserprofile/get_user_profile.go | 97 +- .../security/getuserprofile/response.go | 4 +- .../security/grantapikey/grant_api_key.go | 87 +- .../typedapi/security/grantapikey/request.go | 4 +- .../typedapi/security/grantapikey/response.go | 4 +- .../security/hasprivileges/has_privileges.go | 90 +- .../security/hasprivileges/request.go | 4 +- .../security/hasprivileges/response.go | 4 +- .../has_privileges_user_profile.go | 87 +- .../hasprivilegesuserprofile/request.go | 4 +- .../hasprivilegesuserprofile/response.go | 4 +- .../invalidateapikey/invalidate_api_key.go | 87 +- .../security/invalidateapikey/request.go | 4 +- .../security/invalidateapikey/response.go | 4 +- .../invalidatetoken/invalidate_token.go | 87 +- .../security/invalidatetoken/request.go | 4 +- .../security/invalidatetoken/response.go | 4 +- .../oidcauthenticate/oidc_authenticate.go | 73 +- .../security/oidclogout/oidc_logout.go | 73 +- .../oidc_prepare_authentication.go | 73 +- .../security/putprivileges/put_privileges.go | 87 +- .../security/putprivileges/request.go | 4 +- .../security/putprivileges/response.go | 4 +- .../v8/typedapi/security/putrole/put_role.go | 90 +- .../v8/typedapi/security/putrole/request.go | 4 +- .../v8/typedapi/security/putrole/response.go | 4 +- .../putrolemapping/put_role_mapping.go | 97 +- .../security/putrolemapping/request.go | 15 +- .../security/putrolemapping/response.go | 4 +- .../v8/typedapi/security/putuser/put_user.go | 90 +- .../v8/typedapi/security/putuser/request.go | 4 +- .../v8/typedapi/security/putuser/response.go | 4 +- .../security/queryapikeys/query_api_keys.go | 87 +- .../typedapi/security/queryapikeys/request.go | 4 +- .../security/queryapikeys/response.go | 4 +- .../security/samlauthenticate/request.go | 4 +- .../security/samlauthenticate/response.go | 4 +- .../samlauthenticate/saml_authenticate.go | 87 +- .../security/samlcompletelogout/request.go | 4 +- .../saml_complete_logout.go | 64 +- .../security/samlinvalidate/request.go | 4 +- .../security/samlinvalidate/response.go | 4 +- .../samlinvalidate/saml_invalidate.go | 87 +- .../typedapi/security/samllogout/request.go | 4 +- .../typedapi/security/samllogout/response.go | 4 +- .../security/samllogout/saml_logout.go | 87 +- .../samlprepareauthentication/request.go | 4 +- .../samlprepareauthentication/response.go | 4 +- .../saml_prepare_authentication.go | 87 +- .../samlserviceprovidermetadata/response.go | 4 +- .../saml_service_provider_metadata.go | 99 +- .../security/suggestuserprofiles/request.go | 4 +- .../security/suggestuserprofiles/response.go | 4 +- .../suggest_user_profiles.go | 87 +- .../typedapi/security/updateapikey/request.go | 4 +- .../security/updateapikey/response.go | 4 +- .../security/updateapikey/update_api_key.go | 90 +- .../updatesettings/update_settings.go | 232 ++ .../security/updateuserprofiledata/request.go | 4 +- .../updateuserprofiledata/response.go | 4 +- .../update_user_profile_data.go | 90 +- .../shutdown/deletenode/delete_node.go | 99 +- .../typedapi/shutdown/deletenode/response.go | 4 +- .../v8/typedapi/shutdown/getnode/get_node.go | 99 +- .../v8/typedapi/shutdown/getnode/response.go | 4 +- .../v8/typedapi/shutdown/putnode/put_node.go | 90 +- .../v8/typedapi/shutdown/putnode/request.go | 4 +- .../v8/typedapi/shutdown/putnode/response.go | 4 +- .../slm/deletelifecycle/delete_lifecycle.go | 97 +- .../typedapi/slm/deletelifecycle/response.go | 4 +- .../slm/executelifecycle/execute_lifecycle.go | 97 +- .../typedapi/slm/executelifecycle/response.go | 4 +- .../slm/executeretention/execute_retention.go | 94 +- .../typedapi/slm/executeretention/response.go | 4 +- .../slm/getlifecycle/get_lifecycle.go | 97 +- .../v8/typedapi/slm/getlifecycle/response.go | 4 +- .../v8/typedapi/slm/getstats/get_stats.go | 94 +- .../v8/typedapi/slm/getstats/response.go | 4 +- .../v8/typedapi/slm/getstatus/get_status.go | 94 +- .../v8/typedapi/slm/getstatus/response.go | 4 +- .../slm/putlifecycle/put_lifecycle.go | 90 +- .../v8/typedapi/slm/putlifecycle/request.go | 4 +- .../v8/typedapi/slm/putlifecycle/response.go | 4 +- .../v8/typedapi/slm/start/response.go | 4 +- .../v8/typedapi/slm/start/start.go | 94 +- .../v8/typedapi/slm/stop/response.go | 4 +- .../v8/typedapi/slm/stop/stop.go | 94 +- .../cleanuprepository/cleanup_repository.go | 97 +- .../snapshot/cleanuprepository/response.go | 4 +- .../v8/typedapi/snapshot/clone/clone.go | 96 +- .../v8/typedapi/snapshot/clone/request.go | 4 +- .../v8/typedapi/snapshot/clone/response.go | 4 +- .../v8/typedapi/snapshot/create/create.go | 93 +- .../v8/typedapi/snapshot/create/request.go | 4 +- .../v8/typedapi/snapshot/create/response.go | 4 +- .../createrepository/create_repository.go | 90 +- .../snapshot/createrepository/request.go | 4 +- .../snapshot/createrepository/response.go | 4 +- .../v8/typedapi/snapshot/delete/delete.go | 100 +- .../v8/typedapi/snapshot/delete/response.go | 4 +- .../deleterepository/delete_repository.go | 97 +- .../snapshot/deleterepository/response.go | 4 +- .../v8/typedapi/snapshot/get/get.go | 100 +- .../v8/typedapi/snapshot/get/response.go | 4 +- .../snapshot/getrepository/get_repository.go | 97 +- .../snapshot/getrepository/response.go | 4 +- .../v8/typedapi/snapshot/restore/request.go | 4 +- .../v8/typedapi/snapshot/restore/response.go | 4 +- .../v8/typedapi/snapshot/restore/restore.go | 93 +- .../v8/typedapi/snapshot/status/response.go | 4 +- .../v8/typedapi/snapshot/status/status.go | 103 +- .../snapshot/verifyrepository/response.go | 4 +- .../verifyrepository/verify_repository.go | 97 +- .../typedapi/sql/clearcursor/clear_cursor.go | 87 +- .../v8/typedapi/sql/clearcursor/request.go | 4 +- .../v8/typedapi/sql/clearcursor/response.go | 4 +- .../typedapi/sql/deleteasync/delete_async.go | 97 +- .../v8/typedapi/sql/deleteasync/response.go | 4 +- .../v8/typedapi/sql/getasync/get_async.go | 97 +- .../v8/typedapi/sql/getasync/response.go | 4 +- .../sql/getasyncstatus/get_async_status.go | 97 +- .../typedapi/sql/getasyncstatus/response.go | 4 +- .../v8/typedapi/sql/query/query.go | 87 +- .../v8/typedapi/sql/query/request.go | 4 +- .../v8/typedapi/sql/query/response.go | 4 +- .../v8/typedapi/sql/translate/request.go | 4 +- .../v8/typedapi/sql/translate/response.go | 4 +- .../v8/typedapi/sql/translate/translate.go | 87 +- .../typedapi/ssl/certificates/certificates.go | 94 +- .../v8/typedapi/ssl/certificates/response.go | 4 +- .../synonyms/deletesynonym/delete_synonym.go | 97 +- .../synonyms/deletesynonym/response.go | 4 +- .../deletesynonymrule/delete_synonym_rule.go | 102 +- .../synonyms/deletesynonymrule/response.go | 4 +- .../synonyms/getsynonym/get_synonym.go | 97 +- .../typedapi/synonyms/getsynonym/response.go | 4 +- .../getsynonymrule/get_synonym_rule.go | 102 +- .../synonyms/getsynonymrule/response.go | 4 +- .../getsynonymssets/get_synonyms_sets.go | 94 +- .../synonyms/getsynonymssets/response.go | 4 +- .../synonyms/putsynonym/put_synonym.go | 90 +- .../typedapi/synonyms/putsynonym/request.go | 4 +- .../typedapi/synonyms/putsynonym/response.go | 4 +- .../putsynonymrule/put_synonym_rule.go | 93 +- .../synonyms/putsynonymrule/request.go | 4 +- .../synonyms/putsynonymrule/response.go | 4 +- .../v8/typedapi/tasks/cancel/cancel.go | 97 +- .../v8/typedapi/tasks/cancel/response.go | 4 +- .../v8/typedapi/tasks/get/get.go | 97 +- .../v8/typedapi/tasks/get/response.go | 4 +- .../v8/typedapi/tasks/list/list.go | 94 +- .../v8/typedapi/tasks/list/response.go | 4 +- .../findstructure/find_structure.go | 87 +- .../textstructure/findstructure/request.go | 4 +- .../textstructure/findstructure/response.go | 4 +- .../deletetransform/delete_transform.go | 97 +- .../transform/deletetransform/response.go | 4 +- .../transform/gettransform/get_transform.go | 97 +- .../transform/gettransform/response.go | 4 +- .../gettransformstats/get_transform_stats.go | 97 +- .../transform/gettransformstats/response.go | 4 +- .../previewtransform/preview_transform.go | 90 +- .../transform/previewtransform/request.go | 4 +- .../transform/previewtransform/response.go | 4 +- .../transform/puttransform/put_transform.go | 90 +- .../transform/puttransform/request.go | 4 +- .../transform/puttransform/response.go | 4 +- .../resettransform/reset_transform.go | 97 +- .../transform/resettransform/response.go | 4 +- .../schedulenowtransform/response.go | 4 +- .../schedule_now_transform.go | 99 +- .../transform/starttransform/response.go | 4 +- .../starttransform/start_transform.go | 97 +- .../transform/stoptransform/response.go | 4 +- .../transform/stoptransform/stop_transform.go | 97 +- .../transform/updatetransform/request.go | 4 +- .../transform/updatetransform/response.go | 4 +- .../updatetransform/update_transform.go | 90 +- .../transform/upgradetransforms/response.go | 4 +- .../upgradetransforms/upgrade_transforms.go | 96 +- .../v8/typedapi/types/acknowledgement.go | 4 +- .../v8/typedapi/types/acknowledgestate.go | 4 +- .../v8/typedapi/types/actionstatus.go | 4 +- .../v8/typedapi/types/activationstate.go | 4 +- .../v8/typedapi/types/activationstatus.go | 4 +- .../v8/typedapi/types/adaptiveselection.go | 4 +- .../v8/typedapi/types/addaction.go | 4 +- .../types/adjacencymatrixaggregate.go | 4 +- .../types/adjacencymatrixaggregation.go | 4 +- .../typedapi/types/adjacencymatrixbucket.go | 4 +- .../v8/typedapi/types/aggregate.go | 4 +- .../types/aggregatemetricdoubleproperty.go | 4 +- .../v8/typedapi/types/aggregateorder.go | 4 +- .../v8/typedapi/types/aggregateoutput.go | 4 +- .../v8/typedapi/types/aggregation.go | 4 +- .../v8/typedapi/types/aggregationbreakdown.go | 4 +- .../v8/typedapi/types/aggregationprofile.go | 4 +- .../typedapi/types/aggregationprofiledebug.go | 4 +- .../aggregationprofiledelegatedebugfilter.go | 4 +- .../v8/typedapi/types/aggregationrange.go | 4 +- .../v8/typedapi/types/aggregations.go | 4 +- .../v8/typedapi/types/alias.go | 4 +- .../v8/typedapi/types/aliasdefinition.go | 4 +- .../v8/typedapi/types/aliasesrecord.go | 4 +- .../v8/typedapi/types/allfield.go | 4 +- .../v8/typedapi/types/allocationdecision.go | 4 +- .../v8/typedapi/types/allocationrecord.go | 4 +- .../v8/typedapi/types/allocationstore.go | 4 +- .../v8/typedapi/types/alwayscondition.go | 4 +- .../v8/typedapi/types/analysisconfig.go | 4 +- .../v8/typedapi/types/analysisconfigread.go | 4 +- .../v8/typedapi/types/analysislimits.go | 4 +- .../v8/typedapi/types/analysismemorylimit.go | 4 +- .../v8/typedapi/types/analytics.go | 4 +- .../v8/typedapi/types/analyticscollection.go | 4 +- .../v8/typedapi/types/analyticsstatistics.go | 4 +- .../v8/typedapi/types/analyzedetail.go | 4 +- .../v8/typedapi/types/analyzer.go | 4 +- .../v8/typedapi/types/analyzerdetail.go | 4 +- .../v8/typedapi/types/analyzetoken.go | 4 +- .../v8/typedapi/types/anomaly.go | 4 +- .../v8/typedapi/types/anomalycause.go | 4 +- .../v8/typedapi/types/anomalydetectors.go | 4 +- .../v8/typedapi/types/anomalyexplanation.go | 4 +- .../v8/typedapi/types/apikey.go | 4 +- .../v8/typedapi/types/apikeyauthorization.go | 4 +- .../v8/typedapi/types/appendprocessor.go | 4 +- .../types/applicationglobaluserprivileges.go | 4 +- .../typedapi/types/applicationprivileges.go | 4 +- .../types/applicationprivilegescheck.go | 4 +- .../typedapi/types/applicationsprivileges.go | 4 +- .../v8/typedapi/types/archive.go | 4 +- .../typedapi/types/arraycomparecondition.go | 4 +- .../v8/typedapi/types/arraycompareopparams.go | 4 +- .../v8/typedapi/types/arraypercentilesitem.go | 4 +- .../typedapi/types/asciifoldingtokenfilter.go | 4 +- .../v8/typedapi/types/asyncsearch.go | 4 +- .../v8/typedapi/types/attachmentprocessor.go | 4 +- .../v8/typedapi/types/audit.go | 4 +- .../v8/typedapi/types/authenticateduser.go | 4 +- .../v8/typedapi/types/authenticatetoken.go | 4 +- .../typedapi/types/authenticationprovider.go | 4 +- .../types/autodatehistogramaggregate.go | 4 +- .../types/autodatehistogramaggregation.go | 37 +- .../v8/typedapi/types/autofollowedcluster.go | 4 +- .../v8/typedapi/types/autofollowpattern.go | 4 +- .../types/autofollowpatternsummary.go | 4 +- .../v8/typedapi/types/autofollowstats.go | 4 +- .../v8/typedapi/types/autoscalingcapacity.go | 4 +- .../v8/typedapi/types/autoscalingdecider.go | 4 +- .../v8/typedapi/types/autoscalingdeciders.go | 4 +- .../v8/typedapi/types/autoscalingnode.go | 4 +- .../v8/typedapi/types/autoscalingpolicy.go | 4 +- .../v8/typedapi/types/autoscalingresources.go | 4 +- .../v8/typedapi/types/averageaggregation.go | 37 +- .../types/averagebucketaggregation.go | 4 +- .../v8/typedapi/types/avgaggregate.go | 4 +- .../v8/typedapi/types/base.go | 4 +- .../v8/typedapi/types/baseindicator.go | 4 +- .../v8/typedapi/types/basenode.go | 4 +- .../v8/typedapi/types/binaryproperty.go | 4 +- .../v8/typedapi/types/booleanproperty.go | 4 +- .../v8/typedapi/types/boolquery.go | 4 +- .../v8/typedapi/types/boostingquery.go | 4 +- .../v8/typedapi/types/boxplotaggregate.go | 4 +- .../v8/typedapi/types/boxplotaggregation.go | 37 +- .../v8/typedapi/types/breaker.go | 4 +- .../types/bucketcorrelationaggregation.go | 4 +- .../types/bucketcorrelationfunction.go | 4 +- ...cketcorrelationfunctioncountcorrelation.go | 4 +- ...lationfunctioncountcorrelationindicator.go | 4 +- .../v8/typedapi/types/bucketinfluencer.go | 4 +- .../v8/typedapi/types/bucketksaggregation.go | 4 +- .../types/bucketmetricvalueaggregate.go | 4 +- .../typedapi/types/bucketpathaggregation.go | 4 +- .../types/bucketsadjacencymatrixbucket.go | 4 +- .../typedapi/types/bucketscompositebucket.go | 4 +- .../typedapi/types/bucketscriptaggregation.go | 37 +- .../types/bucketsdatehistogrambucket.go | 4 +- .../types/bucketsdoubletermsbucket.go | 4 +- .../types/bucketselectoraggregation.go | 37 +- .../v8/typedapi/types/bucketsfiltersbucket.go | 4 +- .../types/bucketsfrequentitemsetsbucket.go | 4 +- .../types/bucketsgeohashgridbucket.go | 4 +- .../typedapi/types/bucketsgeohexgridbucket.go | 4 +- .../types/bucketsgeotilegridbucket.go | 4 +- .../typedapi/types/bucketshistogrambucket.go | 4 +- .../typedapi/types/bucketsipprefixbucket.go | 4 +- .../v8/typedapi/types/bucketsiprangebucket.go | 4 +- .../types/bucketslongraretermsbucket.go | 4 +- .../typedapi/types/bucketslongtermsbucket.go | 4 +- .../typedapi/types/bucketsmultitermsbucket.go | 4 +- .../typedapi/types/bucketsortaggregation.go | 4 +- .../v8/typedapi/types/bucketspath.go | 4 +- .../v8/typedapi/types/bucketsquery.go | 4 +- .../v8/typedapi/types/bucketsrangebucket.go | 4 +- .../bucketssignificantlongtermsbucket.go | 4 +- .../bucketssignificantstringtermsbucket.go | 4 +- .../types/bucketsstringraretermsbucket.go | 4 +- .../types/bucketsstringtermsbucket.go | 4 +- .../v8/typedapi/types/bucketsummary.go | 4 +- .../bucketsvariablewidthhistogrambucket.go | 4 +- .../v8/typedapi/types/bucketsvoid.go | 4 +- .../v8/typedapi/types/buildinformation.go | 4 +- .../types/bulkindexbyscrollfailure.go | 4 +- .../v8/typedapi/types/bulkstats.go | 4 +- .../v8/typedapi/types/bytenumberproperty.go | 37 +- .../v8/typedapi/types/bytesize.go | 4 +- .../v8/typedapi/types/bytesprocessor.go | 4 +- .../v8/typedapi/types/cachequeries.go | 4 +- .../v8/typedapi/types/cachestats.go | 4 +- .../v8/typedapi/types/calendar.go | 4 +- .../v8/typedapi/types/calendarevent.go | 4 +- .../v8/typedapi/types/cardinalityaggregate.go | 4 +- .../typedapi/types/cardinalityaggregation.go | 37 +- .../types/catanonalydetectorcolumns.go | 4 +- .../v8/typedapi/types/catcomponenttemplate.go | 4 +- .../v8/typedapi/types/catdatafeedcolumns.go | 4 +- .../v8/typedapi/types/catdfacolumns.go | 4 +- .../typedapi/types/categorizationanalyzer.go | 4 +- .../types/categorizationanalyzerdefinition.go | 4 +- .../types/categorizetextaggregation.go | 4 +- .../typedapi/types/categorizetextanalyzer.go | 4 +- .../v8/typedapi/types/category.go | 4 +- .../typedapi/types/cattrainedmodelscolumns.go | 4 +- .../v8/typedapi/types/cattransformcolumns.go | 4 +- .../go-elasticsearch/v8/typedapi/types/ccr.go | 4 +- .../v8/typedapi/types/ccrshardstats.go | 4 +- .../typedapi/types/certificateinformation.go | 4 +- .../v8/typedapi/types/cgroup.go | 4 +- .../v8/typedapi/types/cgroupcpu.go | 4 +- .../v8/typedapi/types/cgroupcpustat.go | 4 +- .../v8/typedapi/types/cgroupmemory.go | 4 +- .../v8/typedapi/types/chaininput.go | 4 +- .../v8/typedapi/types/charfilter.go | 4 +- .../v8/typedapi/types/charfilterdefinition.go | 4 +- .../v8/typedapi/types/charfilterdetail.go | 4 +- .../v8/typedapi/types/charfiltertypes.go | 4 +- .../v8/typedapi/types/chargrouptokenizer.go | 4 +- .../v8/typedapi/types/checkpointing.go | 4 +- .../v8/typedapi/types/checkpointstats.go | 4 +- .../v8/typedapi/types/childrenaggregate.go | 4 +- .../v8/typedapi/types/childrenaggregation.go | 4 +- .../v8/typedapi/types/chisquareheuristic.go | 4 +- .../v8/typedapi/types/chunkingconfig.go | 4 +- .../v8/typedapi/types/circleprocessor.go | 4 +- .../types/classificationinferenceoptions.go | 4 +- .../types/cleanuprepositoryresults.go | 4 +- .../v8/typedapi/types/client.go | 4 +- .../v8/typedapi/types/closeindexresult.go | 4 +- .../v8/typedapi/types/closeshardresult.go | 4 +- .../v8/typedapi/types/clusterappliedstats.go | 4 +- .../types/clustercomponenttemplate.go | 4 +- .../v8/typedapi/types/clusterdetails.go | 4 +- .../v8/typedapi/types/clusterfilesystem.go | 4 +- .../typedapi/types/clusterindexingpressure.go | 4 +- .../v8/typedapi/types/clusterindices.go | 4 +- .../v8/typedapi/types/clusterindicesshards.go | 4 +- .../types/clusterindicesshardsindex.go | 4 +- .../v8/typedapi/types/clusterinfo.go | 4 +- .../v8/typedapi/types/clusterinfotargets.go | 4 +- .../v8/typedapi/types/clusteringest.go | 4 +- .../v8/typedapi/types/clusterjvm.go | 4 +- .../v8/typedapi/types/clusterjvmmemory.go | 4 +- .../v8/typedapi/types/clusterjvmversion.go | 4 +- .../v8/typedapi/types/clusternetworktypes.go | 4 +- .../v8/typedapi/types/clusternode.go | 4 +- .../v8/typedapi/types/clusternodecount.go | 4 +- .../v8/typedapi/types/clusternodes.go | 4 +- .../typedapi/types/clusteroperatingsystem.go | 4 +- .../clusteroperatingsystemarchitecture.go | 4 +- .../types/clusteroperatingsystemname.go | 4 +- .../types/clusteroperatingsystemprettyname.go | 4 +- .../typedapi/types/clusterpressurememory.go | 4 +- .../v8/typedapi/types/clusterprocess.go | 4 +- .../v8/typedapi/types/clusterprocesscpu.go | 4 +- .../clusterprocessopenfiledescriptors.go | 4 +- .../v8/typedapi/types/clusterprocessor.go | 4 +- .../v8/typedapi/types/clusterremoteinfo.go | 4 +- .../typedapi/types/clusterremoteproxyinfo.go | 4 +- .../typedapi/types/clusterremotesniffinfo.go | 4 +- .../types/clusterruntimefieldtypes.go | 4 +- .../v8/typedapi/types/clustershardmetrics.go | 4 +- .../v8/typedapi/types/clusterstatequeue.go | 4 +- .../v8/typedapi/types/clusterstateupdate.go | 4 +- .../v8/typedapi/types/clusterstatistics.go | 4 +- .../v8/typedapi/types/collector.go | 4 +- .../v8/typedapi/types/column.go | 4 +- .../v8/typedapi/types/combinedfieldsquery.go | 4 +- .../v8/typedapi/types/command.go | 4 +- .../types/commandallocateprimaryaction.go | 4 +- .../types/commandallocatereplicaaction.go | 4 +- .../v8/typedapi/types/commandcancelaction.go | 4 +- .../v8/typedapi/types/commandmoveaction.go | 4 +- .../typedapi/types/commongramstokenfilter.go | 4 +- .../v8/typedapi/types/commontermsquery.go | 4 +- .../v8/typedapi/types/compactnodeinfo.go | 4 +- .../v8/typedapi/types/completioncontext.go | 4 +- .../v8/typedapi/types/completionproperty.go | 4 +- .../v8/typedapi/types/completionstats.go | 4 +- .../v8/typedapi/types/completionsuggest.go | 4 +- .../v8/typedapi/types/completionsuggester.go | 4 +- .../typedapi/types/completionsuggestoption.go | 4 +- .../typedapi/types/componenttemplatenode.go | 4 +- .../types/componenttemplatesummary.go | 4 +- .../v8/typedapi/types/compositeaggregate.go | 4 +- .../typedapi/types/compositeaggregatekey.go | 4 +- .../v8/typedapi/types/compositeaggregation.go | 4 +- .../types/compositeaggregationsource.go | 4 +- .../v8/typedapi/types/compositebucket.go | 4 +- .../compositedatehistogramaggregation.go | 37 +- .../types/compositegeotilegridaggregation.go | 37 +- .../types/compositehistogramaggregation.go | 37 +- .../types/compositetermsaggregation.go | 37 +- .../v8/typedapi/types/conditiontokenfilter.go | 37 +- .../v8/typedapi/types/configuration.go | 4 +- .../v8/typedapi/types/configurations.go | 4 +- .../v8/typedapi/types/confusionmatrixitem.go | 4 +- .../types/confusionmatrixprediction.go | 4 +- .../types/confusionmatrixthreshold.go | 4 +- .../v8/typedapi/types/connection.go | 4 +- .../typedapi/types/constantkeywordproperty.go | 4 +- .../v8/typedapi/types/constantscorequery.go | 4 +- .../v8/typedapi/types/context.go | 4 +- .../v8/typedapi/types/contextmethod.go | 4 +- .../v8/typedapi/types/contextmethodparam.go | 4 +- .../v8/typedapi/types/convertprocessor.go | 4 +- .../v8/typedapi/types/coordinatorstats.go | 4 +- .../v8/typedapi/types/coordsgeobounds.go | 4 +- .../v8/typedapi/types/coreknnquery.go | 4 +- .../v8/typedapi/types/counter.go | 4 +- .../v8/typedapi/types/countrecord.go | 4 +- .../go-elasticsearch/v8/typedapi/types/cpu.go | 4 +- .../v8/typedapi/types/cpuacct.go | 4 +- .../v8/typedapi/types/createdstatus.go | 4 +- .../v8/typedapi/types/createoperation.go | 4 +- .../v8/typedapi/types/csvprocessor.go | 4 +- .../types/cumulativecardinalityaggregate.go | 4 +- .../types/cumulativecardinalityaggregation.go | 4 +- .../types/cumulativesumaggregation.go | 4 +- .../v8/typedapi/types/currentnode.go | 4 +- .../v8/typedapi/types/customanalyzer.go | 4 +- .../types/customcategorizetextanalyzer.go | 4 +- .../v8/typedapi/types/customnormalizer.go | 4 +- .../v8/typedapi/types/dailyschedule.go | 4 +- .../v8/typedapi/types/danglingindex.go | 4 +- .../v8/typedapi/types/datacounts.go | 4 +- .../v8/typedapi/types/datadescription.go | 4 +- .../v8/typedapi/types/dataemailattachment.go | 4 +- .../typedapi/types/datafeedauthorization.go | 4 +- .../v8/typedapi/types/datafeedconfig.go | 4 +- .../v8/typedapi/types/datafeedrunningstate.go | 4 +- .../v8/typedapi/types/datafeeds.go | 4 +- .../v8/typedapi/types/datafeedsrecord.go | 4 +- .../v8/typedapi/types/datafeedstats.go | 4 +- .../v8/typedapi/types/datafeedtimingstats.go | 4 +- .../v8/typedapi/types/dataframeanalysis.go | 4 +- .../types/dataframeanalysisanalyzedfields.go | 4 +- .../types/dataframeanalysisclassification.go | 4 +- .../types/dataframeanalysiscontainer.go | 4 +- .../dataframeanalysisfeatureprocessor.go | 4 +- ...alysisfeatureprocessorfrequencyencoding.go | 4 +- ...meanalysisfeatureprocessormultiencoding.go | 4 +- ...meanalysisfeatureprocessorngramencoding.go | 4 +- ...eanalysisfeatureprocessoronehotencoding.go | 4 +- ...lysisfeatureprocessortargetmeanencoding.go | 4 +- .../dataframeanalysisoutlierdetection.go | 4 +- .../types/dataframeanalysisregression.go | 4 +- .../v8/typedapi/types/dataframeanalytics.go | 4 +- .../types/dataframeanalyticsauthorization.go | 4 +- .../types/dataframeanalyticsdestination.go | 4 +- .../types/dataframeanalyticsfieldselection.go | 4 +- .../dataframeanalyticsmemoryestimation.go | 4 +- .../types/dataframeanalyticsrecord.go | 4 +- .../types/dataframeanalyticssource.go | 4 +- .../types/dataframeanalyticsstatscontainer.go | 4 +- .../dataframeanalyticsstatsdatacounts.go | 4 +- .../dataframeanalyticsstatshyperparameters.go | 4 +- .../dataframeanalyticsstatsmemoryusage.go | 4 +- ...dataframeanalyticsstatsoutlierdetection.go | 4 +- .../types/dataframeanalyticsstatsprogress.go | 4 +- .../types/dataframeanalyticssummary.go | 4 +- .../types/dataframeclassificationsummary.go | 4 +- .../dataframeclassificationsummaryaccuracy.go | 4 +- ...icationsummarymulticlassconfusionmatrix.go | 4 +- ...dataframeclassificationsummaryprecision.go | 4 +- .../dataframeclassificationsummaryrecall.go | 4 +- .../types/dataframeevaluationclass.go | 4 +- .../dataframeevaluationclassification.go | 4 +- ...ataframeevaluationclassificationmetrics.go | 4 +- ...meevaluationclassificationmetricsaucroc.go | 4 +- .../types/dataframeevaluationcontainer.go | 4 +- .../types/dataframeevaluationmetrics.go | 4 +- .../dataframeevaluationoutlierdetection.go | 4 +- ...aframeevaluationoutlierdetectionmetrics.go | 4 +- .../types/dataframeevaluationregression.go | 4 +- .../dataframeevaluationregressionmetrics.go | 4 +- ...taframeevaluationregressionmetricshuber.go | 4 +- ...ataframeevaluationregressionmetricsmsle.go | 4 +- .../types/dataframeevaluationsummaryaucroc.go | 4 +- ...taframeevaluationsummaryaucroccurveitem.go | 4 +- .../types/dataframeevaluationvalue.go | 4 +- .../types/dataframeoutlierdetectionsummary.go | 4 +- .../typedapi/types/dataframepreviewconfig.go | 4 +- .../types/dataframeregressionsummary.go | 4 +- .../v8/typedapi/types/datapathstats.go | 4 +- .../v8/typedapi/types/datastream.go | 29 +- .../v8/typedapi/types/datastreamindex.go | 36 +- .../v8/typedapi/types/datastreamlifecycle.go | 4 +- .../types/datastreamlifecycledownsampling.go | 4 +- .../types/datastreamlifecycleexplain.go | 4 +- .../datastreamlifecyclerolloverconditions.go | 4 +- .../types/datastreamlifecyclewithrollover.go | 4 +- .../v8/typedapi/types/datastreamnames.go | 4 +- .../v8/typedapi/types/datastreams.go | 4 +- .../v8/typedapi/types/datastreamsstatsitem.go | 4 +- .../v8/typedapi/types/datastreamtimestamp.go | 4 +- .../types/datastreamtimestampfield.go | 4 +- .../v8/typedapi/types/datastreamvisibility.go | 4 +- .../typedapi/types/datastreamwithlifecycle.go | 4 +- .../typedapi/types/datatierphasestatistics.go | 4 +- .../v8/typedapi/types/datatiers.go | 4 +- .../v8/typedapi/types/datedecayfunction.go | 4 +- .../types/datedistancefeaturequery.go | 4 +- .../typedapi/types/datehistogramaggregate.go | 4 +- .../types/datehistogramaggregation.go | 37 +- .../v8/typedapi/types/datehistogrambucket.go | 4 +- .../typedapi/types/datehistogramgrouping.go | 4 +- .../typedapi/types/dateindexnameprocessor.go | 4 +- .../v8/typedapi/types/datenanosproperty.go | 4 +- .../v8/typedapi/types/dateprocessor.go | 4 +- .../v8/typedapi/types/dateproperty.go | 4 +- .../v8/typedapi/types/daterangeaggregate.go | 4 +- .../v8/typedapi/types/daterangeaggregation.go | 4 +- .../v8/typedapi/types/daterangeexpression.go | 4 +- .../v8/typedapi/types/daterangeproperty.go | 4 +- .../v8/typedapi/types/daterangequery.go | 4 +- .../v8/typedapi/types/datetime.go | 4 +- .../v8/typedapi/types/decayfunction.go | 4 +- .../types/decayplacementdatemathduration.go | 4 +- .../types/decayplacementdoubledouble.go | 4 +- .../decayplacementgeolocationdistance.go | 4 +- .../v8/typedapi/types/defaults.go | 4 +- .../v8/typedapi/types/definition.go | 4 +- .../typedapi/types/delayeddatacheckconfig.go | 4 +- .../v8/typedapi/types/deleteoperation.go | 4 +- .../types/delimitedpayloadtokenfilter.go | 4 +- .../typedapi/types/densevectorindexoptions.go | 4 +- .../v8/typedapi/types/densevectorproperty.go | 4 +- .../v8/typedapi/types/deprecation.go | 4 +- .../v8/typedapi/types/deprecationindexing.go | 4 +- .../v8/typedapi/types/derivativeaggregate.go | 4 +- .../typedapi/types/derivativeaggregation.go | 4 +- .../v8/typedapi/types/detectionrule.go | 4 +- .../v8/typedapi/types/detector.go | 4 +- .../v8/typedapi/types/detectorread.go | 4 +- .../v8/typedapi/types/diagnosis.go | 4 +- .../types/diagnosisaffectedresources.go | 4 +- .../dictionarydecompoundertokenfilter.go | 4 +- .../v8/typedapi/types/directgenerator.go | 4 +- .../v8/typedapi/types/discovery.go | 4 +- .../v8/typedapi/types/discoverynode.go | 4 +- .../v8/typedapi/types/diskindicator.go | 4 +- .../v8/typedapi/types/diskindicatordetails.go | 4 +- .../v8/typedapi/types/diskusage.go | 4 +- .../v8/typedapi/types/dismaxquery.go | 4 +- .../v8/typedapi/types/dissectprocessor.go | 4 +- .../v8/typedapi/types/distancefeaturequery.go | 4 +- ...istancefeaturequerybasedatemathduration.go | 4 +- ...ancefeaturequerybasegeolocationdistance.go | 4 +- .../types/diversifiedsampleraggregation.go | 37 +- .../v8/typedapi/types/docstats.go | 4 +- .../v8/typedapi/types/document.go | 4 +- .../v8/typedapi/types/documentrating.go | 4 +- .../v8/typedapi/types/documentsimulation.go | 4 +- .../v8/typedapi/types/dotexpanderprocessor.go | 4 +- .../v8/typedapi/types/doublenumberproperty.go | 37 +- .../v8/typedapi/types/doublerangeproperty.go | 4 +- .../v8/typedapi/types/doubletermsaggregate.go | 4 +- .../v8/typedapi/types/doubletermsbucket.go | 4 +- .../v8/typedapi/types/downsampleconfig.go | 4 +- .../v8/typedapi/types/downsamplinground.go | 4 +- .../v8/typedapi/types/dropprocessor.go | 4 +- .../v8/typedapi/types/duration.go | 4 +- .../types/durationvalueunitfloatmillis.go | 4 +- .../typedapi/types/durationvalueunitmillis.go | 4 +- .../typedapi/types/durationvalueunitnanos.go | 4 +- .../types/durationvalueunitseconds.go | 4 +- .../v8/typedapi/types/dutchanalyzer.go | 4 +- .../v8/typedapi/types/dynamicproperty.go | 37 +- .../v8/typedapi/types/dynamictemplate.go | 4 +- .../v8/typedapi/types/edgengramtokenfilter.go | 4 +- .../v8/typedapi/types/edgengramtokenizer.go | 4 +- .../types/elasticsearchversioninfo.go | 4 +- .../v8/typedapi/types/elisiontokenfilter.go | 4 +- .../v8/typedapi/types/email.go | 4 +- .../v8/typedapi/types/emailaction.go | 4 +- .../types/emailattachmentcontainer.go | 4 +- .../v8/typedapi/types/emailbody.go | 4 +- .../v8/typedapi/types/emailresult.go | 4 +- .../v8/typedapi/types/emptyobject.go | 4 +- .../v8/typedapi/types/enrichpolicy.go | 4 +- .../v8/typedapi/types/enrichprocessor.go | 4 +- .../v8/typedapi/types/ensemble.go | 4 +- .../accesstokengranttype.go | 4 +- .../acknowledgementoptions.go | 4 +- .../actionexecutionmode.go | 4 +- .../actionstatusoptions.go | 4 +- .../types/enums/actiontype/actiontype.go | 4 +- .../allocationexplaindecision.go | 4 +- .../enums/apikeygranttype/apikeygranttype.go | 4 +- .../types/enums/appliesto/appliesto.go | 4 +- .../enums/boundaryscanner/boundaryscanner.go | 4 +- .../v8/typedapi/types/enums/bytes/bytes.go | 4 +- .../calendarinterval/calendarinterval.go | 4 +- .../cardinalityexecutionmode.go | 4 +- .../catanomalydetectorcolumn.go | 4 +- .../catdatafeedcolumn/catdatafeedcolumn.go | 4 +- .../types/enums/catdfacolumn/catdfacolumn.go | 4 +- .../categorizationstatus.go | 4 +- .../cattrainedmodelscolumn.go | 4 +- .../cattransformcolumn/cattransformcolumn.go | 4 +- .../enums/childscoremode/childscoremode.go | 4 +- .../types/enums/chunkingmode/chunkingmode.go | 4 +- .../clusterinfotarget/clusterinfotarget.go | 4 +- .../clusterprivilege/clusterprivilege.go | 4 +- .../clustersearchstatus.go | 4 +- .../combinedfieldsoperator.go | 4 +- .../combinedfieldszeroterms.go | 4 +- .../types/enums/conditionop/conditionop.go | 4 +- .../conditionoperator/conditionoperator.go | 4 +- .../enums/conditiontype/conditiontype.go | 4 +- .../types/enums/conflicts/conflicts.go | 4 +- .../connectionscheme/connectionscheme.go | 4 +- .../types/enums/converttype/converttype.go | 4 +- .../dataattachmentformat.go | 4 +- .../enums/datafeedstate/datafeedstate.go | 4 +- .../enums/dataframestate/dataframestate.go | 4 +- .../v8/typedapi/types/enums/day/day.go | 4 +- .../typedapi/types/enums/decision/decision.go | 4 +- .../delimitedpayloadencoding.go | 4 +- .../deploymentallocationstate.go | 4 +- .../deploymentassignmentstate.go | 4 +- .../enums/deploymentstate/deploymentstate.go | 4 +- .../deprecationlevel/deprecationlevel.go | 4 +- .../dfiindependencemeasure.go | 4 +- .../enums/dfraftereffect/dfraftereffect.go | 4 +- .../enums/dfrbasicmodel/dfrbasicmodel.go | 4 +- .../types/enums/distanceunit/distanceunit.go | 4 +- .../enums/dynamicmapping/dynamicmapping.go | 4 +- .../enums/edgengramside/edgengramside.go | 4 +- .../enums/emailpriority/emailpriority.go | 4 +- .../enrichpolicyphase/enrichpolicyphase.go | 4 +- .../enums/excludefrequent/excludefrequent.go | 4 +- .../enums/executionphase/executionphase.go | 4 +- .../enums/executionstatus/executionstatus.go | 4 +- .../enums/expandwildcard/expandwildcard.go | 4 +- .../typedapi/types/enums/feature/feature.go | 4 +- .../fieldsortnumerictype.go | 4 +- .../types/enums/fieldtype/fieldtype.go | 4 +- .../fieldvaluefactormodifier.go | 4 +- .../types/enums/filtertype/filtertype.go | 4 +- .../followerindexstatus.go | 4 +- .../functionboostmode/functionboostmode.go | 4 +- .../functionscoremode/functionscoremode.go | 4 +- .../types/enums/gappolicy/gappolicy.go | 4 +- .../enums/geodistancetype/geodistancetype.go | 4 +- .../types/enums/geoexecution/geoexecution.go | 4 +- .../enums/geoorientation/geoorientation.go | 4 +- .../geoshaperelation/geoshaperelation.go | 4 +- .../types/enums/geostrategy/geostrategy.go | 4 +- .../geovalidationmethod.go | 4 +- .../types/enums/granttype/granttype.go | 4 +- .../gridaggregationtype.go | 4 +- .../typedapi/types/enums/gridtype/gridtype.go | 4 +- .../typedapi/types/enums/groupby/groupby.go | 4 +- .../types/enums/healthstatus/healthstatus.go | 4 +- .../highlighterencoder/highlighterencoder.go | 4 +- .../highlighterfragmenter.go | 4 +- .../highlighterorder/highlighterorder.go | 4 +- .../highlightertagsschema.go | 4 +- .../enums/highlightertype/highlightertype.go | 4 +- .../enums/holtwinterstype/holtwinterstype.go | 4 +- .../enums/httpinputmethod/httpinputmethod.go | 4 +- .../enums/ibdistribution/ibdistribution.go | 4 +- .../typedapi/types/enums/iblambda/iblambda.go | 4 +- .../icucollationalternate.go | 4 +- .../icucollationcasefirst.go | 4 +- .../icucollationdecomposition.go | 4 +- .../icucollationstrength.go | 4 +- .../icunormalizationmode.go | 4 +- .../icunormalizationtype.go | 4 +- .../icutransformdirection.go | 4 +- .../types/enums/impactarea/impactarea.go | 4 +- .../typedapi/types/enums/include/include.go | 4 +- .../indexcheckonstartup.go | 4 +- .../indexingjobstate/indexingjobstate.go | 4 +- .../indexmetadatastate/indexmetadatastate.go | 4 +- .../types/enums/indexoptions/indexoptions.go | 4 +- .../enums/indexprivilege/indexprivilege.go | 4 +- .../indexroutingallocationoptions.go | 4 +- .../indexroutingrebalanceoptions.go | 4 +- .../indicatorhealthstatus.go | 4 +- .../types/enums/inputtype/inputtype.go | 4 +- .../jobblockedreason/jobblockedreason.go | 4 +- .../typedapi/types/enums/jobstate/jobstate.go | 4 +- .../jsonprocessorconflictstrategy.go | 4 +- .../enums/keeptypesmode/keeptypesmode.go | 4 +- .../kuromojitokenizationmode.go | 4 +- .../typedapi/types/enums/language/language.go | 4 +- .../v8/typedapi/types/enums/level/level.go | 4 +- .../enums/licensestatus/licensestatus.go | 4 +- .../types/enums/licensetype/licensetype.go | 4 +- .../lifecycleoperationmode.go | 4 +- .../types/enums/matchtype/matchtype.go | 4 +- .../types/enums/memorystatus/memorystatus.go | 4 +- .../v8/typedapi/types/enums/metric/metric.go | 4 +- .../enums/migrationstatus/migrationstatus.go | 4 +- .../enums/minimuminterval/minimuminterval.go | 4 +- .../types/enums/missingorder/missingorder.go | 4 +- .../v8/typedapi/types/enums/month/month.go | 4 +- .../enums/multivaluemode/multivaluemode.go | 4 +- .../typedapi/types/enums/noderole/noderole.go | 4 +- .../noridecompoundmode/noridecompoundmode.go | 4 +- .../enums/normalization/normalization.go | 4 +- .../enums/normalizemethod/normalizemethod.go | 4 +- .../numericfielddataformat.go | 4 +- .../enums/onscripterror/onscripterror.go | 4 +- .../enums/operationtype/operationtype.go | 4 +- .../typedapi/types/enums/operator/operator.go | 4 +- .../v8/typedapi/types/enums/optype/optype.go | 4 +- .../pagerdutycontexttype.go | 4 +- .../pagerdutyeventtype/pagerdutyeventtype.go | 4 +- .../enums/phoneticencoder/phoneticencoder.go | 4 +- .../phoneticlanguage/phoneticlanguage.go | 4 +- .../phoneticnametype/phoneticnametype.go | 4 +- .../phoneticruletype/phoneticruletype.go | 4 +- .../types/enums/policytype/policytype.go | 4 +- .../types/enums/quantifier/quantifier.go | 4 +- .../queryrulecriteriatype.go | 4 +- .../enums/queryruletype/queryruletype.go | 4 +- .../enums/rangerelation/rangerelation.go | 4 +- .../typedapi/types/enums/ratemode/ratemode.go | 4 +- .../typedapi/types/enums/refresh/refresh.go | 4 +- .../responsecontenttype.go | 4 +- .../v8/typedapi/types/enums/result/result.go | 4 +- .../enums/resultposition/resultposition.go | 4 +- .../types/enums/routingstate/routingstate.go | 4 +- .../types/enums/ruleaction/ruleaction.go | 4 +- .../runtimefieldtype/runtimefieldtype.go | 4 +- .../sampleraggregationexecutionhint.go | 4 +- .../types/enums/scoremode/scoremode.go | 4 +- .../enums/scriptlanguage/scriptlanguage.go | 4 +- .../enums/scriptsorttype/scriptsorttype.go | 4 +- .../types/enums/searchtype/searchtype.go | 4 +- .../segmentsortmissing/segmentsortmissing.go | 4 +- .../enums/segmentsortmode/segmentsortmode.go | 4 +- .../segmentsortorder/segmentsortorder.go | 4 +- .../types/enums/shapetype/shapetype.go | 4 +- .../shardroutingstate/shardroutingstate.go | 4 +- .../shardsstatsstage/shardsstatsstage.go | 4 +- .../shardstoreallocation.go | 4 +- .../shardstorestatus/shardstorestatus.go | 4 +- .../enums/shutdownstatus/shutdownstatus.go | 4 +- .../types/enums/shutdowntype/shutdowntype.go | 4 +- .../types/enums/snapshotsort/snapshotsort.go | 4 +- .../snapshotupgradestate.go | 4 +- .../snowballlanguage/snowballlanguage.go | 4 +- .../typedapi/types/enums/sortmode/sortmode.go | 4 +- .../types/enums/sortorder/sortorder.go | 4 +- .../enums/sourcefieldmode/sourcefieldmode.go | 4 +- .../types/enums/statslevel/statslevel.go | 4 +- .../types/enums/storagetype/storagetype.go | 4 +- .../enums/stringdistance/stringdistance.go | 4 +- .../types/enums/suggestmode/suggestmode.go | 4 +- .../types/enums/suggestsort/suggestsort.go | 4 +- .../enums/synonymformat/synonymformat.go | 4 +- .../typedapi/types/enums/tasktype/tasktype.go | 57 + .../enums/templateformat/templateformat.go | 4 +- .../termsaggregationcollectmode.go | 4 +- .../termsaggregationexecutionhint.go | 4 +- .../termvectoroption/termvectoroption.go | 4 +- .../enums/textquerytype/textquerytype.go | 4 +- .../types/enums/threadtype/threadtype.go | 4 +- .../timeseriesmetrictype.go | 4 +- .../typedapi/types/enums/timeunit/timeunit.go | 4 +- .../types/enums/tokenchar/tokenchar.go | 4 +- .../tokenizationtruncate.go | 4 +- .../totalhitsrelation/totalhitsrelation.go | 4 +- .../trainedmodeltype/trainedmodeltype.go | 4 +- .../trainingpriority/trainingpriority.go | 4 +- .../translogdurability/translogdurability.go | 4 +- .../types/enums/ttesttype/ttesttype.go | 4 +- .../v8/typedapi/types/enums/type_/type_.go | 4 +- .../unassignedinformationreason.go | 4 +- .../useragentproperty/useragentproperty.go | 4 +- .../types/enums/valuetype/valuetype.go | 4 +- .../types/enums/versiontype/versiontype.go | 4 +- .../enums/waitforevents/waitforevents.go | 4 +- .../types/enums/watcherstate/watcherstate.go | 4 +- .../enums/zerotermsquery/zerotermsquery.go | 4 +- .../v8/typedapi/types/epochtimeunitmillis.go | 4 +- .../v8/typedapi/types/epochtimeunitseconds.go | 4 +- .../go-elasticsearch/v8/typedapi/types/eql.go | 4 +- .../v8/typedapi/types/eqlfeatures.go | 4 +- .../v8/typedapi/types/eqlfeaturesjoin.go | 4 +- .../v8/typedapi/types/eqlfeatureskeys.go | 4 +- .../v8/typedapi/types/eqlfeaturespipes.go | 4 +- .../v8/typedapi/types/eqlfeaturessequences.go | 4 +- .../v8/typedapi/types/eqlhits.go | 4 +- .../v8/typedapi/types/errorcause.go | 4 +- .../v8/typedapi/types/errorresponsebase.go | 85 + .../v8/typedapi/types/esqlcolumns.go | 26 + .../v8/typedapi/types/eventdatastream.go | 4 +- .../v8/typedapi/types/ewmamodelsettings.go | 4 +- .../types/ewmamovingaverageaggregation.go | 4 +- .../types/executeenrichpolicystatus.go | 4 +- .../v8/typedapi/types/executingpolicy.go | 4 +- .../v8/typedapi/types/executionresult.go | 4 +- .../typedapi/types/executionresultaction.go | 4 +- .../types/executionresultcondition.go | 4 +- .../v8/typedapi/types/executionresultinput.go | 4 +- .../v8/typedapi/types/executionstate.go | 4 +- .../v8/typedapi/types/executionthreadpool.go | 4 +- .../v8/typedapi/types/existsquery.go | 4 +- .../v8/typedapi/types/expandwildcards.go | 4 +- .../v8/typedapi/types/explainanalyzetoken.go | 4 +- .../v8/typedapi/types/explanation.go | 4 +- .../v8/typedapi/types/explanationdetail.go | 4 +- .../v8/typedapi/types/explorecontrols.go | 4 +- .../v8/typedapi/types/extendedboundsdouble.go | 4 +- .../types/extendedboundsfielddatemath.go | 4 +- .../v8/typedapi/types/extendedmemorystats.go | 4 +- .../typedapi/types/extendedstatsaggregate.go | 4 +- .../types/extendedstatsaggregation.go | 37 +- .../types/extendedstatsbucketaggregate.go | 4 +- .../types/extendedstatsbucketaggregation.go | 4 +- .../v8/typedapi/types/failprocessor.go | 4 +- .../v8/typedapi/types/feature.go | 4 +- .../v8/typedapi/types/features.go | 4 +- .../v8/typedapi/types/featuretoggle.go | 4 +- .../v8/typedapi/types/fetchprofile.go | 4 +- .../typedapi/types/fetchprofilebreakdown.go | 4 +- .../v8/typedapi/types/fetchprofiledebug.go | 4 +- .../v8/typedapi/types/fieldaliasproperty.go | 4 +- .../v8/typedapi/types/fieldandformat.go | 4 +- .../v8/typedapi/types/fieldcapability.go | 4 +- .../v8/typedapi/types/fieldcollapse.go | 4 +- .../types/fielddatafrequencyfilter.go | 4 +- .../v8/typedapi/types/fielddatarecord.go | 4 +- .../v8/typedapi/types/fielddatastats.go | 4 +- .../v8/typedapi/types/fielddatemath.go | 4 +- .../v8/typedapi/types/fieldlookup.go | 4 +- .../v8/typedapi/types/fieldmapping.go | 4 +- .../v8/typedapi/types/fieldmemoryusage.go | 4 +- .../v8/typedapi/types/fieldmetric.go | 4 +- .../v8/typedapi/types/fieldnamesfield.go | 4 +- .../v8/typedapi/types/fieldrule.go | 4 +- .../v8/typedapi/types/fields.go | 4 +- .../v8/typedapi/types/fieldsecurity.go | 4 +- .../v8/typedapi/types/fieldsizeusage.go | 4 +- .../v8/typedapi/types/fieldsort.go | 4 +- .../v8/typedapi/types/fieldstat.go | 4 +- .../v8/typedapi/types/fieldstatistics.go | 4 +- .../v8/typedapi/types/fieldsuggester.go | 4 +- .../v8/typedapi/types/fieldsummary.go | 4 +- .../v8/typedapi/types/fieldsusagebody.go | 4 +- .../v8/typedapi/types/fieldtypes.go | 4 +- .../v8/typedapi/types/fieldtypesmappings.go | 4 +- .../v8/typedapi/types/fieldvalue.go | 4 +- .../types/fieldvaluefactorscorefunction.go | 4 +- .../typedapi/types/filecountsnapshotstats.go | 4 +- .../v8/typedapi/types/filedetails.go | 4 +- .../v8/typedapi/types/filesystem.go | 4 +- .../v8/typedapi/types/filesystemtotal.go | 4 +- .../types/fillmaskinferenceoptions.go | 4 +- .../types/fillmaskinferenceupdateoptions.go | 4 +- .../v8/typedapi/types/filteraggregate.go | 4 +- .../v8/typedapi/types/filterref.go | 4 +- .../v8/typedapi/types/filtersaggregate.go | 4 +- .../v8/typedapi/types/filtersaggregation.go | 4 +- .../v8/typedapi/types/filtersbucket.go | 4 +- .../v8/typedapi/types/fingerprintanalyzer.go | 4 +- .../typedapi/types/fingerprinttokenfilter.go | 4 +- .../v8/typedapi/types/flattened.go | 4 +- .../v8/typedapi/types/flattenedproperty.go | 4 +- .../v8/typedapi/types/floatnumberproperty.go | 37 +- .../v8/typedapi/types/floatrangeproperty.go | 4 +- .../v8/typedapi/types/flushstats.go | 4 +- .../v8/typedapi/types/followerindex.go | 4 +- .../typedapi/types/followerindexparameters.go | 4 +- .../v8/typedapi/types/followindexstats.go | 4 +- .../v8/typedapi/types/followstats.go | 4 +- .../typedapi/types/forcemergeconfiguration.go | 4 +- .../typedapi/types/forcemergeresponsebody.go | 4 +- .../v8/typedapi/types/foreachprocessor.go | 4 +- .../types/formattablemetricaggregation.go | 37 +- .../v8/typedapi/types/foundstatus.go | 4 +- .../types/frequencyencodingpreprocessor.go | 4 +- .../types/frequentitemsetsaggregate.go | 4 +- .../types/frequentitemsetsaggregation.go | 4 +- .../typedapi/types/frequentitemsetsbucket.go | 4 +- .../typedapi/types/frequentitemsetsfield.go | 4 +- .../v8/typedapi/types/frozenindices.go | 4 +- .../v8/typedapi/types/functionscore.go | 4 +- .../v8/typedapi/types/functionscorequery.go | 4 +- .../v8/typedapi/types/fuzziness.go | 4 +- .../v8/typedapi/types/fuzzyquery.go | 4 +- .../v8/typedapi/types/garbagecollector.go | 4 +- .../typedapi/types/garbagecollectortotal.go | 4 +- .../v8/typedapi/types/geoboundingboxquery.go | 4 +- .../v8/typedapi/types/geobounds.go | 4 +- .../v8/typedapi/types/geoboundsaggregate.go | 4 +- .../v8/typedapi/types/geoboundsaggregation.go | 37 +- .../v8/typedapi/types/geocentroidaggregate.go | 4 +- .../typedapi/types/geocentroidaggregation.go | 37 +- .../v8/typedapi/types/geodecayfunction.go | 4 +- .../v8/typedapi/types/geodistanceaggregate.go | 4 +- .../typedapi/types/geodistanceaggregation.go | 4 +- .../typedapi/types/geodistancefeaturequery.go | 4 +- .../v8/typedapi/types/geodistancequery.go | 4 +- .../v8/typedapi/types/geodistancesort.go | 4 +- .../v8/typedapi/types/geohashgridaggregate.go | 4 +- .../typedapi/types/geohashgridaggregation.go | 4 +- .../v8/typedapi/types/geohashgridbucket.go | 4 +- .../v8/typedapi/types/geohashlocation.go | 4 +- .../v8/typedapi/types/geohashprecision.go | 4 +- .../v8/typedapi/types/geohexgridaggregate.go | 4 +- .../typedapi/types/geohexgridaggregation.go | 4 +- .../v8/typedapi/types/geohexgridbucket.go | 4 +- .../typedapi/types/geoipdownloadstatistics.go | 4 +- .../typedapi/types/geoipnodedatabasename.go | 4 +- .../v8/typedapi/types/geoipnodedatabases.go | 4 +- .../v8/typedapi/types/geoipprocessor.go | 4 +- .../v8/typedapi/types/geoline.go | 4 +- .../v8/typedapi/types/geolineaggregate.go | 4 +- .../v8/typedapi/types/geolineaggregation.go | 4 +- .../v8/typedapi/types/geolinepoint.go | 4 +- .../v8/typedapi/types/geolinesort.go | 4 +- .../v8/typedapi/types/geolocation.go | 4 +- .../v8/typedapi/types/geopointproperty.go | 4 +- .../v8/typedapi/types/geopolygonpoints.go | 4 +- .../v8/typedapi/types/geopolygonquery.go | 4 +- .../v8/typedapi/types/georesults.go | 4 +- .../v8/typedapi/types/geoshapefieldquery.go | 4 +- .../v8/typedapi/types/geoshapeproperty.go | 4 +- .../v8/typedapi/types/geoshapequery.go | 4 +- .../v8/typedapi/types/geotilegridaggregate.go | 4 +- .../typedapi/types/geotilegridaggregation.go | 4 +- .../v8/typedapi/types/geotilegridbucket.go | 4 +- .../v8/typedapi/types/getmigrationfeature.go | 4 +- .../v8/typedapi/types/getresult.go | 4 +- .../v8/typedapi/types/getscriptcontext.go | 4 +- .../v8/typedapi/types/getstats.go | 4 +- .../v8/typedapi/types/getuserprofileerrors.go | 4 +- .../v8/typedapi/types/globalaggregate.go | 4 +- .../v8/typedapi/types/globalaggregation.go | 4 +- .../v8/typedapi/types/globalprivilege.go | 4 +- .../googlenormalizeddistanceheuristic.go | 4 +- .../v8/typedapi/types/grantapikey.go | 4 +- .../v8/typedapi/types/grokprocessor.go | 4 +- .../v8/typedapi/types/groupings.go | 4 +- .../v8/typedapi/types/gsubprocessor.go | 4 +- .../typedapi/types/halffloatnumberproperty.go | 37 +- .../v8/typedapi/types/haschildquery.go | 4 +- .../v8/typedapi/types/hasparentquery.go | 4 +- .../types/hasprivilegesuserprofileerrors.go | 4 +- .../v8/typedapi/types/hdrmethod.go | 4 +- .../types/hdrpercentileranksaggregate.go | 4 +- .../typedapi/types/hdrpercentilesaggregate.go | 4 +- .../v8/typedapi/types/healthrecord.go | 4 +- .../v8/typedapi/types/healthresponsebody.go | 4 +- .../v8/typedapi/types/healthstatistics.go | 4 +- .../v8/typedapi/types/helprecord.go | 4 +- .../v8/typedapi/types/highlight.go | 4 +- .../v8/typedapi/types/highlightfield.go | 4 +- .../v8/typedapi/types/hint.go | 4 +- .../v8/typedapi/types/histogramaggregate.go | 4 +- .../v8/typedapi/types/histogramaggregation.go | 37 +- .../v8/typedapi/types/histogrambucket.go | 4 +- .../v8/typedapi/types/histogramgrouping.go | 4 +- .../v8/typedapi/types/histogramproperty.go | 4 +- .../go-elasticsearch/v8/typedapi/types/hit.go | 4 +- .../v8/typedapi/types/hitsevent.go | 4 +- .../v8/typedapi/types/hitsmetadata.go | 4 +- .../v8/typedapi/types/hitssequence.go | 4 +- .../typedapi/types/holtlinearmodelsettings.go | 4 +- .../types/holtmovingaverageaggregation.go | 4 +- .../types/holtwintersmodelsettings.go | 4 +- .../holtwintersmovingaverageaggregation.go | 4 +- .../go-elasticsearch/v8/typedapi/types/hop.go | 4 +- .../v8/typedapi/types/hotthread.go | 4 +- .../v8/typedapi/types/hourandminute.go | 4 +- .../v8/typedapi/types/hourlyschedule.go | 4 +- .../v8/typedapi/types/htmlstripcharfilter.go | 4 +- .../v8/typedapi/types/http.go | 4 +- .../v8/typedapi/types/httpemailattachment.go | 4 +- .../v8/typedapi/types/httpheaders.go | 4 +- .../v8/typedapi/types/httpinput.go | 4 +- .../typedapi/types/httpinputauthentication.go | 4 +- .../types/httpinputbasicauthentication.go | 4 +- .../v8/typedapi/types/httpinputproxy.go | 4 +- .../types/httpinputrequestdefinition.go | 4 +- .../typedapi/types/httpinputrequestresult.go | 4 +- .../typedapi/types/httpinputresponseresult.go | 4 +- .../v8/typedapi/types/hunspelltokenfilter.go | 4 +- .../v8/typedapi/types/hyperparameter.go | 4 +- .../v8/typedapi/types/hyperparameters.go | 4 +- .../hyphenationdecompoundertokenfilter.go | 4 +- .../v8/typedapi/types/icuanalyzer.go | 4 +- .../typedapi/types/icucollationtokenfilter.go | 4 +- .../typedapi/types/icufoldingtokenfilter.go | 4 +- .../types/icunormalizationcharfilter.go | 4 +- .../types/icunormalizationtokenfilter.go | 4 +- .../v8/typedapi/types/icutokenizer.go | 4 +- .../typedapi/types/icutransformtokenfilter.go | 4 +- .../go-elasticsearch/v8/typedapi/types/ids.go | 4 +- .../v8/typedapi/types/idsquery.go | 4 +- .../go-elasticsearch/v8/typedapi/types/ilm.go | 4 +- .../v8/typedapi/types/ilmindicator.go | 4 +- .../v8/typedapi/types/ilmindicatordetails.go | 4 +- .../v8/typedapi/types/ilmpolicy.go | 4 +- .../v8/typedapi/types/ilmpolicystatistics.go | 4 +- .../v8/typedapi/types/impact.go | 4 +- .../v8/typedapi/types/indexaction.go | 4 +- .../v8/typedapi/types/indexaliases.go | 4 +- .../types/indexanddatastreamaction.go | 4 +- .../v8/typedapi/types/indexcapabilities.go | 4 +- .../v8/typedapi/types/indexdetails.go | 4 +- .../v8/typedapi/types/indexfield.go | 4 +- .../v8/typedapi/types/indexhealthstats.go | 4 +- .../types/indexingpressurememorysummary.go | 4 +- .../typedapi/types/indexingslowlogsettings.go | 4 +- .../types/indexingslowlogtresholds.go | 4 +- .../v8/typedapi/types/indexingstats.go | 4 +- .../v8/typedapi/types/indexmappingrecord.go | 4 +- .../v8/typedapi/types/indexoperation.go | 4 +- .../v8/typedapi/types/indexprivilegescheck.go | 4 +- .../v8/typedapi/types/indexresult.go | 4 +- .../v8/typedapi/types/indexresultsummary.go | 4 +- .../v8/typedapi/types/indexrouting.go | 4 +- .../typedapi/types/indexroutingallocation.go | 4 +- .../types/indexroutingallocationdisk.go | 4 +- .../types/indexroutingallocationinclude.go | 4 +- .../indexroutingallocationinitialrecovery.go | 4 +- .../typedapi/types/indexroutingrebalance.go | 4 +- .../v8/typedapi/types/indexsegment.go | 4 +- .../v8/typedapi/types/indexsegmentsort.go | 4 +- .../v8/typedapi/types/indexsettingblocks.go | 4 +- .../v8/typedapi/types/indexsettings.go | 4 +- .../typedapi/types/indexsettingsanalysis.go | 4 +- .../typedapi/types/indexsettingslifecycle.go | 4 +- .../types/indexsettingslifecyclestep.go | 4 +- .../typedapi/types/indexsettingstimeseries.go | 4 +- .../v8/typedapi/types/indexstate.go | 4 +- .../v8/typedapi/types/indexstats.go | 4 +- .../v8/typedapi/types/indextemplate.go | 4 +- .../indextemplatedatastreamconfiguration.go | 4 +- .../v8/typedapi/types/indextemplateitem.go | 4 +- .../v8/typedapi/types/indextemplatemapping.go | 4 +- .../v8/typedapi/types/indextemplatesummary.go | 4 +- .../v8/typedapi/types/indexversioning.go | 4 +- .../v8/typedapi/types/indicatornode.go | 4 +- .../v8/typedapi/types/indicators.go | 4 +- .../v8/typedapi/types/indices.go | 4 +- .../v8/typedapi/types/indicesaction.go | 4 +- .../v8/typedapi/types/indicesblockstatus.go | 4 +- .../typedapi/types/indicesindexingpressure.go | 4 +- .../types/indicesindexingpressurememory.go | 4 +- .../v8/typedapi/types/indicesmodifyaction.go | 4 +- .../v8/typedapi/types/indicesoptions.go | 4 +- .../v8/typedapi/types/indicesprivileges.go | 4 +- .../typedapi/types/indicesprivilegesquery.go | 4 +- .../v8/typedapi/types/indicesrecord.go | 4 +- .../v8/typedapi/types/indicesshardsstats.go | 4 +- .../v8/typedapi/types/indicesshardstats.go | 4 +- .../v8/typedapi/types/indicesshardstores.go | 4 +- .../v8/typedapi/types/indicesstats.go | 4 +- .../types/indicesvalidationexplanation.go | 4 +- .../v8/typedapi/types/indicesversions.go | 4 +- .../v8/typedapi/types/inferenceaggregate.go | 4 +- .../v8/typedapi/types/inferenceaggregation.go | 4 +- .../types/inferenceclassimportance.go | 4 +- .../v8/typedapi/types/inferenceconfig.go | 4 +- .../types/inferenceconfigclassification.go | 4 +- .../types/inferenceconfigcontainer.go | 4 +- .../types/inferenceconfigcreatecontainer.go | 4 +- .../types/inferenceconfigregression.go | 4 +- .../types/inferenceconfigupdatecontainer.go | 4 +- .../types/inferencefeatureimportance.go | 4 +- .../v8/typedapi/types/inferenceprocessor.go | 4 +- .../typedapi/types/inferenceresponseresult.go | 4 +- .../v8/typedapi/types/inferenceresult.go | 36 + .../typedapi/types/inferencetopclassentry.go | 4 +- .../v8/typedapi/types/influence.go | 4 +- .../v8/typedapi/types/influencer.go | 4 +- .../v8/typedapi/types/infofeaturestate.go | 4 +- .../v8/typedapi/types/ingestpipeline.go | 12 +- .../v8/typedapi/types/ingesttotal.go | 4 +- .../v8/typedapi/types/inlineget.go | 4 +- .../types/inlinegetdictuserdefined.go | 4 +- .../v8/typedapi/types/inlinescript.go | 4 +- .../v8/typedapi/types/innerhits.go | 4 +- .../v8/typedapi/types/innerhitsresult.go | 4 +- .../v8/typedapi/types/inprogress.go | 4 +- .../v8/typedapi/types/input.go | 4 +- .../typedapi/types/integernumberproperty.go | 37 +- .../v8/typedapi/types/integerrangeproperty.go | 4 +- .../v8/typedapi/types/intervals.go | 4 +- .../v8/typedapi/types/intervalsallof.go | 4 +- .../v8/typedapi/types/intervalsanyof.go | 4 +- .../v8/typedapi/types/intervalsfilter.go | 37 +- .../v8/typedapi/types/intervalsfuzzy.go | 4 +- .../v8/typedapi/types/intervalsmatch.go | 4 +- .../v8/typedapi/types/intervalsprefix.go | 4 +- .../v8/typedapi/types/intervalsquery.go | 4 +- .../v8/typedapi/types/intervalswildcard.go | 4 +- .../v8/typedapi/types/invertedindex.go | 4 +- .../v8/typedapi/types/invocation.go | 4 +- .../v8/typedapi/types/invocations.go | 4 +- .../v8/typedapi/types/iostatdevice.go | 4 +- .../v8/typedapi/types/iostats.go | 4 +- .../v8/typedapi/types/ipfilter.go | 4 +- .../v8/typedapi/types/ipprefixaggregate.go | 4 +- .../v8/typedapi/types/ipprefixaggregation.go | 4 +- .../v8/typedapi/types/ipprefixbucket.go | 4 +- .../v8/typedapi/types/ipproperty.go | 37 +- .../v8/typedapi/types/iprangeaggregate.go | 4 +- .../v8/typedapi/types/iprangeaggregation.go | 4 +- .../typedapi/types/iprangeaggregationrange.go | 4 +- .../v8/typedapi/types/iprangebucket.go | 4 +- .../v8/typedapi/types/iprangeproperty.go | 4 +- .../go-elasticsearch/v8/typedapi/types/job.go | 4 +- .../v8/typedapi/types/jobblocked.go | 4 +- .../v8/typedapi/types/jobconfig.go | 4 +- .../typedapi/types/jobforecaststatistics.go | 4 +- .../v8/typedapi/types/jobsrecord.go | 4 +- .../v8/typedapi/types/jobstatistics.go | 4 +- .../v8/typedapi/types/jobstats.go | 4 +- .../v8/typedapi/types/jobtimingstats.go | 4 +- .../v8/typedapi/types/jobusage.go | 4 +- .../v8/typedapi/types/joinprocessor.go | 4 +- .../v8/typedapi/types/joinproperty.go | 4 +- .../v8/typedapi/types/jsonprocessor.go | 4 +- .../go-elasticsearch/v8/typedapi/types/jvm.go | 4 +- .../v8/typedapi/types/jvmclasses.go | 4 +- .../v8/typedapi/types/jvmmemorystats.go | 4 +- .../v8/typedapi/types/jvmstats.go | 4 +- .../v8/typedapi/types/jvmthreads.go | 4 +- .../v8/typedapi/types/keeptypestokenfilter.go | 4 +- .../v8/typedapi/types/keepwordstokenfilter.go | 4 +- .../v8/typedapi/types/keyedpercentiles.go | 4 +- .../v8/typedapi/types/keyedprocessor.go | 4 +- .../v8/typedapi/types/keyvalueprocessor.go | 4 +- .../v8/typedapi/types/keywordanalyzer.go | 4 +- .../types/keywordmarkertokenfilter.go | 4 +- .../v8/typedapi/types/keywordproperty.go | 4 +- .../v8/typedapi/types/keywordtokenizer.go | 4 +- .../v8/typedapi/types/kibanatoken.go | 4 +- .../v8/typedapi/types/knnquery.go | 4 +- .../v8/typedapi/types/kstemtokenfilter.go | 4 +- .../v8/typedapi/types/kuromojianalyzer.go | 4 +- .../types/kuromojiiterationmarkcharfilter.go | 4 +- .../types/kuromojipartofspeechtokenfilter.go | 4 +- .../types/kuromojireadingformtokenfilter.go | 4 +- .../types/kuromojistemmertokenfilter.go | 4 +- .../v8/typedapi/types/kuromojitokenizer.go | 4 +- .../v8/typedapi/types/languageanalyzer.go | 4 +- .../v8/typedapi/types/languagecontext.go | 4 +- .../typedapi/types/laplacesmoothingmodel.go | 4 +- .../v8/typedapi/types/latest.go | 4 +- .../v8/typedapi/types/latlongeolocation.go | 4 +- .../v8/typedapi/types/lengthtokenfilter.go | 4 +- .../v8/typedapi/types/lettertokenizer.go | 4 +- .../v8/typedapi/types/license.go | 4 +- .../v8/typedapi/types/licenseinformation.go | 4 +- .../v8/typedapi/types/lifecycle.go | 4 +- .../v8/typedapi/types/lifecycleexplain.go | 4 +- .../typedapi/types/lifecycleexplainmanaged.go | 4 +- .../types/lifecycleexplainphaseexecution.go | 4 +- .../types/lifecycleexplainunmanaged.go | 4 +- .../v8/typedapi/types/like.go | 4 +- .../v8/typedapi/types/likedocument.go | 4 +- .../v8/typedapi/types/limits.go | 4 +- .../types/limittokencounttokenfilter.go | 4 +- .../linearinterpolationsmoothingmodel.go | 4 +- .../types/linearmovingaverageaggregation.go | 4 +- .../v8/typedapi/types/loggingaction.go | 4 +- .../v8/typedapi/types/loggingresult.go | 4 +- .../v8/typedapi/types/logstashpipeline.go | 4 +- .../v8/typedapi/types/longnumberproperty.go | 37 +- .../v8/typedapi/types/longrangeproperty.go | 4 +- .../typedapi/types/longraretermsaggregate.go | 4 +- .../v8/typedapi/types/longraretermsbucket.go | 4 +- .../v8/typedapi/types/longtermsaggregate.go | 4 +- .../v8/typedapi/types/longtermsbucket.go | 4 +- .../v8/typedapi/types/lowercasenormalizer.go | 4 +- .../v8/typedapi/types/lowercaseprocessor.go | 4 +- .../v8/typedapi/types/lowercasetokenfilter.go | 4 +- .../v8/typedapi/types/lowercasetokenizer.go | 4 +- .../v8/typedapi/types/machinelearning.go | 4 +- .../v8/typedapi/types/managedby.go | 26 + .../v8/typedapi/types/manageuserprivileges.go | 4 +- .../v8/typedapi/types/mapboxvectortiles.go | 4 +- .../v8/typedapi/types/mappingcharfilter.go | 4 +- .../v8/typedapi/types/mappinglimitsettings.go | 4 +- .../types/mappinglimitsettingsdepth.go | 4 +- .../mappinglimitsettingsdimensionfields.go | 8 +- .../mappinglimitsettingsfieldnamelength.go | 4 +- .../types/mappinglimitsettingsnestedfields.go | 4 +- .../mappinglimitsettingsnestedobjects.go | 4 +- .../types/mappinglimitsettingstotalfields.go | 4 +- .../v8/typedapi/types/mappingstats.go | 4 +- .../typedapi/types/masterisstableindicator.go | 4 +- ...erisstableindicatorclusterformationnode.go | 4 +- .../types/masterisstableindicatordetails.go | 4 +- ...stableindicatorexceptionfetchinghistory.go | 4 +- .../v8/typedapi/types/masterrecord.go | 4 +- .../v8/typedapi/types/matchallquery.go | 4 +- .../v8/typedapi/types/matchboolprefixquery.go | 4 +- .../v8/typedapi/types/matchnonequery.go | 4 +- .../typedapi/types/matchonlytextproperty.go | 4 +- .../typedapi/types/matchphraseprefixquery.go | 4 +- .../v8/typedapi/types/matchphrasequery.go | 4 +- .../v8/typedapi/types/matchquery.go | 4 +- .../v8/typedapi/types/matrixaggregation.go | 4 +- .../v8/typedapi/types/matrixstatsaggregate.go | 4 +- .../typedapi/types/matrixstatsaggregation.go | 4 +- .../v8/typedapi/types/matrixstatsfields.go | 4 +- .../v8/typedapi/types/maxaggregate.go | 4 +- .../v8/typedapi/types/maxaggregation.go | 37 +- .../v8/typedapi/types/maxbucketaggregation.go | 4 +- .../types/medianabsolutedeviationaggregate.go | 4 +- .../medianabsolutedeviationaggregation.go | 37 +- .../v8/typedapi/types/memmlstats.go | 4 +- .../v8/typedapi/types/memory.go | 4 +- .../v8/typedapi/types/memorystats.go | 4 +- .../v8/typedapi/types/memstats.go | 4 +- .../v8/typedapi/types/merge.go | 4 +- .../v8/typedapi/types/mergescheduler.go | 4 +- .../v8/typedapi/types/mergesstats.go | 4 +- .../v8/typedapi/types/metadata.go | 4 +- .../v8/typedapi/types/metrics.go | 4 +- .../v8/typedapi/types/mgetoperation.go | 4 +- .../v8/typedapi/types/mgetresponseitem.go | 4 +- .../types/migrationfeatureindexinfo.go | 4 +- .../v8/typedapi/types/minaggregate.go | 4 +- .../v8/typedapi/types/minaggregation.go | 37 +- .../v8/typedapi/types/minbucketaggregation.go | 4 +- .../types/minimallicenseinformation.go | 4 +- .../v8/typedapi/types/minimumshouldmatch.go | 4 +- .../v8/typedapi/types/missing.go | 4 +- .../v8/typedapi/types/missingaggregate.go | 4 +- .../v8/typedapi/types/missingaggregation.go | 4 +- .../v8/typedapi/types/mlcounter.go | 4 +- .../v8/typedapi/types/mldatafeed.go | 4 +- .../types/mldataframeanalyticsjobs.go | 4 +- .../types/mldataframeanalyticsjobsanalysis.go | 4 +- .../types/mldataframeanalyticsjobscount.go | 4 +- .../types/mldataframeanalyticsjobsmemory.go | 4 +- .../v8/typedapi/types/mlfilter.go | 4 +- .../v8/typedapi/types/mlinference.go | 4 +- .../typedapi/types/mlinferencedeployments.go | 4 +- .../types/mlinferencedeploymentstimems.go | 4 +- .../types/mlinferenceingestprocessor.go | 4 +- .../types/mlinferenceingestprocessorcount.go | 4 +- .../types/mlinferencetrainedmodels.go | 4 +- .../types/mlinferencetrainedmodelscount.go | 4 +- .../v8/typedapi/types/mljobforecasts.go | 4 +- .../v8/typedapi/types/modelconfig.go | 90 + .../v8/typedapi/types/modelconfigcontainer.go | 113 + .../v8/typedapi/types/modelplotconfig.go | 4 +- .../v8/typedapi/types/modelsizestats.go | 4 +- .../v8/typedapi/types/modelsnapshot.go | 4 +- .../v8/typedapi/types/modelsnapshotupgrade.go | 4 +- .../v8/typedapi/types/monitoring.go | 4 +- .../v8/typedapi/types/morelikethisquery.go | 4 +- .../v8/typedapi/types/mountedsnapshot.go | 4 +- .../types/movingaverageaggregation.go | 4 +- .../types/movingfunctionaggregation.go | 4 +- .../types/movingpercentilesaggregation.go | 4 +- .../v8/typedapi/types/msearchrequestitem.go | 4 +- .../v8/typedapi/types/msearchresponseitem.go | 4 +- .../typedapi/types/mtermvectorsoperation.go | 4 +- ...ucketaggregatebaseadjacencymatrixbucket.go | 4 +- ...multibucketaggregatebasecompositebucket.go | 4 +- ...ibucketaggregatebasedatehistogrambucket.go | 4 +- ...ltibucketaggregatebasedoubletermsbucket.go | 4 +- .../multibucketaggregatebasefiltersbucket.go | 4 +- ...cketaggregatebasefrequentitemsetsbucket.go | 4 +- ...ltibucketaggregatebasegeohashgridbucket.go | 4 +- ...ultibucketaggregatebasegeohexgridbucket.go | 4 +- ...ltibucketaggregatebasegeotilegridbucket.go | 4 +- ...multibucketaggregatebasehistogrambucket.go | 4 +- .../multibucketaggregatebaseipprefixbucket.go | 4 +- .../multibucketaggregatebaseiprangebucket.go | 4 +- ...ibucketaggregatebaselongraretermsbucket.go | 4 +- ...multibucketaggregatebaselongtermsbucket.go | 4 +- ...ultibucketaggregatebasemultitermsbucket.go | 4 +- .../multibucketaggregatebaserangebucket.go | 4 +- ...aggregatebasesignificantlongtermsbucket.go | 4 +- ...gregatebasesignificantstringtermsbucket.go | 4 +- ...ucketaggregatebasestringraretermsbucket.go | 4 +- ...ltibucketaggregatebasestringtermsbucket.go | 4 +- ...gregatebasevariablewidthhistogrambucket.go | 4 +- .../types/multibucketaggregatebasevoid.go | 4 +- .../v8/typedapi/types/multigeterror.go | 4 +- .../v8/typedapi/types/multimatchquery.go | 4 +- .../typedapi/types/multiplexertokenfilter.go | 4 +- .../v8/typedapi/types/multisearchbody.go | 4 +- .../v8/typedapi/types/multisearchheader.go | 4 +- .../v8/typedapi/types/multisearchitem.go | 4 +- .../v8/typedapi/types/multisearchresult.go | 42 +- .../v8/typedapi/types/multitermlookup.go | 4 +- .../v8/typedapi/types/multitermsaggregate.go | 4 +- .../typedapi/types/multitermsaggregation.go | 4 +- .../v8/typedapi/types/multitermsbucket.go | 4 +- .../v8/typedapi/types/murmur3hashproperty.go | 4 +- .../types/mutualinformationheuristic.go | 4 +- .../v8/typedapi/types/names.go | 4 +- .../v8/typedapi/types/nativecode.go | 4 +- .../typedapi/types/nativecodeinformation.go | 4 +- .../v8/typedapi/types/nerinferenceoptions.go | 4 +- .../types/nerinferenceupdateoptions.go | 4 +- .../v8/typedapi/types/nestedaggregate.go | 4 +- .../v8/typedapi/types/nestedaggregation.go | 4 +- .../v8/typedapi/types/nestedidentity.go | 4 +- .../v8/typedapi/types/nestedproperty.go | 4 +- .../v8/typedapi/types/nestedquery.go | 4 +- .../v8/typedapi/types/nestedsortvalue.go | 4 +- .../v8/typedapi/types/nevercondition.go | 4 +- .../v8/typedapi/types/ngramtokenfilter.go | 4 +- .../v8/typedapi/types/ngramtokenizer.go | 4 +- .../types/nlpberttokenizationconfig.go | 4 +- .../types/nlprobertatokenizationconfig.go | 4 +- .../types/nlptokenizationupdateoptions.go | 4 +- .../v8/typedapi/types/node.go | 4 +- .../types/nodeallocationexplanation.go | 4 +- .../v8/typedapi/types/nodeattributes.go | 4 +- .../v8/typedapi/types/nodeattributesrecord.go | 4 +- .../v8/typedapi/types/nodebufferpool.go | 4 +- .../v8/typedapi/types/nodediskusage.go | 4 +- .../v8/typedapi/types/nodeids.go | 4 +- .../v8/typedapi/types/nodeinfo.go | 4 +- .../v8/typedapi/types/nodeinfoaction.go | 4 +- .../v8/typedapi/types/nodeinfoaggregation.go | 4 +- .../v8/typedapi/types/nodeinfobootstrap.go | 4 +- .../v8/typedapi/types/nodeinfoclient.go | 4 +- .../v8/typedapi/types/nodeinfodiscover.go | 4 +- .../v8/typedapi/types/nodeinfohttp.go | 4 +- .../v8/typedapi/types/nodeinfoingest.go | 4 +- .../types/nodeinfoingestdownloader.go | 4 +- .../v8/typedapi/types/nodeinfoingestinfo.go | 4 +- .../typedapi/types/nodeinfoingestprocessor.go | 4 +- .../v8/typedapi/types/nodeinfojvmmemory.go | 4 +- .../v8/typedapi/types/nodeinfomemory.go | 4 +- .../v8/typedapi/types/nodeinfonetwork.go | 4 +- .../types/nodeinfonetworkinterface.go | 4 +- .../v8/typedapi/types/nodeinfooscpu.go | 4 +- .../v8/typedapi/types/nodeinfopath.go | 4 +- .../v8/typedapi/types/nodeinforepositories.go | 4 +- .../typedapi/types/nodeinforepositoriesurl.go | 4 +- .../v8/typedapi/types/nodeinfoscript.go | 4 +- .../v8/typedapi/types/nodeinfosearch.go | 4 +- .../v8/typedapi/types/nodeinfosearchremote.go | 4 +- .../v8/typedapi/types/nodeinfosettings.go | 4 +- .../typedapi/types/nodeinfosettingscluster.go | 4 +- .../types/nodeinfosettingsclusterelection.go | 4 +- .../v8/typedapi/types/nodeinfosettingshttp.go | 4 +- .../types/nodeinfosettingshttptype.go | 4 +- .../typedapi/types/nodeinfosettingsingest.go | 4 +- .../typedapi/types/nodeinfosettingsnetwork.go | 4 +- .../v8/typedapi/types/nodeinfosettingsnode.go | 4 +- .../types/nodeinfosettingstransport.go | 4 +- .../nodeinfosettingstransportfeatures.go | 4 +- .../types/nodeinfosettingstransporttype.go | 4 +- .../v8/typedapi/types/nodeinfotransport.go | 4 +- .../v8/typedapi/types/nodeinfoxpack.go | 4 +- .../v8/typedapi/types/nodeinfoxpacklicense.go | 4 +- .../types/nodeinfoxpacklicensetype.go | 4 +- .../typedapi/types/nodeinfoxpacksecurity.go | 4 +- .../types/nodeinfoxpacksecurityauthc.go | 4 +- .../types/nodeinfoxpacksecurityauthcrealms.go | 4 +- .../nodeinfoxpacksecurityauthcrealmsstatus.go | 4 +- .../types/nodeinfoxpacksecurityauthctoken.go | 4 +- .../types/nodeinfoxpacksecurityssl.go | 4 +- .../v8/typedapi/types/nodejvminfo.go | 4 +- .../typedapi/types/nodeoperatingsysteminfo.go | 4 +- .../v8/typedapi/types/nodepackagingtype.go | 4 +- .../v8/typedapi/types/nodeprocessinfo.go | 4 +- .../v8/typedapi/types/nodereloaderror.go | 4 +- .../v8/typedapi/types/nodereloadresult.go | 4 +- .../v8/typedapi/types/nodescontext.go | 4 +- .../v8/typedapi/types/nodescredentials.go | 4 +- .../types/nodescredentialsfiletoken.go | 4 +- .../v8/typedapi/types/nodeshard.go | 4 +- .../v8/typedapi/types/nodeshutdownstatus.go | 4 +- .../typedapi/types/nodesindexingpressure.go | 4 +- .../types/nodesindexingpressurememory.go | 4 +- .../v8/typedapi/types/nodesingest.go | 4 +- .../v8/typedapi/types/nodesrecord.go | 4 +- .../v8/typedapi/types/nodestatistics.go | 4 +- .../v8/typedapi/types/nodetasks.go | 4 +- .../v8/typedapi/types/nodethreadpoolinfo.go | 4 +- .../v8/typedapi/types/nodeusage.go | 4 +- .../v8/typedapi/types/norianalyzer.go | 4 +- .../types/noripartofspeechtokenfilter.go | 4 +- .../v8/typedapi/types/noritokenizer.go | 4 +- .../v8/typedapi/types/normalizeaggregation.go | 4 +- .../v8/typedapi/types/normalizer.go | 4 +- .../v8/typedapi/types/numberrangequery.go | 4 +- .../v8/typedapi/types/numericdecayfunction.go | 4 +- .../v8/typedapi/types/numericfielddata.go | 4 +- .../v8/typedapi/types/objectproperty.go | 4 +- .../types/onehotencodingpreprocessor.go | 4 +- .../v8/typedapi/types/operatingsystem.go | 4 +- .../types/operatingsystemmemoryinfo.go | 4 +- .../v8/typedapi/types/operationcontainer.go | 4 +- .../types/outlierdetectionparameters.go | 4 +- .../v8/typedapi/types/overallbucket.go | 4 +- .../v8/typedapi/types/overallbucketjob.go | 4 +- .../v8/typedapi/types/overlapping.go | 4 +- .../v8/typedapi/types/page.go | 4 +- .../v8/typedapi/types/pagerdutyaction.go | 4 +- .../v8/typedapi/types/pagerdutycontext.go | 4 +- .../v8/typedapi/types/pagerdutyevent.go | 4 +- .../v8/typedapi/types/pagerdutyeventproxy.go | 4 +- .../v8/typedapi/types/pagerdutyresult.go | 4 +- .../v8/typedapi/types/painlesscontextsetup.go | 4 +- .../v8/typedapi/types/parentaggregate.go | 4 +- .../v8/typedapi/types/parentaggregation.go | 4 +- .../v8/typedapi/types/parentidquery.go | 4 +- .../v8/typedapi/types/parenttaskinfo.go | 4 +- .../types/passthroughinferenceoptions.go | 4 +- .../passthroughinferenceupdateoptions.go | 4 +- .../typedapi/types/pathhierarchytokenizer.go | 4 +- .../v8/typedapi/types/patternanalyzer.go | 4 +- .../types/patterncapturetokenfilter.go | 4 +- .../types/patternreplacecharfilter.go | 4 +- .../types/patternreplacetokenfilter.go | 4 +- .../v8/typedapi/types/patterntokenizer.go | 4 +- .../v8/typedapi/types/pendingtask.go | 4 +- .../v8/typedapi/types/pendingtasksrecord.go | 4 +- .../v8/typedapi/types/percentage.go | 4 +- .../types/percentagescoreheuristic.go | 4 +- .../types/percentileranksaggregation.go | 37 +- .../v8/typedapi/types/percentiles.go | 4 +- .../typedapi/types/percentilesaggregation.go | 37 +- .../types/percentilesbucketaggregate.go | 4 +- .../types/percentilesbucketaggregation.go | 4 +- .../v8/typedapi/types/percolatequery.go | 4 +- .../v8/typedapi/types/percolatorproperty.go | 4 +- .../types/perpartitioncategorization.go | 4 +- .../v8/typedapi/types/persistenttaskstatus.go | 4 +- .../v8/typedapi/types/phase.go | 4 +- .../v8/typedapi/types/phases.go | 4 +- .../v8/typedapi/types/phonetictokenfilter.go | 4 +- .../v8/typedapi/types/phrasesuggest.go | 4 +- .../v8/typedapi/types/phrasesuggestcollate.go | 4 +- .../types/phrasesuggestcollatequery.go | 4 +- .../v8/typedapi/types/phrasesuggester.go | 4 +- .../typedapi/types/phrasesuggesthighlight.go | 4 +- .../v8/typedapi/types/phrasesuggestoption.go | 4 +- .../v8/typedapi/types/pinneddoc.go | 4 +- .../v8/typedapi/types/pinnedquery.go | 4 +- .../v8/typedapi/types/pipelineconfig.go | 4 +- .../v8/typedapi/types/pipelinemetadata.go | 4 +- .../v8/typedapi/types/pipelineprocessor.go | 4 +- .../v8/typedapi/types/pipelinesettings.go | 4 +- .../v8/typedapi/types/pipelinesimulation.go | 4 +- ...pipeseparatedflagssimplequerystringflag.go | 4 +- .../v8/typedapi/types/pivot.go | 4 +- .../typedapi/types/pivotgroupbycontainer.go | 4 +- .../v8/typedapi/types/pluginsrecord.go | 4 +- .../v8/typedapi/types/pluginsstatus.go | 4 +- .../v8/typedapi/types/pluginstats.go | 4 +- .../v8/typedapi/types/pointintimereference.go | 4 +- .../v8/typedapi/types/pointproperty.go | 4 +- .../v8/typedapi/types/pool.go | 4 +- .../typedapi/types/porterstemtokenfilter.go | 4 +- .../v8/typedapi/types/postmigrationfeature.go | 4 +- .../v8/typedapi/types/predicatetokenfilter.go | 37 +- .../v8/typedapi/types/predictedvalue.go | 4 +- .../v8/typedapi/types/prefixquery.go | 4 +- .../v8/typedapi/types/preprocessor.go | 4 +- .../v8/typedapi/types/pressurememory.go | 4 +- .../v8/typedapi/types/privileges.go | 4 +- .../v8/typedapi/types/privilegesactions.go | 4 +- .../v8/typedapi/types/privilegescheck.go | 4 +- .../v8/typedapi/types/process.go | 4 +- .../v8/typedapi/types/processor.go | 4 +- .../v8/typedapi/types/processorcontainer.go | 39 +- .../v8/typedapi/types/profile.go | 4 +- .../v8/typedapi/types/property.go | 4 +- .../typedapi/types/publishedclusterstates.go | 4 +- .../v8/typedapi/types/queries.go | 4 +- .../v8/typedapi/types/query.go | 18 +- .../v8/typedapi/types/querybreakdown.go | 4 +- .../v8/typedapi/types/querycachestats.go | 4 +- .../v8/typedapi/types/queryprofile.go | 4 +- .../v8/typedapi/types/queryrule.go | 4 +- .../v8/typedapi/types/queryruleactions.go | 4 +- .../v8/typedapi/types/queryrulecriteria.go | 4 +- .../v8/typedapi/types/queryruleset.go | 4 +- .../v8/typedapi/types/queryrulesetlistitem.go | 4 +- .../v8/typedapi/types/querystringquery.go | 4 +- .../v8/typedapi/types/queryvectorbuilder.go | 4 +- .../v8/typedapi/types/querywatch.go | 4 +- .../questionansweringinferenceoptions.go | 4 +- ...questionansweringinferenceupdateoptions.go | 4 +- .../v8/typedapi/types/randomscorefunction.go | 4 +- .../v8/typedapi/types/rangeaggregate.go | 4 +- .../v8/typedapi/types/rangeaggregation.go | 37 +- .../v8/typedapi/types/rangebucket.go | 4 +- .../v8/typedapi/types/rangequery.go | 4 +- .../v8/typedapi/types/rankcontainer.go | 4 +- .../v8/typedapi/types/rankevalhit.go | 4 +- .../v8/typedapi/types/rankevalhititem.go | 4 +- .../v8/typedapi/types/rankevalmetric.go | 4 +- .../v8/typedapi/types/rankevalmetricdetail.go | 4 +- .../rankevalmetricdiscountedcumulativegain.go | 4 +- .../rankevalmetricexpectedreciprocalrank.go | 4 +- .../types/rankevalmetricmeanreciprocalrank.go | 4 +- .../typedapi/types/rankevalmetricprecision.go | 4 +- .../types/rankevalmetricratingtreshold.go | 4 +- .../v8/typedapi/types/rankevalmetricrecall.go | 4 +- .../v8/typedapi/types/rankevalquery.go | 4 +- .../v8/typedapi/types/rankevalrequestitem.go | 4 +- .../v8/typedapi/types/rankfeaturefunction.go | 4 +- .../types/rankfeaturefunctionlinear.go | 4 +- .../types/rankfeaturefunctionlogarithm.go | 4 +- .../types/rankfeaturefunctionsaturation.go | 4 +- .../types/rankfeaturefunctionsigmoid.go | 4 +- .../v8/typedapi/types/rankfeatureproperty.go | 4 +- .../v8/typedapi/types/rankfeaturequery.go | 4 +- .../v8/typedapi/types/rankfeaturesproperty.go | 4 +- .../v8/typedapi/types/raretermsaggregation.go | 4 +- .../v8/typedapi/types/rateaggregate.go | 4 +- .../v8/typedapi/types/rateaggregation.go | 37 +- .../v8/typedapi/types/readexception.go | 4 +- .../v8/typedapi/types/realmcache.go | 4 +- .../v8/typedapi/types/realminfo.go | 4 +- .../v8/typedapi/types/recording.go | 4 +- .../v8/typedapi/types/recoverybytes.go | 4 +- .../v8/typedapi/types/recoveryfiles.go | 4 +- .../v8/typedapi/types/recoveryindexstatus.go | 4 +- .../v8/typedapi/types/recoveryorigin.go | 4 +- .../v8/typedapi/types/recoveryrecord.go | 4 +- .../v8/typedapi/types/recoverystartstatus.go | 4 +- .../v8/typedapi/types/recoverystats.go | 4 +- .../v8/typedapi/types/recoverystatus.go | 4 +- .../v8/typedapi/types/refreshstats.go | 4 +- .../v8/typedapi/types/regexoptions.go | 4 +- .../v8/typedapi/types/regexpquery.go | 4 +- .../types/regressioninferenceoptions.go | 4 +- .../v8/typedapi/types/reindexdestination.go | 4 +- .../v8/typedapi/types/reindexnode.go | 4 +- .../v8/typedapi/types/reindexsource.go | 4 +- .../v8/typedapi/types/reindexstatus.go | 4 +- .../v8/typedapi/types/reindextask.go | 4 +- .../v8/typedapi/types/reloaddetails.go | 4 +- .../v8/typedapi/types/reloadresult.go | 4 +- .../typedapi/types/relocationfailureinfo.go | 4 +- .../v8/typedapi/types/remotesource.go | 4 +- .../v8/typedapi/types/removeaction.go | 4 +- .../types/removeduplicatestokenfilter.go | 4 +- .../v8/typedapi/types/removeindexaction.go | 4 +- .../v8/typedapi/types/removeprocessor.go | 4 +- .../v8/typedapi/types/renameprocessor.go | 4 +- .../types/reportingemailattachment.go | 4 +- .../v8/typedapi/types/repositoriesrecord.go | 4 +- .../v8/typedapi/types/repository.go | 4 +- .../types/repositoryintegrityindicator.go | 4 +- .../repositoryintegrityindicatordetails.go | 4 +- .../v8/typedapi/types/repositorylocation.go | 4 +- .../types/repositorymeteringinformation.go | 4 +- .../v8/typedapi/types/repositorysettings.go | 4 +- .../v8/typedapi/types/requestcachestats.go | 4 +- .../v8/typedapi/types/requestcounts.go | 4 +- .../v8/typedapi/types/requestitem.go | 4 +- .../v8/typedapi/types/reroutedecision.go | 4 +- .../v8/typedapi/types/rerouteexplanation.go | 4 +- .../v8/typedapi/types/rerouteparameters.go | 4 +- .../v8/typedapi/types/rescore.go | 4 +- .../v8/typedapi/types/rescorequery.go | 4 +- .../v8/typedapi/types/reservedsize.go | 4 +- .../typedapi/types/resolveindexaliasitem.go | 4 +- .../types/resolveindexdatastreamsitem.go | 4 +- .../v8/typedapi/types/resolveindexitem.go | 4 +- .../v8/typedapi/types/resourceprivileges.go | 4 +- .../v8/typedapi/types/responsebody.go | 4 +- .../v8/typedapi/types/responseitem.go | 4 +- .../v8/typedapi/types/retention.go | 4 +- .../v8/typedapi/types/retentionlease.go | 4 +- .../v8/typedapi/types/retentionpolicy.go | 4 +- .../types/retentionpolicycontainer.go | 4 +- .../v8/typedapi/types/retries.go | 4 +- .../typedapi/types/reversenestedaggregate.go | 4 +- .../types/reversenestedaggregation.go | 4 +- .../v8/typedapi/types/reversetokenfilter.go | 4 +- .../v8/typedapi/types/role.go | 4 +- .../v8/typedapi/types/roledescriptor.go | 4 +- .../v8/typedapi/types/roledescriptorread.go | 4 +- .../typedapi/types/roledescriptorwrapper.go | 4 +- .../v8/typedapi/types/rolemappingrule.go | 4 +- .../v8/typedapi/types/roletemplate.go | 37 +- .../typedapi/types/roletemplateinlinequery.go | 4 +- .../types/roletemplateinlinescript.go | 4 +- .../v8/typedapi/types/roletemplatequery.go | 37 +- .../v8/typedapi/types/roletemplatescript.go | 4 +- .../v8/typedapi/types/rolloverconditions.go | 4 +- .../v8/typedapi/types/rollupcapabilities.go | 4 +- .../typedapi/types/rollupcapabilitysummary.go | 4 +- .../v8/typedapi/types/rollupfieldsummary.go | 4 +- .../v8/typedapi/types/rollupjob.go | 4 +- .../typedapi/types/rollupjobconfiguration.go | 4 +- .../v8/typedapi/types/rollupjobstats.go | 4 +- .../v8/typedapi/types/rollupjobstatus.go | 4 +- .../v8/typedapi/types/rollupjobsummary.go | 4 +- .../typedapi/types/rollupjobsummaryfield.go | 4 +- .../v8/typedapi/types/routingfield.go | 4 +- .../v8/typedapi/types/rrfrank.go | 4 +- .../v8/typedapi/types/rulecondition.go | 4 +- .../v8/typedapi/types/rulequery.go | 4 +- .../types/runningstatesearchinterval.go | 4 +- .../v8/typedapi/types/runtimefield.go | 37 +- .../typedapi/types/runtimefieldfetchfields.go | 4 +- .../v8/typedapi/types/runtimefields.go | 4 +- .../v8/typedapi/types/runtimefieldstype.go | 4 +- .../v8/typedapi/types/samplediversity.go | 4 +- .../v8/typedapi/types/sampleraggregate.go | 4 +- .../v8/typedapi/types/sampleraggregation.go | 4 +- .../v8/typedapi/types/scalarvalue.go | 32 + .../types/scaledfloatnumberproperty.go | 37 +- .../v8/typedapi/types/schedulecontainer.go | 4 +- .../v8/typedapi/types/scheduletimeofday.go | 4 +- .../v8/typedapi/types/scheduletriggerevent.go | 4 +- .../v8/typedapi/types/scoresort.go | 4 +- .../v8/typedapi/types/script.go | 4 +- .../v8/typedapi/types/scriptcache.go | 4 +- .../v8/typedapi/types/scriptcondition.go | 4 +- .../v8/typedapi/types/scriptedheuristic.go | 37 +- .../typedapi/types/scriptedmetricaggregate.go | 4 +- .../types/scriptedmetricaggregation.go | 169 +- .../v8/typedapi/types/scriptfield.go | 37 +- .../v8/typedapi/types/scripting.go | 4 +- .../v8/typedapi/types/scriptquery.go | 37 +- .../v8/typedapi/types/scriptscorefunction.go | 37 +- .../v8/typedapi/types/scriptscorequery.go | 37 +- .../v8/typedapi/types/scriptsort.go | 37 +- .../v8/typedapi/types/scripttransform.go | 4 +- .../v8/typedapi/types/scrollids.go | 4 +- .../v8/typedapi/types/searchablesnapshots.go | 4 +- .../v8/typedapi/types/searchapplication.go | 4 +- .../types/searchapplicationlistitem.go | 4 +- .../types/searchapplicationtemplate.go | 4 +- .../typedapi/types/searchasyoutypeproperty.go | 4 +- .../v8/typedapi/types/searchidle.go | 4 +- .../v8/typedapi/types/searchinput.go | 4 +- .../typedapi/types/searchinputrequestbody.go | 4 +- .../types/searchinputrequestdefinition.go | 4 +- .../v8/typedapi/types/searchprofile.go | 4 +- .../v8/typedapi/types/searchstats.go | 4 +- .../types/searchtemplaterequestbody.go | 4 +- .../v8/typedapi/types/searchtransform.go | 4 +- .../v8/typedapi/types/security.go | 4 +- .../v8/typedapi/types/securityrealm.go | 4 +- .../v8/typedapi/types/securityrolemapping.go | 4 +- .../v8/typedapi/types/securityroles.go | 4 +- .../v8/typedapi/types/securityrolesdls.go | 4 +- .../types/securityrolesdlsbitsetcache.go | 4 +- .../v8/typedapi/types/securityrolesfile.go | 4 +- .../v8/typedapi/types/securityrolesnative.go | 4 +- .../v8/typedapi/types/segment.go | 4 +- .../v8/typedapi/types/segmentsrecord.go | 4 +- .../v8/typedapi/types/segmentsstats.go | 4 +- .../types/serialdifferencingaggregation.go | 4 +- .../typedapi/types/serializedclusterstate.go | 4 +- .../types/serializedclusterstatedetail.go | 4 +- .../v8/typedapi/types/servicetoken.go | 4 +- .../v8/typedapi/types/setprocessor.go | 4 +- .../types/setsecurityuserprocessor.go | 4 +- .../v8/typedapi/types/settings.go | 4 +- .../v8/typedapi/types/settingsanalyze.go | 4 +- .../v8/typedapi/types/settingshighlight.go | 4 +- .../v8/typedapi/types/settingsquerystring.go | 4 +- .../v8/typedapi/types/settingssearch.go | 4 +- .../v8/typedapi/types/settingssimilarity.go | 4 +- .../typedapi/types/settingssimilaritybm25.go | 4 +- .../typedapi/types/settingssimilaritydfi.go | 4 +- .../typedapi/types/settingssimilaritydfr.go | 4 +- .../v8/typedapi/types/settingssimilarityib.go | 4 +- .../typedapi/types/settingssimilaritylmd.go | 4 +- .../typedapi/types/settingssimilaritylmj.go | 4 +- .../types/settingssimilarityscriptedtfidf.go | 37 +- .../v8/typedapi/types/shapefieldquery.go | 4 +- .../v8/typedapi/types/shapeproperty.go | 4 +- .../v8/typedapi/types/shapequery.go | 4 +- .../v8/typedapi/types/shardcommit.go | 4 +- .../v8/typedapi/types/shardfailure.go | 4 +- .../v8/typedapi/types/shardfilesizeinfo.go | 4 +- .../v8/typedapi/types/shardhealthstats.go | 4 +- .../v8/typedapi/types/shardlease.go | 4 +- .../v8/typedapi/types/shardmigrationstatus.go | 4 +- .../v8/typedapi/types/shardpath.go | 4 +- .../v8/typedapi/types/shardprofile.go | 4 +- .../v8/typedapi/types/shardquerycache.go | 4 +- .../v8/typedapi/types/shardrecovery.go | 4 +- .../v8/typedapi/types/shardretentionleases.go | 4 +- .../v8/typedapi/types/shardrouting.go | 4 +- .../types/shardsavailabilityindicator.go | 4 +- .../shardsavailabilityindicatordetails.go | 4 +- .../typedapi/types/shardscapacityindicator.go | 4 +- .../types/shardscapacityindicatordetails.go | 4 +- .../shardscapacityindicatortierdetail.go | 4 +- .../v8/typedapi/types/shardsegmentrouting.go | 4 +- .../v8/typedapi/types/shardsequencenumber.go | 4 +- .../v8/typedapi/types/shardsrecord.go | 4 +- .../v8/typedapi/types/shardssegment.go | 4 +- .../v8/typedapi/types/shardsstatssummary.go | 4 +- .../typedapi/types/shardsstatssummaryitem.go | 4 +- .../v8/typedapi/types/shardstatistics.go | 4 +- .../v8/typedapi/types/shardstore.go | 4 +- .../v8/typedapi/types/shardstoreexception.go | 4 +- .../v8/typedapi/types/shardstoreindex.go | 4 +- .../v8/typedapi/types/shardstorenode.go | 4 +- .../v8/typedapi/types/shardstorewrapper.go | 4 +- .../v8/typedapi/types/shardstotalstats.go | 4 +- .../v8/typedapi/types/shared.go | 4 +- .../v8/typedapi/types/shingletokenfilter.go | 4 +- .../v8/typedapi/types/shortnumberproperty.go | 37 +- .../v8/typedapi/types/shrinkconfiguration.go | 4 +- .../types/significantlongtermsaggregate.go | 4 +- .../types/significantlongtermsbucket.go | 4 +- .../types/significantstringtermsaggregate.go | 4 +- .../types/significantstringtermsbucket.go | 4 +- ...aggregatebasesignificantlongtermsbucket.go | 4 +- ...gregatebasesignificantstringtermsbucket.go | 4 +- .../significanttermsaggregatebasevoid.go | 4 +- .../types/significanttermsaggregation.go | 4 +- .../types/significanttextaggregation.go | 4 +- .../v8/typedapi/types/simpleanalyzer.go | 4 +- .../types/simplemovingaverageaggregation.go | 4 +- .../typedapi/types/simplequerystringflags.go | 4 +- .../typedapi/types/simplequerystringquery.go | 4 +- .../v8/typedapi/types/simplevalueaggregate.go | 4 +- .../v8/typedapi/types/simulatedactions.go | 4 +- .../v8/typedapi/types/simulateingest.go | 4 +- .../v8/typedapi/types/sizefield.go | 4 +- .../v8/typedapi/types/slackaction.go | 4 +- .../v8/typedapi/types/slackattachment.go | 4 +- .../v8/typedapi/types/slackattachmentfield.go | 4 +- .../typedapi/types/slackdynamicattachment.go | 4 +- .../v8/typedapi/types/slackmessage.go | 4 +- .../v8/typedapi/types/slackresult.go | 4 +- .../v8/typedapi/types/slicedscroll.go | 4 +- .../v8/typedapi/types/slices.go | 4 +- .../go-elasticsearch/v8/typedapi/types/slm.go | 4 +- .../v8/typedapi/types/slmindicator.go | 4 +- .../v8/typedapi/types/slmindicatordetails.go | 4 +- .../types/slmindicatorunhealthypolicies.go | 4 +- .../v8/typedapi/types/slmpolicy.go | 4 +- .../v8/typedapi/types/slowlogsettings.go | 4 +- .../typedapi/types/slowlogtresholdlevels.go | 4 +- .../v8/typedapi/types/slowlogtresholds.go | 4 +- .../typedapi/types/smoothingmodelcontainer.go | 4 +- .../v8/typedapi/types/snapshotindexstats.go | 4 +- .../v8/typedapi/types/snapshotinfo.go | 4 +- .../v8/typedapi/types/snapshotlifecycle.go | 4 +- .../v8/typedapi/types/snapshotresponseitem.go | 4 +- .../v8/typedapi/types/snapshotrestore.go | 4 +- .../v8/typedapi/types/snapshotshardfailure.go | 4 +- .../v8/typedapi/types/snapshotshardsstats.go | 4 +- .../v8/typedapi/types/snapshotshardsstatus.go | 4 +- .../v8/typedapi/types/snapshotsrecord.go | 4 +- .../v8/typedapi/types/snapshotstats.go | 4 +- .../v8/typedapi/types/snowballanalyzer.go | 4 +- .../v8/typedapi/types/snowballtokenfilter.go | 4 +- .../v8/typedapi/types/softdeletes.go | 4 +- .../v8/typedapi/types/sort.go | 4 +- .../v8/typedapi/types/sortcombinations.go | 4 +- .../v8/typedapi/types/sortoptions.go | 4 +- .../v8/typedapi/types/sortprocessor.go | 4 +- .../v8/typedapi/types/sourceconfig.go | 4 +- .../v8/typedapi/types/sourceconfigparam.go | 4 +- .../v8/typedapi/types/sourcefield.go | 4 +- .../v8/typedapi/types/sourcefilter.go | 4 +- .../v8/typedapi/types/spancontainingquery.go | 4 +- .../typedapi/types/spanfieldmaskingquery.go | 4 +- .../v8/typedapi/types/spanfirstquery.go | 4 +- .../v8/typedapi/types/spangapquery.go | 4 +- .../v8/typedapi/types/spanmultitermquery.go | 4 +- .../v8/typedapi/types/spannearquery.go | 4 +- .../v8/typedapi/types/spannotquery.go | 4 +- .../v8/typedapi/types/spanorquery.go | 4 +- .../v8/typedapi/types/spanquery.go | 4 +- .../v8/typedapi/types/spantermquery.go | 4 +- .../v8/typedapi/types/spanwithinquery.go | 4 +- .../typedapi/types/sparseembeddingresult.go | 67 + .../v8/typedapi/types/sparsevector.go | 26 + .../v8/typedapi/types/sparsevectorproperty.go | 4 +- .../v8/typedapi/types/splitprocessor.go | 4 +- .../go-elasticsearch/v8/typedapi/types/sql.go | 4 +- .../go-elasticsearch/v8/typedapi/types/ssl.go | 4 +- .../v8/typedapi/types/standardanalyzer.go | 4 +- .../typedapi/types/standarddeviationbounds.go | 4 +- .../types/standarddeviationboundsasstring.go | 4 +- .../v8/typedapi/types/standardtokenizer.go | 4 +- .../v8/typedapi/types/statistics.go | 4 +- .../v8/typedapi/types/stats.go | 4 +- .../v8/typedapi/types/statsaggregate.go | 4 +- .../v8/typedapi/types/statsaggregation.go | 37 +- .../v8/typedapi/types/statsbucketaggregate.go | 4 +- .../typedapi/types/statsbucketaggregation.go | 4 +- .../v8/typedapi/types/status.go | 4 +- .../types/stemmeroverridetokenfilter.go | 4 +- .../v8/typedapi/types/stemmertokenfilter.go | 4 +- .../v8/typedapi/types/stepkey.go | 4 +- .../v8/typedapi/types/stopanalyzer.go | 4 +- .../v8/typedapi/types/stoptokenfilter.go | 4 +- .../v8/typedapi/types/stopwords.go | 4 +- .../v8/typedapi/types/storage.go | 4 +- .../v8/typedapi/types/storedscript.go | 4 +- .../v8/typedapi/types/storedscriptid.go | 4 +- .../v8/typedapi/types/storestats.go | 4 +- .../v8/typedapi/types/stringifiedboolean.go | 4 +- .../types/stringifiedepochtimeunitmillis.go | 4 +- .../types/stringifiedepochtimeunitseconds.go | 4 +- .../v8/typedapi/types/stringifiedinteger.go | 4 +- .../types/stringifiedversionnumber.go | 4 +- .../types/stringraretermsaggregate.go | 4 +- .../typedapi/types/stringraretermsbucket.go | 4 +- .../v8/typedapi/types/stringstatsaggregate.go | 4 +- .../typedapi/types/stringstatsaggregation.go | 37 +- .../v8/typedapi/types/stringtermsaggregate.go | 4 +- .../v8/typedapi/types/stringtermsbucket.go | 4 +- .../types/stupidbackoffsmoothingmodel.go | 4 +- .../v8/typedapi/types/suggest.go | 4 +- .../v8/typedapi/types/suggestcontext.go | 4 +- .../v8/typedapi/types/suggester.go | 4 +- .../v8/typedapi/types/suggestfuzziness.go | 4 +- .../v8/typedapi/types/sumaggregate.go | 4 +- .../v8/typedapi/types/sumaggregation.go | 37 +- .../v8/typedapi/types/sumbucketaggregation.go | 4 +- .../v8/typedapi/types/summary.go | 4 +- .../v8/typedapi/types/synccontainer.go | 4 +- .../typedapi/types/synonymgraphtokenfilter.go | 4 +- .../v8/typedapi/types/synonymrule.go | 4 +- .../v8/typedapi/types/synonymruleread.go | 4 +- .../v8/typedapi/types/synonymssetitem.go | 4 +- .../v8/typedapi/types/synonymsupdateresult.go | 4 +- .../v8/typedapi/types/synonymtokenfilter.go | 4 +- .../types/targetmeanencodingpreprocessor.go | 4 +- .../v8/typedapi/types/taskfailure.go | 4 +- .../v8/typedapi/types/taskid.go | 4 +- .../v8/typedapi/types/taskinfo.go | 4 +- .../v8/typedapi/types/taskinfos.go | 4 +- .../v8/typedapi/types/tasksrecord.go | 4 +- .../v8/typedapi/types/tdigest.go | 4 +- .../types/tdigestpercentileranksaggregate.go | 4 +- .../types/tdigestpercentilesaggregate.go | 4 +- .../v8/typedapi/types/template.go | 4 +- .../v8/typedapi/types/templateconfig.go | 4 +- .../v8/typedapi/types/templatemapping.go | 4 +- .../v8/typedapi/types/templatesrecord.go | 4 +- .../v8/typedapi/types/term.go | 4 +- .../v8/typedapi/types/termquery.go | 4 +- .../termsaggregatebasedoubletermsbucket.go | 4 +- .../termsaggregatebaselongtermsbucket.go | 4 +- .../termsaggregatebasemultitermsbucket.go | 4 +- .../termsaggregatebasestringtermsbucket.go | 4 +- .../typedapi/types/termsaggregatebasevoid.go | 4 +- .../v8/typedapi/types/termsaggregation.go | 37 +- .../v8/typedapi/types/termsexclude.go | 4 +- .../v8/typedapi/types/termsgrouping.go | 4 +- .../v8/typedapi/types/termsinclude.go | 4 +- .../v8/typedapi/types/termslookup.go | 4 +- .../v8/typedapi/types/termspartition.go | 4 +- .../v8/typedapi/types/termsquery.go | 4 +- .../v8/typedapi/types/termsqueryfield.go | 4 +- .../v8/typedapi/types/termssetquery.go | 37 +- .../v8/typedapi/types/termsuggest.go | 4 +- .../v8/typedapi/types/termsuggester.go | 4 +- .../v8/typedapi/types/termsuggestoption.go | 4 +- .../v8/typedapi/types/termvector.go | 4 +- .../v8/typedapi/types/termvectorsfilter.go | 4 +- .../v8/typedapi/types/termvectorsresult.go | 4 +- .../v8/typedapi/types/termvectorstoken.go | 4 +- .../v8/typedapi/types/testpopulation.go | 37 +- .../textclassificationinferenceoptions.go | 4 +- ...extclassificationinferenceupdateoptions.go | 4 +- .../v8/typedapi/types/textembedding.go | 4 +- .../types/textembeddinginferenceoptions.go | 4 +- .../textembeddinginferenceupdateoptions.go | 4 +- .../v8/typedapi/types/textembeddingresult.go | 67 + .../types/textexpansioninferenceoptions.go | 4 +- .../textexpansioninferenceupdateoptions.go | 4 +- .../v8/typedapi/types/textexpansionquery.go | 4 +- .../v8/typedapi/types/textindexprefixes.go | 4 +- .../v8/typedapi/types/textproperty.go | 4 +- .../v8/typedapi/types/texttoanalyze.go | 4 +- .../v8/typedapi/types/threadcount.go | 4 +- .../v8/typedapi/types/threadpoolrecord.go | 4 +- .../v8/typedapi/types/throttlestate.go | 4 +- .../v8/typedapi/types/timeofmonth.go | 4 +- .../v8/typedapi/types/timeofweek.go | 4 +- .../v8/typedapi/types/timeofyear.go | 4 +- .../v8/typedapi/types/timesync.go | 4 +- .../v8/typedapi/types/timingstats.go | 4 +- .../v8/typedapi/types/tokencountproperty.go | 4 +- .../v8/typedapi/types/tokendetail.go | 4 +- .../v8/typedapi/types/tokenfilter.go | 4 +- .../typedapi/types/tokenfilterdefinition.go | 4 +- .../types/tokenizationconfigcontainer.go | 4 +- .../v8/typedapi/types/tokenizer.go | 4 +- .../v8/typedapi/types/tokenizerdefinition.go | 4 +- .../v8/typedapi/types/topclassentry.go | 4 +- .../v8/typedapi/types/tophit.go | 4 +- .../v8/typedapi/types/tophitsaggregate.go | 4 +- .../v8/typedapi/types/tophitsaggregation.go | 37 +- .../types/topleftbottomrightgeobounds.go | 4 +- .../v8/typedapi/types/topmetrics.go | 4 +- .../v8/typedapi/types/topmetricsaggregate.go | 4 +- .../typedapi/types/topmetricsaggregation.go | 37 +- .../v8/typedapi/types/topmetricsvalue.go | 4 +- .../types/toprightbottomleftgeobounds.go | 4 +- .../typedapi/types/totalfeatureimportance.go | 4 +- .../types/totalfeatureimportanceclass.go | 4 +- .../types/totalfeatureimportancestatistics.go | 4 +- .../v8/typedapi/types/totaluserprofiles.go | 4 +- .../v8/typedapi/types/trackhits.go | 4 +- .../v8/typedapi/types/trainedmodel.go | 4 +- .../typedapi/types/trainedmodelassignment.go | 4 +- .../trainedmodelassignmentroutingtable.go | 4 +- .../trainedmodelassignmenttaskparameters.go | 4 +- .../v8/typedapi/types/trainedmodelconfig.go | 4 +- .../typedapi/types/trainedmodelconfiginput.go | 4 +- .../types/trainedmodelconfigmetadata.go | 4 +- .../trainedmodeldeploymentallocationstatus.go | 4 +- .../types/trainedmodeldeploymentnodesstats.go | 4 +- .../types/trainedmodeldeploymentstats.go | 4 +- .../v8/typedapi/types/trainedmodelentities.go | 4 +- .../trainedmodelinferenceclassimportance.go | 4 +- .../trainedmodelinferencefeatureimportance.go | 4 +- .../types/trainedmodelinferencestats.go | 4 +- .../v8/typedapi/types/trainedmodellocation.go | 4 +- .../types/trainedmodellocationindex.go | 4 +- .../typedapi/types/trainedmodelsizestats.go | 4 +- .../v8/typedapi/types/trainedmodelsrecord.go | 4 +- .../v8/typedapi/types/trainedmodelstats.go | 4 +- .../v8/typedapi/types/trainedmodeltree.go | 4 +- .../v8/typedapi/types/trainedmodeltreenode.go | 4 +- .../typedapi/types/transformauthorization.go | 4 +- .../v8/typedapi/types/transformcontainer.go | 4 +- .../v8/typedapi/types/transformdestination.go | 4 +- .../typedapi/types/transformindexerstats.go | 4 +- .../v8/typedapi/types/transformprogress.go | 4 +- .../v8/typedapi/types/transformsource.go | 4 +- .../v8/typedapi/types/transformsrecord.go | 4 +- .../v8/typedapi/types/transformstats.go | 4 +- .../v8/typedapi/types/transformstatshealth.go | 4 +- .../v8/typedapi/types/transformsummary.go | 4 +- .../typedapi/types/transientmetadataconfig.go | 4 +- .../v8/typedapi/types/translog.go | 4 +- .../v8/typedapi/types/translogretention.go | 4 +- .../v8/typedapi/types/translogstats.go | 4 +- .../v8/typedapi/types/translogstatus.go | 4 +- .../v8/typedapi/types/transport.go | 4 +- .../v8/typedapi/types/transporthistogram.go | 4 +- .../v8/typedapi/types/triggercontainer.go | 4 +- .../typedapi/types/triggereventcontainer.go | 4 +- .../v8/typedapi/types/triggereventresult.go | 4 +- .../v8/typedapi/types/trimprocessor.go | 4 +- .../v8/typedapi/types/trimtokenfilter.go | 4 +- .../v8/typedapi/types/truncatetokenfilter.go | 4 +- .../v8/typedapi/types/ttestaggregate.go | 4 +- .../v8/typedapi/types/ttestaggregation.go | 4 +- .../v8/typedapi/types/typefieldmappings.go | 4 +- .../v8/typedapi/types/typemapping.go | 4 +- .../v8/typedapi/types/typequery.go | 4 +- .../v8/typedapi/types/uaxemailurltokenizer.go | 4 +- .../typedapi/types/unassignedinformation.go | 4 +- .../v8/typedapi/types/uniquetokenfilter.go | 4 +- .../types/unmappedraretermsaggregate.go | 4 +- .../types/unmappedsampleraggregate.go | 4 +- .../unmappedsignificanttermsaggregate.go | 4 +- .../typedapi/types/unmappedtermsaggregate.go | 4 +- .../v8/typedapi/types/unrateddocument.go | 4 +- .../types/unsignedlongnumberproperty.go | 37 +- .../v8/typedapi/types/updateaction.go | 37 +- .../types/updatebyqueryrethrottlenode.go | 4 +- .../v8/typedapi/types/updateoperation.go | 4 +- .../v8/typedapi/types/uppercaseprocessor.go | 4 +- .../v8/typedapi/types/uppercasetokenfilter.go | 4 +- .../v8/typedapi/types/urldecodeprocessor.go | 4 +- .../v8/typedapi/types/usagestatsindex.go | 4 +- .../v8/typedapi/types/usagestatsshards.go | 4 +- .../v8/typedapi/types/user.go | 4 +- .../v8/typedapi/types/useragentprocessor.go | 4 +- .../typedapi/types/userindicesprivileges.go | 4 +- .../v8/typedapi/types/userprofile.go | 4 +- .../typedapi/types/userprofilehitmetadata.go | 4 +- .../v8/typedapi/types/userprofileuser.go | 4 +- .../typedapi/types/userprofilewithmetadata.go | 4 +- .../v8/typedapi/types/userrealm.go | 4 +- .../v8/typedapi/types/validationloss.go | 4 +- .../v8/typedapi/types/valuecountaggregate.go | 4 +- .../typedapi/types/valuecountaggregation.go | 37 +- .../types/variablewidthhistogramaggregate.go | 4 +- .../variablewidthhistogramaggregation.go | 4 +- .../types/variablewidthhistogrambucket.go | 4 +- .../v8/typedapi/types/vector.go | 4 +- .../v8/typedapi/types/verifyindex.go | 4 +- .../v8/typedapi/types/versionproperty.go | 4 +- .../v8/typedapi/types/vertex.go | 4 +- .../v8/typedapi/types/vertexdefinition.go | 4 +- .../v8/typedapi/types/vertexinclude.go | 4 +- .../v8/typedapi/types/vocabulary.go | 4 +- .../v8/typedapi/types/waitforactiveshards.go | 4 +- .../v8/typedapi/types/warmerstats.go | 4 +- .../v8/typedapi/types/watch.go | 4 +- .../v8/typedapi/types/watcher.go | 4 +- .../v8/typedapi/types/watcheraction.go | 4 +- .../v8/typedapi/types/watcheractions.go | 4 +- .../v8/typedapi/types/watcheractiontotals.go | 4 +- .../v8/typedapi/types/watchercondition.go | 4 +- .../v8/typedapi/types/watcherinput.go | 4 +- .../v8/typedapi/types/watchernodestats.go | 4 +- .../v8/typedapi/types/watcherstatusactions.go | 4 +- .../v8/typedapi/types/watcherwatch.go | 4 +- .../v8/typedapi/types/watcherwatchtrigger.go | 4 +- .../types/watcherwatchtriggerschedule.go | 4 +- .../v8/typedapi/types/watchrecord.go | 4 +- .../typedapi/types/watchrecordqueuedstats.go | 4 +- .../v8/typedapi/types/watchrecordstats.go | 4 +- .../v8/typedapi/types/watchstatus.go | 4 +- .../v8/typedapi/types/webhookaction.go | 4 +- .../v8/typedapi/types/webhookresult.go | 4 +- .../types/weightedaverageaggregation.go | 4 +- .../v8/typedapi/types/weightedaveragevalue.go | 37 +- .../v8/typedapi/types/weightedavgaggregate.go | 4 +- .../v8/typedapi/types/weights.go | 4 +- .../v8/typedapi/types/whitespaceanalyzer.go | 4 +- .../v8/typedapi/types/whitespacetokenizer.go | 4 +- .../v8/typedapi/types/wildcardproperty.go | 4 +- .../v8/typedapi/types/wildcardquery.go | 4 +- .../v8/typedapi/types/wktgeobounds.go | 4 +- .../types/worddelimitergraphtokenfilter.go | 4 +- .../types/worddelimitertokenfilter.go | 4 +- .../v8/typedapi/types/wrapperquery.go | 4 +- .../v8/typedapi/types/writeoperation.go | 4 +- .../v8/typedapi/types/xpackdatafeed.go | 4 +- .../v8/typedapi/types/xpackfeature.go | 4 +- .../v8/typedapi/types/xpackfeatures.go | 4 +- .../v8/typedapi/types/xpackquery.go | 4 +- .../v8/typedapi/types/xpackrealm.go | 4 +- .../v8/typedapi/types/xpackrolemapping.go | 4 +- .../typedapi/types/xpackruntimefieldtypes.go | 4 +- .../zeroshotclassificationinferenceoptions.go | 4 +- ...hotclassificationinferenceupdateoptions.go | 4 +- .../v8/typedapi/watcher/ackwatch/ack_watch.go | 103 +- .../v8/typedapi/watcher/ackwatch/response.go | 4 +- .../watcher/activatewatch/activate_watch.go | 97 +- .../watcher/activatewatch/response.go | 4 +- .../deactivatewatch/deactivate_watch.go | 97 +- .../watcher/deactivatewatch/response.go | 4 +- .../watcher/deletewatch/delete_watch.go | 97 +- .../typedapi/watcher/deletewatch/response.go | 4 +- .../watcher/executewatch/execute_watch.go | 90 +- .../typedapi/watcher/executewatch/request.go | 4 +- .../typedapi/watcher/executewatch/response.go | 4 +- .../watcher/getsettings/get_settings.go | 73 +- .../v8/typedapi/watcher/getwatch/get_watch.go | 97 +- .../v8/typedapi/watcher/getwatch/response.go | 4 +- .../v8/typedapi/watcher/putwatch/put_watch.go | 90 +- .../v8/typedapi/watcher/putwatch/request.go | 4 +- .../v8/typedapi/watcher/putwatch/response.go | 4 +- .../watcher/querywatches/query_watches.go | 87 +- .../typedapi/watcher/querywatches/request.go | 4 +- .../typedapi/watcher/querywatches/response.go | 4 +- .../v8/typedapi/watcher/start/response.go | 4 +- .../v8/typedapi/watcher/start/start.go | 94 +- .../v8/typedapi/watcher/stats/response.go | 4 +- .../v8/typedapi/watcher/stats/stats.go | 97 +- .../v8/typedapi/watcher/stop/response.go | 4 +- .../v8/typedapi/watcher/stop/stop.go | 94 +- .../watcher/updatesettings/update_settings.go | 73 +- .../v8/typedapi/xpack/info/info.go | 94 +- .../v8/typedapi/xpack/info/response.go | 4 +- .../v8/typedapi/xpack/usage/response.go | 4 +- .../v8/typedapi/xpack/usage/usage.go | 94 +- vendor/github.com/go-logr/logr/.golangci.yaml | 26 + vendor/github.com/go-logr/logr/CHANGELOG.md | 6 + .../github.com/go-logr/logr/CONTRIBUTING.md | 17 + vendor/github.com/go-logr/logr/LICENSE | 201 ++ vendor/github.com/go-logr/logr/README.md | 393 +++ vendor/github.com/go-logr/logr/SECURITY.md | 18 + vendor/github.com/go-logr/logr/discard.go | 24 + vendor/github.com/go-logr/logr/funcr/funcr.go | 804 +++++ vendor/github.com/go-logr/logr/logr.go | 563 ++++ vendor/github.com/go-logr/stdr/LICENSE | 201 ++ vendor/github.com/go-logr/stdr/README.md | 6 + vendor/github.com/go-logr/stdr/stdr.go | 170 + vendor/github.com/google/uuid/CHANGELOG.md | 13 + vendor/github.com/google/uuid/hash.go | 6 + vendor/github.com/google/uuid/version7.go | 39 +- .../go.opentelemetry.io/otel/.codespellignore | 5 + vendor/go.opentelemetry.io/otel/.codespellrc | 10 + .../go.opentelemetry.io/otel/.gitattributes | 3 + vendor/go.opentelemetry.io/otel/.gitignore | 22 + vendor/go.opentelemetry.io/otel/.gitmodules | 3 + vendor/go.opentelemetry.io/otel/.golangci.yml | 296 ++ vendor/go.opentelemetry.io/otel/.lycheeignore | 6 + .../otel/.markdownlint.yaml | 29 + vendor/go.opentelemetry.io/otel/CHANGELOG.md | 2818 +++++++++++++++++ vendor/go.opentelemetry.io/otel/CODEOWNERS | 17 + .../go.opentelemetry.io/otel/CONTRIBUTING.md | 624 ++++ vendor/go.opentelemetry.io/otel/LICENSE | 201 ++ vendor/go.opentelemetry.io/otel/Makefile | 318 ++ vendor/go.opentelemetry.io/otel/README.md | 108 + vendor/go.opentelemetry.io/otel/RELEASING.md | 139 + vendor/go.opentelemetry.io/otel/VERSIONING.md | 224 ++ .../go.opentelemetry.io/otel/attribute/doc.go | 16 + .../otel/attribute/encoder.go | 146 + .../otel/attribute/filter.go | 60 + .../otel/attribute/iterator.go | 161 + .../go.opentelemetry.io/otel/attribute/key.go | 134 + .../go.opentelemetry.io/otel/attribute/kv.go | 86 + .../go.opentelemetry.io/otel/attribute/set.go | 429 +++ .../otel/attribute/type_string.go | 31 + .../otel/attribute/value.go | 270 ++ .../otel/baggage/baggage.go | 552 ++++ .../otel/baggage/context.go | 39 + .../go.opentelemetry.io/otel/baggage/doc.go | 20 + .../go.opentelemetry.io/otel/codes/codes.go | 116 + vendor/go.opentelemetry.io/otel/codes/doc.go | 21 + vendor/go.opentelemetry.io/otel/doc.go | 34 + .../go.opentelemetry.io/otel/error_handler.go | 38 + .../go.opentelemetry.io/otel/get_main_pkgs.sh | 41 + vendor/go.opentelemetry.io/otel/handler.go | 48 + .../otel/internal/attribute/attribute.go | 111 + .../otel/internal/baggage/baggage.go | 43 + .../otel/internal/baggage/context.go | 92 + .../go.opentelemetry.io/otel/internal/gen.go | 29 + .../otel/internal/global/handler.go | 102 + .../otel/internal/global/instruments.go | 371 +++ .../otel/internal/global/internal_logging.go | 69 + .../otel/internal/global/meter.go | 354 +++ .../otel/internal/global/propagator.go | 82 + .../otel/internal/global/state.go | 156 + .../otel/internal/global/trace.go | 199 ++ .../otel/internal/rawhelpers.go | 55 + .../otel/internal_logging.go | 26 + vendor/go.opentelemetry.io/otel/metric.go | 53 + .../go.opentelemetry.io/otel/metric/LICENSE | 201 ++ .../otel/metric/asyncfloat64.go | 271 ++ .../otel/metric/asyncint64.go | 269 ++ .../go.opentelemetry.io/otel/metric/config.go | 92 + vendor/go.opentelemetry.io/otel/metric/doc.go | 170 + .../otel/metric/embedded/embedded.go | 234 ++ .../otel/metric/instrument.go | 357 +++ .../go.opentelemetry.io/otel/metric/meter.go | 212 ++ .../otel/metric/syncfloat64.go | 185 ++ .../otel/metric/syncint64.go | 185 ++ .../go.opentelemetry.io/otel/propagation.go | 31 + .../otel/propagation/baggage.go | 58 + .../otel/propagation/doc.go | 24 + .../otel/propagation/propagation.go | 153 + .../otel/propagation/trace_context.go | 161 + .../go.opentelemetry.io/otel/requirements.txt | 1 + vendor/go.opentelemetry.io/otel/trace.go | 47 + vendor/go.opentelemetry.io/otel/trace/LICENSE | 201 ++ .../go.opentelemetry.io/otel/trace/config.go | 334 ++ .../go.opentelemetry.io/otel/trace/context.go | 61 + vendor/go.opentelemetry.io/otel/trace/doc.go | 130 + .../otel/trace/embedded/embedded.go | 56 + .../otel/trace/nonrecording.go | 27 + vendor/go.opentelemetry.io/otel/trace/noop.go | 93 + .../go.opentelemetry.io/otel/trace/trace.go | 577 ++++ .../otel/trace/tracestate.go | 222 ++ .../otel/verify_examples.sh | 85 + vendor/go.opentelemetry.io/otel/version.go | 20 + vendor/go.opentelemetry.io/otel/versions.yaml | 52 + .../grpc_binarylog_v1/binarylog.pb.go | 2 +- vendor/google.golang.org/grpc/clientconn.go | 24 +- .../grpc/internal/internal.go | 20 +- .../grpc/internal/resolver/unix/unix.go | 4 + ...ive_nonunix.go => tcp_keepalive_others.go} | 2 +- .../grpc/internal/tcp_keepalive_windows.go | 54 + .../grpc/internal/transport/http2_client.go | 10 +- .../grpc/internal/transport/http2_server.go | 7 +- .../grpc/metadata/metadata.go | 13 +- .../grpc/reflection/README.md | 2 +- .../grpc/reflection/serverreflection.go | 9 + .../grpc/resolver/resolver.go | 10 + vendor/google.golang.org/grpc/rpc_util.go | 8 +- vendor/google.golang.org/grpc/server.go | 43 +- vendor/google.golang.org/grpc/stream.go | 4 +- vendor/google.golang.org/grpc/version.go | 2 +- vendor/google.golang.org/grpc/vet.sh | 8 +- vendor/modules.txt | 65 +- 3547 files changed, 84993 insertions(+), 10929 deletions(-) create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/auth.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/endpoints.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/auth.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/endpoints.go create mode 100644 vendor/github.com/elastic/elastic-transport-go/v8/elastictransport/instrumentation.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/catalog-info.yaml create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.check_in.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.delete.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.get.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.last_sync.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.list.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.post.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.put.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.update_configuration.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.update_error.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.update_filtering.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.update_name.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.update_pipeline.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.update_scheduling.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector_sync_job.cancel.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector_sync_job.check_in.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector_sync_job.delete.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector_sync_job.error.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector_sync_job.get.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector_sync_job.list.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector_sync_job.post.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector_sync_job.update_stats.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.profiling.status.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.simulate.ingest.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/typedapi/esql/query/query.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/typedapi/esql/query/request.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/typedapi/esql/query/response.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/postsecret/post_secret.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/deletemodel/delete_model.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/deletemodel/response.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/getmodel/get_model.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/getmodel/response.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/inference/inference.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/inference/request.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/inference/response.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/putmodel/put_model.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/putmodel/request.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/putmodel/response.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getsettings/get_settings.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/updatesettings/update_settings.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/tasktype/tasktype.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/errorresponsebase.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/esqlcolumns.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceresult.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/managedby.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/modelconfig.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/modelconfigcontainer.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scalarvalue.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sparseembeddingresult.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sparsevector.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textembeddingresult.go create mode 100644 vendor/github.com/go-logr/logr/.golangci.yaml create mode 100644 vendor/github.com/go-logr/logr/CHANGELOG.md create mode 100644 vendor/github.com/go-logr/logr/CONTRIBUTING.md create mode 100644 vendor/github.com/go-logr/logr/LICENSE create mode 100644 vendor/github.com/go-logr/logr/README.md create mode 100644 vendor/github.com/go-logr/logr/SECURITY.md create mode 100644 vendor/github.com/go-logr/logr/discard.go create mode 100644 vendor/github.com/go-logr/logr/funcr/funcr.go create mode 100644 vendor/github.com/go-logr/logr/logr.go create mode 100644 vendor/github.com/go-logr/stdr/LICENSE create mode 100644 vendor/github.com/go-logr/stdr/README.md create mode 100644 vendor/github.com/go-logr/stdr/stdr.go create mode 100644 vendor/go.opentelemetry.io/otel/.codespellignore create mode 100644 vendor/go.opentelemetry.io/otel/.codespellrc create mode 100644 vendor/go.opentelemetry.io/otel/.gitattributes create mode 100644 vendor/go.opentelemetry.io/otel/.gitignore create mode 100644 vendor/go.opentelemetry.io/otel/.gitmodules create mode 100644 vendor/go.opentelemetry.io/otel/.golangci.yml create mode 100644 vendor/go.opentelemetry.io/otel/.lycheeignore create mode 100644 vendor/go.opentelemetry.io/otel/.markdownlint.yaml create mode 100644 vendor/go.opentelemetry.io/otel/CHANGELOG.md create mode 100644 vendor/go.opentelemetry.io/otel/CODEOWNERS create mode 100644 vendor/go.opentelemetry.io/otel/CONTRIBUTING.md create mode 100644 vendor/go.opentelemetry.io/otel/LICENSE create mode 100644 vendor/go.opentelemetry.io/otel/Makefile create mode 100644 vendor/go.opentelemetry.io/otel/README.md create mode 100644 vendor/go.opentelemetry.io/otel/RELEASING.md create mode 100644 vendor/go.opentelemetry.io/otel/VERSIONING.md create mode 100644 vendor/go.opentelemetry.io/otel/attribute/doc.go create mode 100644 vendor/go.opentelemetry.io/otel/attribute/encoder.go create mode 100644 vendor/go.opentelemetry.io/otel/attribute/filter.go create mode 100644 vendor/go.opentelemetry.io/otel/attribute/iterator.go create mode 100644 vendor/go.opentelemetry.io/otel/attribute/key.go create mode 100644 vendor/go.opentelemetry.io/otel/attribute/kv.go create mode 100644 vendor/go.opentelemetry.io/otel/attribute/set.go create mode 100644 vendor/go.opentelemetry.io/otel/attribute/type_string.go create mode 100644 vendor/go.opentelemetry.io/otel/attribute/value.go create mode 100644 vendor/go.opentelemetry.io/otel/baggage/baggage.go create mode 100644 vendor/go.opentelemetry.io/otel/baggage/context.go create mode 100644 vendor/go.opentelemetry.io/otel/baggage/doc.go create mode 100644 vendor/go.opentelemetry.io/otel/codes/codes.go create mode 100644 vendor/go.opentelemetry.io/otel/codes/doc.go create mode 100644 vendor/go.opentelemetry.io/otel/doc.go create mode 100644 vendor/go.opentelemetry.io/otel/error_handler.go create mode 100644 vendor/go.opentelemetry.io/otel/get_main_pkgs.sh create mode 100644 vendor/go.opentelemetry.io/otel/handler.go create mode 100644 vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go create mode 100644 vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go create mode 100644 vendor/go.opentelemetry.io/otel/internal/baggage/context.go create mode 100644 vendor/go.opentelemetry.io/otel/internal/gen.go create mode 100644 vendor/go.opentelemetry.io/otel/internal/global/handler.go create mode 100644 vendor/go.opentelemetry.io/otel/internal/global/instruments.go create mode 100644 vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go create mode 100644 vendor/go.opentelemetry.io/otel/internal/global/meter.go create mode 100644 vendor/go.opentelemetry.io/otel/internal/global/propagator.go create mode 100644 vendor/go.opentelemetry.io/otel/internal/global/state.go create mode 100644 vendor/go.opentelemetry.io/otel/internal/global/trace.go create mode 100644 vendor/go.opentelemetry.io/otel/internal/rawhelpers.go create mode 100644 vendor/go.opentelemetry.io/otel/internal_logging.go create mode 100644 vendor/go.opentelemetry.io/otel/metric.go create mode 100644 vendor/go.opentelemetry.io/otel/metric/LICENSE create mode 100644 vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go create mode 100644 vendor/go.opentelemetry.io/otel/metric/asyncint64.go create mode 100644 vendor/go.opentelemetry.io/otel/metric/config.go create mode 100644 vendor/go.opentelemetry.io/otel/metric/doc.go create mode 100644 vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go create mode 100644 vendor/go.opentelemetry.io/otel/metric/instrument.go create mode 100644 vendor/go.opentelemetry.io/otel/metric/meter.go create mode 100644 vendor/go.opentelemetry.io/otel/metric/syncfloat64.go create mode 100644 vendor/go.opentelemetry.io/otel/metric/syncint64.go create mode 100644 vendor/go.opentelemetry.io/otel/propagation.go create mode 100644 vendor/go.opentelemetry.io/otel/propagation/baggage.go create mode 100644 vendor/go.opentelemetry.io/otel/propagation/doc.go create mode 100644 vendor/go.opentelemetry.io/otel/propagation/propagation.go create mode 100644 vendor/go.opentelemetry.io/otel/propagation/trace_context.go create mode 100644 vendor/go.opentelemetry.io/otel/requirements.txt create mode 100644 vendor/go.opentelemetry.io/otel/trace.go create mode 100644 vendor/go.opentelemetry.io/otel/trace/LICENSE create mode 100644 vendor/go.opentelemetry.io/otel/trace/config.go create mode 100644 vendor/go.opentelemetry.io/otel/trace/context.go create mode 100644 vendor/go.opentelemetry.io/otel/trace/doc.go create mode 100644 vendor/go.opentelemetry.io/otel/trace/embedded/embedded.go create mode 100644 vendor/go.opentelemetry.io/otel/trace/nonrecording.go create mode 100644 vendor/go.opentelemetry.io/otel/trace/noop.go create mode 100644 vendor/go.opentelemetry.io/otel/trace/trace.go create mode 100644 vendor/go.opentelemetry.io/otel/trace/tracestate.go create mode 100644 vendor/go.opentelemetry.io/otel/verify_examples.sh create mode 100644 vendor/go.opentelemetry.io/otel/version.go create mode 100644 vendor/go.opentelemetry.io/otel/versions.yaml rename vendor/google.golang.org/grpc/internal/{tcp_keepalive_nonunix.go => tcp_keepalive_others.go} (96%) create mode 100644 vendor/google.golang.org/grpc/internal/tcp_keepalive_windows.go diff --git a/go.mod b/go.mod index b19143fb4..77bbfe263 100644 --- a/go.mod +++ b/go.mod @@ -5,17 +5,17 @@ go 1.21 require ( github.com/IBM/sarama v1.42.1 github.com/aws/aws-sdk-go-v2 v1.24.1 - github.com/aws/aws-sdk-go-v2/config v1.26.2 - github.com/aws/aws-sdk-go-v2/credentials v1.16.13 + github.com/aws/aws-sdk-go-v2/config v1.26.6 + github.com/aws/aws-sdk-go-v2/credentials v1.16.16 github.com/aws/aws-sdk-go-v2/service/sns v1.26.7 - github.com/aws/aws-sdk-go-v2/service/sqs v1.29.6 + github.com/aws/aws-sdk-go-v2/service/sqs v1.29.7 github.com/eclipse/paho.golang v0.12.0 - github.com/elastic/elastic-transport-go/v8 v8.3.0 - github.com/elastic/go-elasticsearch/v8 v8.11.1 + github.com/elastic/elastic-transport-go/v8 v8.4.0 + github.com/elastic/go-elasticsearch/v8 v8.12.0 github.com/go-redis/redis/extra/rediscmd v0.2.0 github.com/go-redis/redis/v8 v8.11.5 github.com/go-sql-driver/mysql v1.7.1 - github.com/google/uuid v1.5.0 + github.com/google/uuid v1.6.0 github.com/hashicorp/golang-lru v1.0.2 github.com/julienschmidt/httprouter v1.3.0 github.com/opentracing-contrib/go-stdlib v1.0.0 @@ -28,21 +28,21 @@ require ( github.com/uber/jaeger-lib v2.4.2-0.20210604143007-135cf5605a6d+incompatible go.mongodb.org/mongo-driver v1.13.1 golang.org/x/time v0.5.0 - google.golang.org/grpc v1.60.1 + google.golang.org/grpc v1.61.0 google.golang.org/protobuf v1.32.0 ) require ( github.com/HdrHistogram/hdrhistogram-go v1.0.1 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.10 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.11 // indirect github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.10 // indirect github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.10 // indirect - github.com/aws/aws-sdk-go-v2/internal/ini v1.7.2 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.7.3 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.9 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.18.5 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.5 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.26.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.10 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.18.7 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.7 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.26.7 // indirect github.com/aws/smithy-go v1.19.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect @@ -51,6 +51,8 @@ require ( github.com/eapache/go-resiliency v1.4.0 // indirect github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect github.com/eapache/queue v1.1.0 // indirect + github.com/go-logr/logr v1.3.0 // indirect + github.com/go-logr/stdr v1.2.2 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/gorilla/websocket v1.5.1 // indirect @@ -75,6 +77,9 @@ require ( github.com/xdg-go/scram v1.1.2 // indirect github.com/xdg-go/stringprep v1.0.4 // indirect github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect + go.opentelemetry.io/otel v1.21.0 // indirect + go.opentelemetry.io/otel/metric v1.21.0 // indirect + go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/atomic v1.11.0 // indirect golang.org/x/crypto v0.17.0 // indirect golang.org/x/net v0.18.0 // indirect diff --git a/go.sum b/go.sum index d3d5e7f3b..17c3174f2 100644 --- a/go.sum +++ b/go.sum @@ -4,32 +4,32 @@ github.com/IBM/sarama v1.42.1 h1:wugyWa15TDEHh2kvq2gAy1IHLjEjuYOYgXz/ruC/OSQ= github.com/IBM/sarama v1.42.1/go.mod h1:Xxho9HkHd4K/MDUo/T/sOqwtX/17D33++E9Wib6hUdQ= github.com/aws/aws-sdk-go-v2 v1.24.1 h1:xAojnj+ktS95YZlDf0zxWBkbFtymPeDP+rvUQIH3uAU= github.com/aws/aws-sdk-go-v2 v1.24.1/go.mod h1:LNh45Br1YAkEKaAqvmE1m8FUx6a5b/V0oAKV7of29b4= -github.com/aws/aws-sdk-go-v2/config v1.26.2 h1:+RWLEIWQIGgrz2pBPAUoGgNGs1TOyF4Hml7hCnYj2jc= -github.com/aws/aws-sdk-go-v2/config v1.26.2/go.mod h1:l6xqvUxt0Oj7PI/SUXYLNyZ9T/yBPn3YTQcJLLOdtR8= -github.com/aws/aws-sdk-go-v2/credentials v1.16.13 h1:WLABQ4Cp4vXtXfOWOS3MEZKr6AAYUpMczLhgKtAjQ/8= -github.com/aws/aws-sdk-go-v2/credentials v1.16.13/go.mod h1:Qg6x82FXwW0sJHzYruxGiuApNo31UEtJvXVSZAXeWiw= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.10 h1:w98BT5w+ao1/r5sUuiH6JkVzjowOKeOJRHERyy1vh58= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.10/go.mod h1:K2WGI7vUvkIv1HoNbfBA1bvIZ+9kL3YVmWxeKuLQsiw= +github.com/aws/aws-sdk-go-v2/config v1.26.6 h1:Z/7w9bUqlRI0FFQpetVuFYEsjzE3h7fpU6HuGmfPL/o= +github.com/aws/aws-sdk-go-v2/config v1.26.6/go.mod h1:uKU6cnDmYCvJ+pxO9S4cWDb2yWWIH5hra+32hVh1MI4= +github.com/aws/aws-sdk-go-v2/credentials v1.16.16 h1:8q6Rliyv0aUFAVtzaldUEcS+T5gbadPbWdV1WcAddK8= +github.com/aws/aws-sdk-go-v2/credentials v1.16.16/go.mod h1:UHVZrdUsv63hPXFo1H7c5fEneoVo9UXiz36QG1GEPi0= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.11 h1:c5I5iH+DZcH3xOIMlz3/tCKJDaHFwYEmxvlh2fAcFo8= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.11/go.mod h1:cRrYDYAMUohBJUtUnOhydaMHtiK/1NZ0Otc9lIb6O0Y= github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.10 h1:vF+Zgd9s+H4vOXd5BMaPWykta2a6Ih0AKLq/X6NYKn4= github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.10/go.mod h1:6BkRjejp/GR4411UGqkX8+wFMbFbqsUIimfK4XjOKR4= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.10 h1:nYPe006ktcqUji8S2mqXf9c/7NdiKriOwMvWQHgYztw= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.10/go.mod h1:6UV4SZkVvmODfXKql4LCbaZUpF7HO2BX38FgBf9ZOLw= -github.com/aws/aws-sdk-go-v2/internal/ini v1.7.2 h1:GrSw8s0Gs/5zZ0SX+gX4zQjRnRsMJDJ2sLur1gRBhEM= -github.com/aws/aws-sdk-go-v2/internal/ini v1.7.2/go.mod h1:6fQQgfuGmw8Al/3M2IgIllycxV7ZW7WCdVSqfBeUiCY= +github.com/aws/aws-sdk-go-v2/internal/ini v1.7.3 h1:n3GDfwqF2tzEkXlv5cuy4iy7LpKDtqDMcNLfZDu9rls= +github.com/aws/aws-sdk-go-v2/internal/ini v1.7.3/go.mod h1:6fQQgfuGmw8Al/3M2IgIllycxV7ZW7WCdVSqfBeUiCY= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4 h1:/b31bi3YVNlkzkBrm9LfpaKoaYZUxIAj4sHfOTmLfqw= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4/go.mod h1:2aGXHFmbInwgP9ZfpmdIfOELL79zhdNYNmReK8qDfdQ= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.9 h1:Nf2sHxjMJR8CSImIVCONRi4g0Su3J+TSTbS7G0pUeMU= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.9/go.mod h1:idky4TER38YIjr2cADF1/ugFMKvZV7p//pVeV5LZbF0= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.10 h1:DBYTXwIGQSGs9w4jKm60F5dmCQ3EEruxdc0MFh+3EY4= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.10/go.mod h1:wohMUQiFdzo0NtxbBg0mSRGZ4vL3n0dKjLTINdcIino= github.com/aws/aws-sdk-go-v2/service/sns v1.26.7 h1:DylmW2c1Z7qGxN3Y02k+voPbtM1mh7Rp+gV+7maG5io= github.com/aws/aws-sdk-go-v2/service/sns v1.26.7/go.mod h1:mLFiISZfiZAqZEfPWUsZBK8gD4dYCKuKAfapV+KrIVQ= -github.com/aws/aws-sdk-go-v2/service/sqs v1.29.6 h1:UdbDTllc7cmusTTMy1dcTrYKRl4utDEsmKh9ZjvhJCc= -github.com/aws/aws-sdk-go-v2/service/sqs v1.29.6/go.mod h1:mCUv04gd/7g+/HNzDB4X6dzJuygji0ckvB3Lg/TdG5Y= -github.com/aws/aws-sdk-go-v2/service/sso v1.18.5 h1:ldSFWz9tEHAwHNmjx2Cvy1MjP5/L9kNoR0skc6wyOOM= -github.com/aws/aws-sdk-go-v2/service/sso v1.18.5/go.mod h1:CaFfXLYL376jgbP7VKC96uFcU8Rlavak0UlAwk1Dlhc= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.5 h1:2k9KmFawS63euAkY4/ixVNsYYwrwnd5fIvgEKkfZFNM= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.5/go.mod h1:W+nd4wWDVkSUIox9bacmkBP5NMFQeTJ/xqNabpzSR38= -github.com/aws/aws-sdk-go-v2/service/sts v1.26.6 h1:HJeiuZ2fldpd0WqngyMR6KW7ofkXNLyOaHwEIGm39Cs= -github.com/aws/aws-sdk-go-v2/service/sts v1.26.6/go.mod h1:XX5gh4CB7wAs4KhcF46G6C8a2i7eupU19dcAAE+EydU= +github.com/aws/aws-sdk-go-v2/service/sqs v1.29.7 h1:tRNrFDGRm81e6nTX5Q4CFblea99eAfm0dxXazGpLceU= +github.com/aws/aws-sdk-go-v2/service/sqs v1.29.7/go.mod h1:8GWUDux5Z2h6z2efAtr54RdHXtLm8sq7Rg85ZNY/CZM= +github.com/aws/aws-sdk-go-v2/service/sso v1.18.7 h1:eajuO3nykDPdYicLlP3AGgOyVN3MOlFmZv7WGTuJPow= +github.com/aws/aws-sdk-go-v2/service/sso v1.18.7/go.mod h1:+mJNDdF+qiUlNKNC3fxn74WWNN+sOiGOEImje+3ScPM= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.7 h1:QPMJf+Jw8E1l7zqhZmMlFw6w1NmfkfiSK8mS4zOx3BA= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.7/go.mod h1:ykf3COxYI0UJmxcfcxcVuz7b6uADi1FkiUz6Eb7AgM8= +github.com/aws/aws-sdk-go-v2/service/sts v1.26.7 h1:NzO4Vrau795RkUdSHKEwiR01FaGzGOH1EETJ+5QHnm0= +github.com/aws/aws-sdk-go-v2/service/sts v1.26.7/go.mod h1:6h2YuIoxaMSCFf5fi1EgZAwdfkGMgDY+DVfa61uLe4U= github.com/aws/smithy-go v1.19.0 h1:KWFKQV80DpP3vJrrA9sVAHQ5gc2z8i4EzrLhLlWXcBM= github.com/aws/smithy-go v1.19.0/go.mod h1:NukqUGpCZIILqqiV0NIjeFh24kd/FAa4beRb6nbIUPE= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -51,15 +51,20 @@ github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/eclipse/paho.golang v0.12.0 h1:EXQFJbJklDnUqW6lyAknMWRhM2NgpHxwrrL8riUmp3Q= github.com/eclipse/paho.golang v0.12.0/go.mod h1:TSDCUivu9JnoR9Hl+H7sQMcHkejWH2/xKK1NJGtLbIE= -github.com/elastic/elastic-transport-go/v8 v8.3.0 h1:DJGxovyQLXGr62e9nDMPSxRyWION0Bh6d9eCFBriiHo= -github.com/elastic/elastic-transport-go/v8 v8.3.0/go.mod h1:87Tcz8IVNe6rVSLdBux1o/PEItLtyabHU3naC7IoqKI= -github.com/elastic/go-elasticsearch/v8 v8.11.1 h1:1VgTgUTbpqQZ4uE+cPjkOvy/8aw1ZvKcU0ZUE5Cn1mc= -github.com/elastic/go-elasticsearch/v8 v8.11.1/go.mod h1:GU1BJHO7WeamP7UhuElYwzzHtvf9SDmeVpSSy9+o6Qg= +github.com/elastic/elastic-transport-go/v8 v8.4.0 h1:EKYiH8CHd33BmMna2Bos1rDNMM89+hdgcymI+KzJCGE= +github.com/elastic/elastic-transport-go/v8 v8.4.0/go.mod h1:YLHer5cj0csTzNFXoNQ8qhtGY1GTvSqPnKWKaqQE3Hk= +github.com/elastic/go-elasticsearch/v8 v8.12.0 h1:krkiCf4peJa7bZwGegy01b5xWWaYpik78wvisTeRO1U= +github.com/elastic/go-elasticsearch/v8 v8.12.0/go.mod h1:wSzJYrrKPZQ8qPuqAqc6KMR4HrBfHnZORvyL+FMFqq0= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-redis/redis/extra/rediscmd v0.2.0 h1:A3bhCsCKsedClEH9/jYlcKqOuBoeeV+H0yDie5t+a6w= github.com/go-redis/redis/extra/rediscmd v0.2.0/go.mod h1:Z5bP1EHl9PvWhx/DupfCdZwB0JgOO3aVxWc/PFux+BE= github.com/go-redis/redis/v8 v8.3.2/go.mod h1:jszGxBCez8QA1HWSmQxJO9Y82kNibbUmeYhKWrBejTU= @@ -85,10 +90,10 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= -github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= @@ -200,6 +205,14 @@ github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5t go.mongodb.org/mongo-driver v1.13.1 h1:YIc7HTYsKndGK4RFzJ3covLz1byri52x0IoMB0Pt/vk= go.mongodb.org/mongo-driver v1.13.1/go.mod h1:wcDf1JBCXy2mOW0bWHwO/IOYqdca1MPCwDtFu/Z9+eo= go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= +go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= +go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= +go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= +go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8= +go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E= +go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= +go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= @@ -270,8 +283,8 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f h1:ultW7fxlIvee4HYrtnaRPon9HpEgFk5zYpmfMgtKB5I= google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f/go.mod h1:L9KNLi232K1/xB6f7AlSX692koaRnKaWSR0stBki0Yc= -google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= -google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= +google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md index e8c52e492..31feb8b1c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md @@ -1,3 +1,20 @@ +# v1.26.6 (2024-01-22) + +* **Bug Fix**: Remove invalid escaping of shared config values. All values in the shared config file will now be interpreted literally, save for fully-quoted strings which are unwrapped for legacy reasons. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.5 (2024-01-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.4 (2024-01-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.3 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.26.2 (2023-12-20) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go index 2d4a44d24..51f6e3320 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go @@ -3,4 +3,4 @@ package config // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.26.2" +const goModuleVersion = "1.26.6" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md index 9a801cd36..989c4ea39 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md @@ -1,3 +1,15 @@ +# v1.16.16 (2024-01-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.15 (2024-01-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.14 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.16.13 (2023-12-20) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/auth.go new file mode 100644 index 000000000..c3f5dadce --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/auth.go @@ -0,0 +1,48 @@ +package client + +import ( + "context" + "github.com/aws/smithy-go/middleware" +) + +type getIdentityMiddleware struct { + options Options +} + +func (*getIdentityMiddleware) ID() string { + return "GetIdentity" +} + +func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + return next.HandleFinalize(ctx, in) +} + +type signRequestMiddleware struct { +} + +func (*signRequestMiddleware) ID() string { + return "Signing" +} + +func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + return next.HandleFinalize(ctx, in) +} + +type resolveAuthSchemeMiddleware struct { + operation string + options Options +} + +func (*resolveAuthSchemeMiddleware) ID() string { + return "ResolveAuthScheme" +} + +func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/client.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/client.go index df0e7575c..9a869f895 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/client.go @@ -101,6 +101,7 @@ func (c *Client) GetCredentials(ctx context.Context, params *GetCredentialsInput stack.Serialize.Add(&serializeOpGetCredential{}, smithymiddleware.After) stack.Build.Add(&buildEndpoint{Endpoint: options.Endpoint}, smithymiddleware.After) stack.Deserialize.Add(&deserializeOpGetCredential{}, smithymiddleware.After) + addProtocolFinalizerMiddlewares(stack, options, "GetCredentials") retry.AddRetryMiddlewares(stack, retry.AddRetryMiddlewaresOptions{Retryer: options.Retryer}) middleware.AddSDKAgentKey(middleware.FeatureMetadata, ServiceID) smithyhttp.AddErrorCloseResponseBodyMiddleware(stack) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/endpoints.go new file mode 100644 index 000000000..748ee6724 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/endpoints.go @@ -0,0 +1,20 @@ +package client + +import ( + "context" + "github.com/aws/smithy-go/middleware" +) + +type resolveEndpointV2Middleware struct { + options Options +} + +func (*resolveEndpointV2Middleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/middleware.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/middleware.go index ddb28a66d..f2820d20e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/middleware.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/middleware.go @@ -146,3 +146,19 @@ func stof(code int) smithy.ErrorFault { } return smithy.FaultClient } + +func addProtocolFinalizerMiddlewares(stack *smithymiddleware.Stack, options Options, operation string) error { + if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, smithymiddleware.Before); err != nil { + return fmt.Errorf("add ResolveAuthScheme: %w", err) + } + if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", smithymiddleware.After); err != nil { + return fmt.Errorf("add GetIdentity: %w", err) + } + if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", smithymiddleware.After); err != nil { + return fmt.Errorf("add ResolveEndpointV2: %w", err) + } + if err := stack.Finalize.Insert(&signRequestMiddleware{}, "ResolveEndpointV2", smithymiddleware.After); err != nil { + return fmt.Errorf("add Signing: %w", err) + } + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go index 5caa4ccc0..fe92184dc 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go @@ -3,4 +3,4 @@ package credentials // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.16.13" +const goModuleVersion = "1.16.16" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md index eef77e9d5..40c317a96 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md @@ -1,3 +1,7 @@ +# v1.14.11 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.14.10 (2023-12-07) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetDynamicData.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetDynamicData.go index 9e3bdb0e6..af58b6bb1 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetDynamicData.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetDynamicData.go @@ -56,6 +56,7 @@ type GetDynamicDataOutput struct { func addGetDynamicDataMiddleware(stack *middleware.Stack, options Options) error { return addAPIRequestMiddleware(stack, options, + "GetDynamicData", buildGetDynamicDataPath, buildGetDynamicDataOutput) } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetIAMInfo.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetIAMInfo.go index 24845dccd..5111cc90c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetIAMInfo.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetIAMInfo.go @@ -53,6 +53,7 @@ type GetIAMInfoOutput struct { func addGetIAMInfoMiddleware(stack *middleware.Stack, options Options) error { return addAPIRequestMiddleware(stack, options, + "GetIAMInfo", buildGetIAMInfoPath, buildGetIAMInfoOutput, ) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetInstanceIdentityDocument.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetInstanceIdentityDocument.go index a87758ed3..dc8c09edf 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetInstanceIdentityDocument.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetInstanceIdentityDocument.go @@ -54,6 +54,7 @@ type GetInstanceIdentityDocumentOutput struct { func addGetInstanceIdentityDocumentMiddleware(stack *middleware.Stack, options Options) error { return addAPIRequestMiddleware(stack, options, + "GetInstanceIdentityDocument", buildGetInstanceIdentityDocumentPath, buildGetInstanceIdentityDocumentOutput, ) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetMetadata.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetMetadata.go index cb0ce4c00..869bfc9fe 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetMetadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetMetadata.go @@ -56,6 +56,7 @@ type GetMetadataOutput struct { func addGetMetadataMiddleware(stack *middleware.Stack, options Options) error { return addAPIRequestMiddleware(stack, options, + "GetMetadata", buildGetMetadataPath, buildGetMetadataOutput) } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetRegion.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetRegion.go index 7b9b48912..8c0572bb5 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetRegion.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetRegion.go @@ -45,6 +45,7 @@ type GetRegionOutput struct { func addGetRegionMiddleware(stack *middleware.Stack, options Options) error { return addAPIRequestMiddleware(stack, options, + "GetRegion", buildGetInstanceIdentityDocumentPath, buildGetRegionOutput, ) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetToken.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetToken.go index 841f802c1..1f9ee97a5 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetToken.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetToken.go @@ -49,6 +49,7 @@ func addGetTokenMiddleware(stack *middleware.Stack, options Options) error { err := addRequestMiddleware(stack, options, "PUT", + "GetToken", buildGetTokenPath, buildGetTokenOutput) if err != nil { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetUserData.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetUserData.go index 88aa61e9a..890369724 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetUserData.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetUserData.go @@ -45,6 +45,7 @@ type GetUserDataOutput struct { func addGetUserDataMiddleware(stack *middleware.Stack, options Options) error { return addAPIRequestMiddleware(stack, options, + "GetUserData", buildGetUserDataPath, buildGetUserDataOutput) } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/auth.go new file mode 100644 index 000000000..ad283cf82 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/auth.go @@ -0,0 +1,48 @@ +package imds + +import ( + "context" + "github.com/aws/smithy-go/middleware" +) + +type getIdentityMiddleware struct { + options Options +} + +func (*getIdentityMiddleware) ID() string { + return "GetIdentity" +} + +func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + return next.HandleFinalize(ctx, in) +} + +type signRequestMiddleware struct { +} + +func (*signRequestMiddleware) ID() string { + return "Signing" +} + +func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + return next.HandleFinalize(ctx, in) +} + +type resolveAuthSchemeMiddleware struct { + operation string + options Options +} + +func (*resolveAuthSchemeMiddleware) ID() string { + return "ResolveAuthScheme" +} + +func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/endpoints.go new file mode 100644 index 000000000..d7540da34 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/endpoints.go @@ -0,0 +1,20 @@ +package imds + +import ( + "context" + "github.com/aws/smithy-go/middleware" +) + +type resolveEndpointV2Middleware struct { + options Options +} + +func (*resolveEndpointV2Middleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go index ce3e31118..0d747b213 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go @@ -3,4 +3,4 @@ package imds // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.14.10" +const goModuleVersion = "1.14.11" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/request_middleware.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/request_middleware.go index c8abd6491..fc948c27d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/request_middleware.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/request_middleware.go @@ -17,10 +17,11 @@ import ( func addAPIRequestMiddleware(stack *middleware.Stack, options Options, + operation string, getPath func(interface{}) (string, error), getOutput func(*smithyhttp.Response) (interface{}, error), ) (err error) { - err = addRequestMiddleware(stack, options, "GET", getPath, getOutput) + err = addRequestMiddleware(stack, options, "GET", operation, getPath, getOutput) if err != nil { return err } @@ -44,6 +45,7 @@ func addAPIRequestMiddleware(stack *middleware.Stack, func addRequestMiddleware(stack *middleware.Stack, options Options, method string, + operation string, getPath func(interface{}) (string, error), getOutput func(*smithyhttp.Response) (interface{}, error), ) (err error) { @@ -101,6 +103,10 @@ func addRequestMiddleware(stack *middleware.Stack, return err } + if err := addProtocolFinalizerMiddlewares(stack, options, operation); err != nil { + return fmt.Errorf("add protocol finalizers: %w", err) + } + // Retry support return retry.AddRetryMiddlewares(stack, retry.AddRetryMiddlewaresOptions{ Retryer: options.Retryer, @@ -283,3 +289,19 @@ func appendURIPath(base, add string) string { } return reqPath } + +func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { + if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { + return fmt.Errorf("add ResolveAuthScheme: %w", err) + } + if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { + return fmt.Errorf("add GetIdentity: %w", err) + } + if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { + return fmt.Errorf("add ResolveEndpointV2: %w", err) + } + if err := stack.Finalize.Insert(&signRequestMiddleware{}, "ResolveEndpointV2", middleware.After); err != nil { + return fmt.Errorf("add Signing: %w", err) + } + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.md index adbbf4adc..9a0b5e037 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.md @@ -1,3 +1,7 @@ +# v1.7.3 (2024-01-22) + +* **Bug Fix**: Remove invalid escaping of shared config values. All values in the shared config file will now be interpreted literally, save for fully-quoted strings which are unwrapped for legacy reasons. + # v1.7.2 (2023-12-08) * **Bug Fix**: Correct loading of [services *] sections into shared config. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/go_module_metadata.go index f0673f3a0..1d68f8346 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/go_module_metadata.go @@ -3,4 +3,4 @@ package ini // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.7.2" +const goModuleVersion = "1.7.3" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/strings.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/strings.go index 661588c22..ed77d0835 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/strings.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/strings.go @@ -67,12 +67,8 @@ func unquote(s string) string { // applies various legacy conversions to property values: // - remote wrapping single/doublequotes -// - expand escaped quote and newline sequences func legacyStrconv(s string) string { s = unquote(s) - s = strings.ReplaceAll(s, `\"`, `"`) - s = strings.ReplaceAll(s, `\'`, `'`) - s = strings.ReplaceAll(s, `\n`, "\n") return s } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md index 1191b30c6..a65890b58 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md @@ -1,3 +1,7 @@ +# v1.10.10 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.10.9 (2023-12-07) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go index aacb4dd24..073e8866b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go @@ -3,4 +3,4 @@ package presignedurl // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.10.9" +const goModuleVersion = "1.10.10" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sqs/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/sqs/CHANGELOG.md index 4a5bc4969..6eedf3d6b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sqs/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sqs/CHANGELOG.md @@ -1,3 +1,7 @@ +# v1.29.7 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.29.6 (2023-12-20) * No change notes available for this release. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sqs/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sqs/go_module_metadata.go index 3a7ef4498..7a9bfb4c4 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sqs/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sqs/go_module_metadata.go @@ -3,4 +3,4 @@ package sqs // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.29.6" +const goModuleVersion = "1.29.7" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md index 7a4c30c59..46dea1b50 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md @@ -1,3 +1,11 @@ +# v1.18.7 (2024-01-18) + +* No change notes available for this release. + +# v1.18.6 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.18.5 (2023-12-08) * **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go index 52495f1fb..857a6af7e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go @@ -3,4 +3,4 @@ package sso // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.18.5" +const goModuleVersion = "1.18.7" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints/endpoints.go index f044afde4..c8f7c09e4 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints/endpoints.go @@ -283,6 +283,14 @@ var defaultPartitions = endpoints.Partitions{ Region: "il-central-1", }, }, + endpoints.EndpointKey{ + Region: "me-central-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.me-central-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "me-central-1", + }, + }, endpoints.EndpointKey{ Region: "me-south-1", }: endpoints.Endpoint{ diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md index 80df3bdde..f77c4785e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md @@ -1,3 +1,11 @@ +# v1.21.7 (2024-01-16) + +* No change notes available for this release. + +# v1.21.6 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.21.5 (2023-12-08) * **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go index 98eaaa6d8..474a574ec 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go @@ -3,4 +3,4 @@ package ssooidc // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.21.5" +const goModuleVersion = "1.21.7" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints/endpoints.go index c48da8b88..cbd77fd29 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints/endpoints.go @@ -283,6 +283,14 @@ var defaultPartitions = endpoints.Partitions{ Region: "il-central-1", }, }, + endpoints.EndpointKey{ + Region: "me-central-1", + }: endpoints.Endpoint{ + Hostname: "oidc.me-central-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "me-central-1", + }, + }, endpoints.EndpointKey{ Region: "me-south-1", }: endpoints.Endpoint{ diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md index e0961ad89..f9b6404d1 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md @@ -1,3 +1,7 @@ +# v1.26.7 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.26.6 (2023-12-20) * No change notes available for this release. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go index 59cc4c70a..369de83b8 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go @@ -552,6 +552,12 @@ func (c presignConverter) convertToPresignMiddleware(stack *middleware.Stack, op if _, ok := stack.Finalize.Get((*acceptencodingcust.DisableGzip)(nil).ID()); ok { stack.Finalize.Remove((*acceptencodingcust.DisableGzip)(nil).ID()) } + if _, ok := stack.Finalize.Get((*retry.Attempt)(nil).ID()); ok { + stack.Finalize.Remove((*retry.Attempt)(nil).ID()) + } + if _, ok := stack.Finalize.Get((*retry.MetricsHeader)(nil).ID()); ok { + stack.Finalize.Remove((*retry.MetricsHeader)(nil).ID()) + } stack.Deserialize.Clear() stack.Build.Remove((*awsmiddleware.ClientRequestID)(nil).ID()) stack.Build.Remove("UserAgent") diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go index cfdd8bfb9..962c336cf 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go @@ -3,4 +3,4 @@ package sts // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.26.6" +const goModuleVersion = "1.26.7" diff --git a/vendor/github.com/elastic/elastic-transport-go/v8/elastictransport/elastictransport.go b/vendor/github.com/elastic/elastic-transport-go/v8/elastictransport/elastictransport.go index 8dfee6b9c..4934d2937 100644 --- a/vendor/github.com/elastic/elastic-transport-go/v8/elastictransport/elastictransport.go +++ b/vendor/github.com/elastic/elastic-transport-go/v8/elastictransport/elastictransport.go @@ -51,6 +51,11 @@ type Interface interface { Perform(*http.Request) (*http.Response, error) } +// Instrumented allows to retrieve the current transport Instrumentation +type Instrumented interface { + InstrumentationEnabled() Instrumentation +} + // Config represents the configuration of HTTP client. type Config struct { UserAgent string @@ -87,6 +92,8 @@ type Config struct { EnableMetrics bool EnableDebugLogger bool + Instrumentation Instrumentation + DiscoverNodesInterval time.Duration Transport http.RoundTripper @@ -125,6 +132,8 @@ type Client struct { compressRequestBody bool compressRequestBodyLevel int + instrumentation Instrumentation + metrics *metrics transport http.RoundTripper @@ -225,6 +234,8 @@ func New(cfg Config) (*Client, error) { logger: cfg.Logger, selector: cfg.Selector, poolFunc: cfg.ConnectionPoolFunc, + + instrumentation: cfg.Instrumentation, } if client.poolFunc != nil { @@ -391,6 +402,10 @@ func (c *Client) Perform(req *http.Request) (*http.Response, error) { c.metrics.Unlock() } + if res != nil && c.instrumentation != nil { + c.instrumentation.AfterResponse(req.Context(), res) + } + // Retry on configured response statuses if res != nil && !c.disableRetry { for _, code := range c.retryOnStatus { @@ -445,6 +460,10 @@ func (c *Client) URLs() []*url.URL { return c.pool.URLs() } +func (c *Client) InstrumentationEnabled() Instrumentation { + return c.instrumentation +} + func (c *Client) setReqURL(u *url.URL, req *http.Request) *http.Request { req.URL.Scheme = u.Scheme req.URL.Host = u.Host diff --git a/vendor/github.com/elastic/elastic-transport-go/v8/elastictransport/instrumentation.go b/vendor/github.com/elastic/elastic-transport-go/v8/elastictransport/instrumentation.go new file mode 100644 index 000000000..2a6854c62 --- /dev/null +++ b/vendor/github.com/elastic/elastic-transport-go/v8/elastictransport/instrumentation.go @@ -0,0 +1,215 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package elastictransport + +import ( + "bytes" + "context" + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/codes" + "go.opentelemetry.io/otel/trace" + "io" + "net/http" + "strconv" +) + +const schemaUrl = "https://opentelemetry.io/schemas/1.21.0" +const tracerName = "elasticsearch-api" + +// Constants for Semantic Convention +// see https://opentelemetry.io/docs/specs/semconv/database/elasticsearch/ for details. +const attrDbSystem = "db.system" +const attrDbStatement = "db.statement" +const attrDbOperation = "db.operation" +const attrDbElasticsearchClusterName = "db.elasticsearch.cluster.name" +const attrDbElasticsearchNodeName = "db.elasticsearch.node.name" +const attrHttpRequestMethod = "http.request.method" +const attrUrlFull = "url.full" +const attrServerAddress = "server.address" +const attrServerPort = "server.port" +const attrPathParts = "db.elasticsearch.path_parts." + +// Instrumentation defines the interface the client uses to propagate information about the requests. +// Each method is called with the current context or request for propagation. +type Instrumentation interface { + // Start creates the span before building the request, returned context will be propagated to the request by the client. + Start(ctx context.Context, name string) context.Context + + // Close will be called once the client has returned. + Close(ctx context.Context) + + // RecordError propagates an error. + RecordError(ctx context.Context, err error) + + // RecordPathPart provides the path variables, called once per variable in the url. + RecordPathPart(ctx context.Context, pathPart, value string) + + // RecordRequestBody provides the endpoint name as well as the current request payload. + RecordRequestBody(ctx context.Context, endpoint string, query io.Reader) io.ReadCloser + + // BeforeRequest provides the request and endpoint name, called before sending to the server. + BeforeRequest(req *http.Request, endpoint string) + + // AfterRequest provides the request, system used (e.g. elasticsearch) and endpoint name. + // Called after the request has been enhanced with the information from the transport and sent to the server. + AfterRequest(req *http.Request, system, endpoint string) + + // AfterResponse provides the response. + AfterResponse(ctx context.Context, res *http.Response) +} + +type ElasticsearchOpenTelemetry struct { + tracer trace.Tracer + recordBody bool +} + +// NewOtelInstrumentation returns a new instrument for Open Telemetry traces +// If no provider is passed, the instrumentation will fall back to the global otel provider. +// captureSearchBody sets the query capture behavior for search endpoints. +// version should be set to the version provided by the caller. +func NewOtelInstrumentation(provider trace.TracerProvider, captureSearchBody bool, version string) *ElasticsearchOpenTelemetry { + if provider == nil { + provider = otel.GetTracerProvider() + } + return &ElasticsearchOpenTelemetry{ + tracer: provider.Tracer( + tracerName, + trace.WithInstrumentationVersion(version), + trace.WithSchemaURL(schemaUrl), + ), + recordBody: captureSearchBody, + } +} + +// Start begins a new span in the given context with the provided name. +// Span will always have a kind set to trace.SpanKindClient. +// The context span aware is returned for use within the client. +func (i ElasticsearchOpenTelemetry) Start(ctx context.Context, name string) context.Context { + newCtx, _ := i.tracer.Start(ctx, name, trace.WithSpanKind(trace.SpanKindClient)) + return newCtx +} + +// Close call for the end of the span, preferably defered by the client once started. +func (i ElasticsearchOpenTelemetry) Close(ctx context.Context) { + span := trace.SpanFromContext(ctx) + if span.IsRecording() { + span.End() + } +} + +// shouldRecordRequestBody filters for search endpoints. +func (i ElasticsearchOpenTelemetry) shouldRecordRequestBody(endpoint string) bool { + // allow list of endpoints that will propagate query to OpenTelemetry. + // see https://opentelemetry.io/docs/specs/semconv/database/elasticsearch/#call-level-attributes + var searchEndpoints = map[string]struct{}{ + "search": {}, + "async_search.submit": {}, + "msearch": {}, + "eql.search": {}, + "terms_enum": {}, + "search_template": {}, + "msearch_template": {}, + "render_search_template": {}, + } + + if i.recordBody { + if _, ok := searchEndpoints[endpoint]; ok { + return true + } + } + return false +} + +// RecordRequestBody add the db.statement attributes only for search endpoints. +// Returns a new reader if the query has been recorded, nil otherwise. +func (i ElasticsearchOpenTelemetry) RecordRequestBody(ctx context.Context, endpoint string, query io.Reader) io.ReadCloser { + if i.shouldRecordRequestBody(endpoint) == false { + return nil + } + + span := trace.SpanFromContext(ctx) + if span.IsRecording() { + buf := bytes.Buffer{} + buf.ReadFrom(query) + span.SetAttributes(attribute.String(attrDbStatement, buf.String())) + getBody := func() (io.ReadCloser, error) { + reader := buf + return io.NopCloser(&reader), nil + } + reader, _ := getBody() + return reader + } + + return nil +} + +// RecordError sets any provided error as an OTel error in the active span. +func (i ElasticsearchOpenTelemetry) RecordError(ctx context.Context, err error) { + span := trace.SpanFromContext(ctx) + if span.IsRecording() { + span.SetStatus(codes.Error, "an error happened while executing a request") + span.RecordError(err) + } +} + +// RecordPathPart sets the couple for a specific path part. +// An index placed in the path would translate to `db.elasticsearch.path_parts.index`. +func (i ElasticsearchOpenTelemetry) RecordPathPart(ctx context.Context, pathPart, value string) { + span := trace.SpanFromContext(ctx) + if span.IsRecording() { + span.SetAttributes(attribute.String(attrPathParts+pathPart, value)) + } +} + +// BeforeRequest noop for interface. +func (i ElasticsearchOpenTelemetry) BeforeRequest(req *http.Request, endpoint string) {} + +// AfterRequest enrich the span with the available data from the request. +func (i ElasticsearchOpenTelemetry) AfterRequest(req *http.Request, system, endpoint string) { + span := trace.SpanFromContext(req.Context()) + if span.IsRecording() { + span.SetAttributes( + attribute.String(attrDbSystem, system), + attribute.String(attrDbOperation, endpoint), + attribute.String(attrHttpRequestMethod, req.Method), + attribute.String(attrUrlFull, req.URL.String()), + attribute.String(attrServerAddress, req.URL.Hostname()), + ) + if value, err := strconv.ParseInt(req.URL.Port(), 10, 32); err == nil { + span.SetAttributes(attribute.Int64(attrServerPort, value)) + } + } +} + +// AfterResponse enric the span with the cluster id and node name if the query was executed on Elastic Cloud. +func (i ElasticsearchOpenTelemetry) AfterResponse(ctx context.Context, res *http.Response) { + span := trace.SpanFromContext(ctx) + if span.IsRecording() { + if id := res.Header.Get("X-Found-Handling-Cluster"); id != "" { + span.SetAttributes( + attribute.String(attrDbElasticsearchClusterName, id), + ) + } + if name := res.Header.Get("X-Found-Handling-Instance"); name != "" { + span.SetAttributes( + attribute.String(attrDbElasticsearchNodeName, name), + ) + } + } +} diff --git a/vendor/github.com/elastic/elastic-transport-go/v8/elastictransport/version/version.go b/vendor/github.com/elastic/elastic-transport-go/v8/elastictransport/version/version.go index ff377c9d6..7970ce802 100644 --- a/vendor/github.com/elastic/elastic-transport-go/v8/elastictransport/version/version.go +++ b/vendor/github.com/elastic/elastic-transport-go/v8/elastictransport/version/version.go @@ -17,4 +17,4 @@ package version -const Transport = "8.3.0" +const Transport = "8.4.0" diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/CHANGELOG.md b/vendor/github.com/elastic/go-elasticsearch/v8/CHANGELOG.md index 702066fc5..00289e6e2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/CHANGELOG.md +++ b/vendor/github.com/elastic/go-elasticsearch/v8/CHANGELOG.md @@ -1,3 +1,60 @@ +# 8.12.0 + +## Client + +### Golang version + +The client now requires Golang version 1.20 + +### OpenTelemetry + +The client now provides OpenTelemetry integration. This integration can be enabled in the config using the `elasticsearch.NewOpenTelemetryInstrumentation`. +Once set up, the provided `context` will be used to record spans with useful information about the request being made to the server. + +More about what you can expect in the [Semantic Conventions for Elasticsearch](https://opentelemetry.io/docs/specs/semconv/database/elasticsearch/). + +### BulkIndexer + +`if_seq_no` & `if_primary_term` are now supported thanks to @benjyiw [#783](https://github.com/elastic/go-elasticsearch/pull/783) + +## API + +* `SimulateIngest` +* `ConnectorCheckIn` +* `ConnectorDelete` +* `ConnectorGet` +* `ConnectorLastSync` +* `ConnectorList` +* `ConnectorPost` +* `ConnectorPut` +* `ConnectorSyncJobCancel` +* `ConnectorSyncJobCheckIn` +* `ConnectorSyncJobDelete` +* `ConnectorSyncJobError` +* `ConnectorSyncJobGet` +* `ConnectorSyncJobList` +* `ConnectorSyncJobPost` +* `ConnectorSyncJobUpdateStats` +* `ConnectorUpdateConfiguration` +* `ConnectorUpdateError` +* `ConnectorUpdateFiltering` +* `ConnectorUpdateName` +* `ConnectorUpdatePipeline` +* `ConnectorUpdateScheduling` + +## Typed API + +* `Esql.Query` [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-rest.html) +* `Fleet.PostSecret` +* `Inference` [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/inference-apis.html) + * `DeleteModel` [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-inference-api.html) + * `GetModel` [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/get-inference-api.html) + * `Inference` [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/post-inference-api.html) + * `PutModel` [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/put-inference-api.html) +* `SearchApplication` + * `GetSettings` [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-settings.html) + * `UpdateSettings` [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-settings.html) + # 8.11.1 ## Typed API diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/CONTRIBUTING.md b/vendor/github.com/elastic/go-elasticsearch/v8/CONTRIBUTING.md index 11662afc2..535bc8d4d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/CONTRIBUTING.md +++ b/vendor/github.com/elastic/go-elasticsearch/v8/CONTRIBUTING.md @@ -13,7 +13,7 @@ before we can accept pull requests from you. ### Prerequisites -You need at least Go 1.13 to build the project. +You need at least Go 1.20 to build the project. Docker is used for some tests to spawn an Elasticsearch server. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/Makefile b/vendor/github.com/elastic/go-elasticsearch/v8/Makefile index be6ddea7c..0f3fd18c8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/Makefile +++ b/vendor/github.com/elastic/go-elasticsearch/v8/Makefile @@ -1,6 +1,6 @@ SHELL := /bin/bash -ELASTICSEARCH_DEFAULT_BUILD_VERSION = "8.11.1-SNAPSHOT" +ELASTICSEARCH_DEFAULT_BUILD_VERSION = "8.12.0-SNAPSHOT" ##@ Test test-unit: ## Run unit tests diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/catalog-info.yaml b/vendor/github.com/elastic/go-elasticsearch/v8/catalog-info.yaml new file mode 100644 index 000000000..83c4a621b --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/catalog-info.yaml @@ -0,0 +1,19 @@ +apiVersion: backstage.io/v1alpha1 +kind: Resource +metadata: + name: buildkite-pipeline-go-elasticsearch +spec: + implementation: + apiVersion: buildkite.elastic.dev/v1 + kind: Pipeline + metadata: + description: Elasticsearch Go Client + name: go-elasticsearch + spec: + repository: elastic/go-elasticsearch + teams: + clients-team: {} + everyone: + access_level: READ_ONLY + owner: group:clients-team + type: buildkite-pipeline diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/elasticsearch.go b/vendor/github.com/elastic/go-elasticsearch/v8/elasticsearch.go index 7e97f0787..dcfc98cd0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/elasticsearch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/elasticsearch.go @@ -21,7 +21,7 @@ import ( "encoding/base64" "errors" "fmt" - "github.com/elastic/go-elasticsearch/v8/typedapi" + "go.opentelemetry.io/otel/trace" "net/http" "net/url" "os" @@ -32,6 +32,8 @@ import ( "sync" "time" + "github.com/elastic/go-elasticsearch/v8/typedapi" + "github.com/elastic/go-elasticsearch/v8/esapi" "github.com/elastic/go-elasticsearch/v8/internal/version" @@ -65,7 +67,6 @@ func init() { } // Config represents the client configuration. -// type Config struct { Addresses []string // A list of Elasticsearch nodes to use. Username string // Username for HTTP Basic Authentication. @@ -88,8 +89,8 @@ type Config struct { MaxRetries int // Default: 3. RetryOnError func(*http.Request, error) bool // Optional function allowing to indicate which error should be retried. Default: nil. - CompressRequestBody bool // Default: false. - CompressRequestBodyLevel int // Default: gzip.DefaultCompression. + CompressRequestBody bool // Default: false. + CompressRequestBodyLevel int // Default: gzip.DefaultCompression. DiscoverNodesOnStart bool // Discover nodes when initializing the client. Default: false. DiscoverNodesInterval time.Duration // Discover nodes periodically. Default: disabled. @@ -108,10 +109,28 @@ type Config struct { // Optional constructor function for a custom ConnectionPool. Default: nil. ConnectionPoolFunc func([]*elastictransport.Connection, elastictransport.Selector) elastictransport.ConnectionPool + + Instrumentation elastictransport.Instrumentation // Enable instrumentation throughout the client. } -// BaseClient represents the Elasticsearch client. +// NewOpenTelemetryInstrumentation provides the OpenTelemetry integration for both low-level and TypedAPI. +// provider is optional, if nil is passed the integration will retrieve the provider set globally by otel. +// captureSearchBody allows to define if the search queries body should be included in the span. +// Search endpoints are: // +// search +// async_search.submit +// msearch +// eql.search +// terms_enum +// search_template +// msearch_template +// render_search_template +func NewOpenTelemetryInstrumentation(provider trace.TracerProvider, captureSearchBody bool) elastictransport.Instrumentation { + return elastictransport.NewOtelInstrumentation(provider, captureSearchBody, Version) +} + +// BaseClient represents the Elasticsearch client. type BaseClient struct { Transport elastictransport.Interface metaHeader string @@ -140,7 +159,6 @@ type TypedClient struct { // // It will use the ELASTICSEARCH_URL environment variable, if set, // to configure the addresses; use a comma to separate multiple URLs. -// func NewDefaultClient() (*Client, error) { return NewClient(Config{}) } @@ -156,7 +174,6 @@ func NewDefaultClient() (*Client, error) { // environment variable is ignored. // // It's an error to set both cfg.Addresses and cfg.CloudID. -// func NewClient(cfg Config) (*Client, error) { tp, err := newTransport(cfg) if err != nil { @@ -256,7 +273,7 @@ func newTransport(cfg Config) (*elastictransport.Client, error) { cfg.Password = pw } - tp, err := elastictransport.New(elastictransport.Config{ + tpConfig := elastictransport.Config{ UserAgent: userAgent, URLs: urls, @@ -275,7 +292,7 @@ func newTransport(cfg Config) (*elastictransport.Client, error) { MaxRetries: cfg.MaxRetries, RetryBackoff: cfg.RetryBackoff, - CompressRequestBody: cfg.CompressRequestBody, + CompressRequestBody: cfg.CompressRequestBody, CompressRequestBodyLevel: cfg.CompressRequestBodyLevel, EnableMetrics: cfg.EnableMetrics, @@ -287,7 +304,11 @@ func newTransport(cfg Config) (*elastictransport.Client, error) { Logger: cfg.Logger, Selector: cfg.Selector, ConnectionPoolFunc: cfg.ConnectionPoolFunc, - }) + + Instrumentation: cfg.Instrumentation, + } + + tp, err := elastictransport.New(tpConfig) if err != nil { return nil, fmt.Errorf("error creating transport: %s", err) } @@ -296,7 +317,6 @@ func newTransport(cfg Config) (*elastictransport.Client, error) { } // Perform delegates to Transport to execute a request and return a response. -// func (c *BaseClient) Perform(req *http.Request) (*http.Response, error) { // Compatibility Header if c.compatibilityHeader { @@ -332,6 +352,14 @@ func (c *BaseClient) Perform(req *http.Request) (*http.Response, error) { return res, err } +// InstrumentationEnabled propagates back to the client the Instrumentation provided by the transport. +func (c *BaseClient) InstrumentationEnabled() elastictransport.Instrumentation { + if tp, ok := c.Transport.(elastictransport.Instrumented); ok { + return tp.InstrumentationEnabled() + } + return nil +} + // doProductCheck calls f if there as not been a prior successful call to doProductCheck, // returning nil otherwise. func (c *BaseClient) doProductCheck(f func() error) error { @@ -360,7 +388,6 @@ func (c *BaseClient) doProductCheck(f func() error) error { } // genuineCheckHeader validates the presence of the X-Elastic-Product header -// func genuineCheckHeader(header http.Header) error { if header.Get("X-Elastic-Product") != "Elasticsearch" { return errors.New(unknownProduct) @@ -369,7 +396,6 @@ func genuineCheckHeader(header http.Header) error { } // Metrics returns the client metrics. -// func (c *BaseClient) Metrics() (elastictransport.Metrics, error) { if mt, ok := c.Transport.(elastictransport.Measurable); ok { return mt.Metrics() @@ -378,7 +404,6 @@ func (c *BaseClient) Metrics() (elastictransport.Metrics, error) { } // DiscoverNodes reloads the client connections by fetching information from the cluster. -// func (c *BaseClient) DiscoverNodes() error { if dt, ok := c.Transport.(elastictransport.Discoverable); ok { return dt.DiscoverNodes() @@ -388,7 +413,6 @@ func (c *BaseClient) DiscoverNodes() error { // addrsFromEnvironment returns a list of addresses by splitting // the ELASTICSEARCH_URL environment variable with comma, or an empty list. -// func addrsFromEnvironment() []string { var addrs []string @@ -403,7 +427,6 @@ func addrsFromEnvironment() []string { } // addrsToURLs creates a list of url.URL structures from url list. -// func addrsToURLs(addrs []string) ([]*url.URL, error) { var urls []*url.URL for _, addr := range addrs { @@ -419,7 +442,6 @@ func addrsToURLs(addrs []string) ([]*url.URL, error) { // 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://" diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api._.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api._.go index bb41a1053..9c6107cd1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api._.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api._.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0 (3dbb504): DO NOT EDIT +// Code generated from specification version 8.12.0 (8395c37): DO NOT EDIT package esapi @@ -50,6 +50,27 @@ type API struct { Bulk Bulk ClearScroll ClearScroll ClosePointInTime ClosePointInTime + ConnectorCheckIn ConnectorCheckIn + ConnectorDelete ConnectorDelete + ConnectorGet ConnectorGet + ConnectorLastSync ConnectorLastSync + ConnectorList ConnectorList + ConnectorPost ConnectorPost + ConnectorPut ConnectorPut + ConnectorSyncJobCancel ConnectorSyncJobCancel + ConnectorSyncJobCheckIn ConnectorSyncJobCheckIn + ConnectorSyncJobDelete ConnectorSyncJobDelete + ConnectorSyncJobError ConnectorSyncJobError + ConnectorSyncJobGet ConnectorSyncJobGet + ConnectorSyncJobList ConnectorSyncJobList + ConnectorSyncJobPost ConnectorSyncJobPost + ConnectorSyncJobUpdateStats ConnectorSyncJobUpdateStats + ConnectorUpdateConfiguration ConnectorUpdateConfiguration + ConnectorUpdateError ConnectorUpdateError + ConnectorUpdateFiltering ConnectorUpdateFiltering + ConnectorUpdateName ConnectorUpdateName + ConnectorUpdatePipeline ConnectorUpdatePipeline + ConnectorUpdateScheduling ConnectorUpdateScheduling Count Count Create Create DanglingIndicesDeleteDanglingIndex DanglingIndicesDeleteDanglingIndex @@ -104,6 +125,7 @@ type API struct { Mtermvectors Mtermvectors OpenPointInTime OpenPointInTime Ping Ping + ProfilingStatus ProfilingStatus PutScript PutScript QueryRulesetDelete QueryRulesetDelete QueryRulesetGet QueryRulesetGet @@ -136,6 +158,7 @@ type API struct { ShutdownDeleteNode ShutdownDeleteNode ShutdownGetNode ShutdownGetNode ShutdownPutNode ShutdownPutNode + SimulateIngest SimulateIngest SlmDeleteLifecycle SlmDeleteLifecycle SlmExecuteLifecycle SlmExecuteLifecycle SlmExecuteRetention SlmExecuteRetention @@ -594,6 +617,27 @@ func New(t Transport) *API { Bulk: newBulkFunc(t), ClearScroll: newClearScrollFunc(t), ClosePointInTime: newClosePointInTimeFunc(t), + ConnectorCheckIn: newConnectorCheckInFunc(t), + ConnectorDelete: newConnectorDeleteFunc(t), + ConnectorGet: newConnectorGetFunc(t), + ConnectorLastSync: newConnectorLastSyncFunc(t), + ConnectorList: newConnectorListFunc(t), + ConnectorPost: newConnectorPostFunc(t), + ConnectorPut: newConnectorPutFunc(t), + ConnectorSyncJobCancel: newConnectorSyncJobCancelFunc(t), + ConnectorSyncJobCheckIn: newConnectorSyncJobCheckInFunc(t), + ConnectorSyncJobDelete: newConnectorSyncJobDeleteFunc(t), + ConnectorSyncJobError: newConnectorSyncJobErrorFunc(t), + ConnectorSyncJobGet: newConnectorSyncJobGetFunc(t), + ConnectorSyncJobList: newConnectorSyncJobListFunc(t), + ConnectorSyncJobPost: newConnectorSyncJobPostFunc(t), + ConnectorSyncJobUpdateStats: newConnectorSyncJobUpdateStatsFunc(t), + ConnectorUpdateConfiguration: newConnectorUpdateConfigurationFunc(t), + ConnectorUpdateError: newConnectorUpdateErrorFunc(t), + ConnectorUpdateFiltering: newConnectorUpdateFilteringFunc(t), + ConnectorUpdateName: newConnectorUpdateNameFunc(t), + ConnectorUpdatePipeline: newConnectorUpdatePipelineFunc(t), + ConnectorUpdateScheduling: newConnectorUpdateSchedulingFunc(t), Count: newCountFunc(t), Create: newCreateFunc(t), DanglingIndicesDeleteDanglingIndex: newDanglingIndicesDeleteDanglingIndexFunc(t), @@ -648,6 +692,7 @@ func New(t Transport) *API { Mtermvectors: newMtermvectorsFunc(t), OpenPointInTime: newOpenPointInTimeFunc(t), Ping: newPingFunc(t), + ProfilingStatus: newProfilingStatusFunc(t), PutScript: newPutScriptFunc(t), QueryRulesetDelete: newQueryRulesetDeleteFunc(t), QueryRulesetGet: newQueryRulesetGetFunc(t), @@ -680,6 +725,7 @@ func New(t Transport) *API { ShutdownDeleteNode: newShutdownDeleteNodeFunc(t), ShutdownGetNode: newShutdownGetNodeFunc(t), ShutdownPutNode: newShutdownPutNodeFunc(t), + SimulateIngest: newSimulateIngestFunc(t), SlmDeleteLifecycle: newSlmDeleteLifecycleFunc(t), SlmExecuteLifecycle: newSlmExecuteLifecycleFunc(t), SlmExecuteRetention: newSlmExecuteRetentionFunc(t), diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.bulk.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.bulk.go index d4343112f..5343edff9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.bulk.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.bulk.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newBulkFunc(t Transport) Bulk { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -51,16 +56,17 @@ type BulkRequest struct { Body io.Reader - Pipeline string - Refresh string - RequireAlias *bool - Routing string - Source []string - SourceExcludes []string - SourceIncludes []string - Timeout time.Duration - DocumentType string - WaitForActiveShards string + ListExecutedPipelines *bool + Pipeline string + Refresh string + RequireAlias *bool + Routing string + Source []string + SourceExcludes []string + SourceIncludes []string + Timeout time.Duration + DocumentType string + WaitForActiveShards string Pretty bool Human bool @@ -70,16 +76,27 @@ type BulkRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r BulkRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r BulkRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "bulk") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(r.Index) + 1 + len("_bulk")) @@ -87,12 +104,19 @@ func (r BulkRequest) Do(ctx context.Context, transport Transport) (*Response, er if r.Index != "" { path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } } path.WriteString("/") path.WriteString("_bulk") params = make(map[string]string) + if r.ListExecutedPipelines != nil { + params["list_executed_pipelines"] = strconv.FormatBool(*r.ListExecutedPipelines) + } + if r.Pipeline != "" { params["pipeline"] = r.Pipeline } @@ -151,6 +175,9 @@ func (r BulkRequest) Do(ctx context.Context, transport Transport) (*Response, er req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,8 +209,20 @@ func (r BulkRequest) Do(ctx context.Context, transport Transport) (*Response, er req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "bulk") + if reader := instrument.RecordRequestBody(ctx, "bulk", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "bulk") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -210,6 +249,13 @@ func (f Bulk) WithIndex(v string) func(*BulkRequest) { } } +// WithListExecutedPipelines - sets list_executed_pipelines for all incoming documents. defaults to unset (false). +func (f Bulk) WithListExecutedPipelines(v bool) func(*BulkRequest) { + return func(r *BulkRequest) { + r.ListExecutedPipelines = &v + } +} + // WithPipeline - the pipeline ID to preprocess incoming documents with. func (f Bulk) WithPipeline(v string) func(*BulkRequest) { return func(r *BulkRequest) { diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.aliases.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.aliases.go index 8546a5b75..1c1d79dd7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.aliases.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.aliases.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newCatAliasesFunc(t Transport) CatAliases { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -63,16 +68,27 @@ type CatAliasesRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CatAliasesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CatAliasesRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.aliases") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_cat") + 1 + len("aliases") + 1 + len(strings.Join(r.Name, ","))) @@ -84,6 +100,9 @@ func (r CatAliasesRequest) Do(ctx context.Context, transport Transport) (*Respon if len(r.Name) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Name, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", strings.Join(r.Name, ",")) + } } params = make(map[string]string) @@ -134,6 +153,9 @@ func (r CatAliasesRequest) Do(ctx context.Context, transport Transport) (*Respon req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -161,8 +183,17 @@ func (r CatAliasesRequest) Do(ctx context.Context, transport Transport) (*Respon req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cat.aliases") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.aliases") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.allocation.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.allocation.go index 2642b96ae..436714470 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.allocation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.allocation.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newCatAllocationFunc(t Transport) CatAllocation { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -65,16 +70,27 @@ type CatAllocationRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CatAllocationRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CatAllocationRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.allocation") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_cat") + 1 + len("allocation") + 1 + len(strings.Join(r.NodeID, ","))) @@ -86,6 +102,9 @@ func (r CatAllocationRequest) Do(ctx context.Context, transport Transport) (*Res if len(r.NodeID) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.NodeID, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "node_id", strings.Join(r.NodeID, ",")) + } } params = make(map[string]string) @@ -140,6 +159,9 @@ func (r CatAllocationRequest) Do(ctx context.Context, transport Transport) (*Res req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -167,8 +189,17 @@ func (r CatAllocationRequest) Do(ctx context.Context, transport Transport) (*Res req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cat.allocation") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.allocation") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.component_templates.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.component_templates.go index 2a700a162..d305d99ab 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.component_templates.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.component_templates.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newCatComponentTemplatesFunc(t Transport) CatComponentTemplates { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -64,16 +69,27 @@ type CatComponentTemplatesRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CatComponentTemplatesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CatComponentTemplatesRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.component_templates") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_cat") + 1 + len("component_templates") + 1 + len(r.Name)) @@ -85,6 +101,9 @@ func (r CatComponentTemplatesRequest) Do(ctx context.Context, transport Transpor if r.Name != "" { path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } } params = make(map[string]string) @@ -135,6 +154,9 @@ func (r CatComponentTemplatesRequest) Do(ctx context.Context, transport Transpor req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -162,8 +184,17 @@ func (r CatComponentTemplatesRequest) Do(ctx context.Context, transport Transpor req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cat.component_templates") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.component_templates") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.count.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.count.go index e85ab3984..1a228dc7c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.count.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.count.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newCatCountFunc(t Transport) CatCount { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -61,16 +66,27 @@ type CatCountRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CatCountRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CatCountRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.count") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_cat") + 1 + len("count") + 1 + len(strings.Join(r.Index, ","))) @@ -82,6 +98,9 @@ func (r CatCountRequest) Do(ctx context.Context, transport Transport) (*Response if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } } params = make(map[string]string) @@ -124,6 +143,9 @@ func (r CatCountRequest) Do(ctx context.Context, transport Transport) (*Response req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -151,8 +173,17 @@ func (r CatCountRequest) Do(ctx context.Context, transport Transport) (*Response req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cat.count") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.count") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.fielddata.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.fielddata.go index eaa6ad74b..60c570915 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.fielddata.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.fielddata.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newCatFielddataFunc(t Transport) CatFielddata { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -62,16 +67,27 @@ type CatFielddataRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CatFielddataRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CatFielddataRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.fielddata") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_cat") + 1 + len("fielddata") + 1 + len(strings.Join(r.Fields, ","))) @@ -83,6 +99,9 @@ func (r CatFielddataRequest) Do(ctx context.Context, transport Transport) (*Resp if len(r.Fields) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Fields, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "fields", strings.Join(r.Fields, ",")) + } } params = make(map[string]string) @@ -133,6 +152,9 @@ func (r CatFielddataRequest) Do(ctx context.Context, transport Transport) (*Resp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -160,8 +182,17 @@ func (r CatFielddataRequest) Do(ctx context.Context, transport Transport) (*Resp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cat.fielddata") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.fielddata") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.health.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.health.go index 7c62e5e41..e4cae77da 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.health.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.health.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newCatHealthFunc(t Transport) CatHealth { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -61,16 +66,27 @@ type CatHealthRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CatHealthRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CatHealthRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.health") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_cat/health")) @@ -125,6 +141,9 @@ func (r CatHealthRequest) Do(ctx context.Context, transport Transport) (*Respons req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -152,8 +171,17 @@ func (r CatHealthRequest) Do(ctx context.Context, transport Transport) (*Respons req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cat.health") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.health") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.help.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.help.go index dabe08876..ba7721c50 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.help.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.help.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newCatHelpFunc(t Transport) CatHelp { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -56,16 +61,27 @@ type CatHelpRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CatHelpRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CatHelpRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.help") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_cat")) @@ -100,6 +116,9 @@ func (r CatHelpRequest) Do(ctx context.Context, transport Transport) (*Response, req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -127,8 +146,17 @@ func (r CatHelpRequest) Do(ctx context.Context, transport Transport) (*Response, req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cat.help") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.help") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.indices.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.indices.go index 59571d64a..ec1c1cf13 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.indices.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.indices.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newCatIndicesFunc(t Transport) CatIndices { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -69,16 +74,27 @@ type CatIndicesRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CatIndicesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CatIndicesRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.indices") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_cat") + 1 + len("indices") + 1 + len(strings.Join(r.Index, ","))) @@ -90,6 +106,9 @@ func (r CatIndicesRequest) Do(ctx context.Context, transport Transport) (*Respon if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } } params = make(map[string]string) @@ -160,6 +179,9 @@ func (r CatIndicesRequest) Do(ctx context.Context, transport Transport) (*Respon req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -187,8 +209,17 @@ func (r CatIndicesRequest) Do(ctx context.Context, transport Transport) (*Respon req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cat.indices") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.indices") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.master.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.master.go index 6c3225aab..743ccbc9f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.master.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.master.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newCatMasterFunc(t Transport) CatMaster { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -62,16 +67,27 @@ type CatMasterRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CatMasterRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CatMasterRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.master") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_cat/master")) @@ -126,6 +142,9 @@ func (r CatMasterRequest) Do(ctx context.Context, transport Transport) (*Respons req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -153,8 +172,17 @@ func (r CatMasterRequest) Do(ctx context.Context, transport Transport) (*Respons req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cat.master") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.master") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.nodeattrs.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.nodeattrs.go index 7a0764d61..086b74fa5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.nodeattrs.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.nodeattrs.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newCatNodeattrsFunc(t Transport) CatNodeattrs { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -62,16 +67,27 @@ type CatNodeattrsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CatNodeattrsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CatNodeattrsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.nodeattrs") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_cat/nodeattrs")) @@ -126,6 +142,9 @@ func (r CatNodeattrsRequest) Do(ctx context.Context, transport Transport) (*Resp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -153,8 +172,17 @@ func (r CatNodeattrsRequest) Do(ctx context.Context, transport Transport) (*Resp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cat.nodeattrs") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.nodeattrs") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.nodes.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.nodes.go index 62b489db5..aa7bc1631 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.nodes.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.nodes.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newCatNodesFunc(t Transport) CatNodes { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -65,16 +70,27 @@ type CatNodesRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CatNodesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CatNodesRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.nodes") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_cat/nodes")) @@ -141,6 +157,9 @@ func (r CatNodesRequest) Do(ctx context.Context, transport Transport) (*Response req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -168,8 +187,17 @@ func (r CatNodesRequest) Do(ctx context.Context, transport Transport) (*Response req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cat.nodes") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.nodes") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.pending_tasks.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.pending_tasks.go index e0650b7e5..eb41a62d3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.pending_tasks.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.pending_tasks.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newCatPendingTasksFunc(t Transport) CatPendingTasks { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -63,16 +68,27 @@ type CatPendingTasksRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CatPendingTasksRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CatPendingTasksRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.pending_tasks") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_cat/pending_tasks")) @@ -131,6 +147,9 @@ func (r CatPendingTasksRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -158,8 +177,17 @@ func (r CatPendingTasksRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cat.pending_tasks") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.pending_tasks") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.plugins.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.plugins.go index b403b5952..14dede3ea 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.plugins.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.plugins.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newCatPluginsFunc(t Transport) CatPlugins { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -63,16 +68,27 @@ type CatPluginsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CatPluginsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CatPluginsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.plugins") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_cat/plugins")) @@ -131,6 +147,9 @@ func (r CatPluginsRequest) Do(ctx context.Context, transport Transport) (*Respon req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -158,8 +177,17 @@ func (r CatPluginsRequest) Do(ctx context.Context, transport Transport) (*Respon req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cat.plugins") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.plugins") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.recovery.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.recovery.go index aad7048e7..0c92488c2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.recovery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.recovery.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newCatRecoveryFunc(t Transport) CatRecovery { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -65,16 +70,27 @@ type CatRecoveryRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CatRecoveryRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CatRecoveryRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.recovery") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_cat") + 1 + len("recovery") + 1 + len(strings.Join(r.Index, ","))) @@ -86,6 +102,9 @@ func (r CatRecoveryRequest) Do(ctx context.Context, transport Transport) (*Respo if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } } params = make(map[string]string) @@ -148,6 +167,9 @@ func (r CatRecoveryRequest) Do(ctx context.Context, transport Transport) (*Respo req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,8 +197,17 @@ func (r CatRecoveryRequest) Do(ctx context.Context, transport Transport) (*Respo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cat.recovery") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.recovery") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.repositories.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.repositories.go index 85bbe7c63..63a33ad03 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.repositories.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.repositories.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newCatRepositoriesFunc(t Transport) CatRepositories { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -62,16 +67,27 @@ type CatRepositoriesRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CatRepositoriesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CatRepositoriesRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.repositories") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_cat/repositories")) @@ -126,6 +142,9 @@ func (r CatRepositoriesRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -153,8 +172,17 @@ func (r CatRepositoriesRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cat.repositories") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.repositories") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.segments.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.segments.go index a2c591fff..d86bc0ff2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.segments.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.segments.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newCatSegmentsFunc(t Transport) CatSegments { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -62,16 +67,27 @@ type CatSegmentsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CatSegmentsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CatSegmentsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.segments") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_cat") + 1 + len("segments") + 1 + len(strings.Join(r.Index, ","))) @@ -83,6 +99,9 @@ func (r CatSegmentsRequest) Do(ctx context.Context, transport Transport) (*Respo if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } } params = make(map[string]string) @@ -129,6 +148,9 @@ func (r CatSegmentsRequest) Do(ctx context.Context, transport Transport) (*Respo req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -156,8 +178,17 @@ func (r CatSegmentsRequest) Do(ctx context.Context, transport Transport) (*Respo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cat.segments") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.segments") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.shards.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.shards.go index 2e6a96828..befb56bdf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.shards.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.shards.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newCatShardsFunc(t Transport) CatShards { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -65,16 +70,27 @@ type CatShardsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CatShardsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CatShardsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.shards") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_cat") + 1 + len("shards") + 1 + len(strings.Join(r.Index, ","))) @@ -86,6 +102,9 @@ func (r CatShardsRequest) Do(ctx context.Context, transport Transport) (*Respons if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } } params = make(map[string]string) @@ -140,6 +159,9 @@ func (r CatShardsRequest) Do(ctx context.Context, transport Transport) (*Respons req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -167,8 +189,17 @@ func (r CatShardsRequest) Do(ctx context.Context, transport Transport) (*Respons req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cat.shards") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.shards") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.snapshots.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.snapshots.go index db06acc1d..514933b44 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.snapshots.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.snapshots.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newCatSnapshotsFunc(t Transport) CatSnapshots { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -65,16 +70,27 @@ type CatSnapshotsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CatSnapshotsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CatSnapshotsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.snapshots") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_cat") + 1 + len("snapshots") + 1 + len(strings.Join(r.Repository, ","))) @@ -86,6 +102,9 @@ func (r CatSnapshotsRequest) Do(ctx context.Context, transport Transport) (*Resp if len(r.Repository) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Repository, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "repository", strings.Join(r.Repository, ",")) + } } params = make(map[string]string) @@ -140,6 +159,9 @@ func (r CatSnapshotsRequest) Do(ctx context.Context, transport Transport) (*Resp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -167,8 +189,17 @@ func (r CatSnapshotsRequest) Do(ctx context.Context, transport Transport) (*Resp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cat.snapshots") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.snapshots") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.tasks.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.tasks.go index 3fb814426..2fb079834 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.tasks.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.tasks.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newCatTasksFunc(t Transport) CatTasks { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -66,16 +71,27 @@ type CatTasksRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CatTasksRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CatTasksRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.tasks") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_cat/tasks")) @@ -142,6 +158,9 @@ func (r CatTasksRequest) Do(ctx context.Context, transport Transport) (*Response req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -169,8 +188,17 @@ func (r CatTasksRequest) Do(ctx context.Context, transport Transport) (*Response req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cat.tasks") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.tasks") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.templates.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.templates.go index ee8ba44f8..8e9574e90 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.templates.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.templates.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newCatTemplatesFunc(t Transport) CatTemplates { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -64,16 +69,27 @@ type CatTemplatesRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CatTemplatesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CatTemplatesRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.templates") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_cat") + 1 + len("templates") + 1 + len(r.Name)) @@ -85,6 +101,9 @@ func (r CatTemplatesRequest) Do(ctx context.Context, transport Transport) (*Resp if r.Name != "" { path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } } params = make(map[string]string) @@ -135,6 +154,9 @@ func (r CatTemplatesRequest) Do(ctx context.Context, transport Transport) (*Resp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -162,8 +184,17 @@ func (r CatTemplatesRequest) Do(ctx context.Context, transport Transport) (*Resp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cat.templates") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.templates") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.thread_pool.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.thread_pool.go index 700e01fb3..91021e0f0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.thread_pool.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cat.thread_pool.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newCatThreadPoolFunc(t Transport) CatThreadPool { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -66,16 +71,27 @@ type CatThreadPoolRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CatThreadPoolRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CatThreadPoolRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.thread_pool") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_cat") + 1 + len("thread_pool") + 1 + len(strings.Join(r.ThreadPoolPatterns, ","))) @@ -87,6 +103,9 @@ func (r CatThreadPoolRequest) Do(ctx context.Context, transport Transport) (*Res if len(r.ThreadPoolPatterns) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.ThreadPoolPatterns, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "thread_pool_patterns", strings.Join(r.ThreadPoolPatterns, ",")) + } } params = make(map[string]string) @@ -141,6 +160,9 @@ func (r CatThreadPoolRequest) Do(ctx context.Context, transport Transport) (*Res req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -168,8 +190,17 @@ func (r CatThreadPoolRequest) Do(ctx context.Context, transport Transport) (*Res req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cat.thread_pool") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.thread_pool") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.clear_scroll.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.clear_scroll.go index f6829b615..d3d299aa5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.clear_scroll.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.clear_scroll.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newClearScrollFunc(t Transport) ClearScroll { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type ClearScrollRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ClearScrollRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ClearScrollRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "clear_scroll") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_search") + 1 + len("scroll") + 1 + len(strings.Join(r.ScrollID, ","))) @@ -78,6 +94,9 @@ func (r ClearScrollRequest) Do(ctx context.Context, transport Transport) (*Respo if len(r.ScrollID) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.ScrollID, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "scroll_id", strings.Join(r.ScrollID, ",")) + } } params = make(map[string]string) @@ -100,6 +119,9 @@ func (r ClearScrollRequest) Do(ctx context.Context, transport Transport) (*Respo req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -131,8 +153,20 @@ func (r ClearScrollRequest) Do(ctx context.Context, transport Transport) (*Respo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "clear_scroll") + if reader := instrument.RecordRequestBody(ctx, "clear_scroll", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "clear_scroll") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.allocation_explain.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.allocation_explain.go index e79c78791..2cf86b3ef 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.allocation_explain.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.allocation_explain.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newClusterAllocationExplainFunc(t Transport) ClusterAllocationExplain { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -59,16 +64,27 @@ type ClusterAllocationExplainRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ClusterAllocationExplainRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ClusterAllocationExplainRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.allocation_explain") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_cluster/allocation/explain")) @@ -103,6 +119,9 @@ func (r ClusterAllocationExplainRequest) Do(ctx context.Context, transport Trans req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -134,8 +153,20 @@ func (r ClusterAllocationExplainRequest) Do(ctx context.Context, transport Trans req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cluster.allocation_explain") + if reader := instrument.RecordRequestBody(ctx, "cluster.allocation_explain", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cluster.allocation_explain") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.delete_component_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.delete_component_template.go index 6fef752ee..9bfb30943 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.delete_component_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.delete_component_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newClusterDeleteComponentTemplateFunc(t Transport) ClusterDeleteComponentTe for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -58,16 +63,27 @@ type ClusterDeleteComponentTemplateRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ClusterDeleteComponentTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ClusterDeleteComponentTemplateRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.delete_component_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_component_template") + 1 + len(r.Name)) @@ -76,6 +92,9 @@ func (r ClusterDeleteComponentTemplateRequest) Do(ctx context.Context, transport path.WriteString("_component_template") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } params = make(map[string]string) @@ -105,6 +124,9 @@ func (r ClusterDeleteComponentTemplateRequest) Do(ctx context.Context, transport req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -132,8 +154,17 @@ func (r ClusterDeleteComponentTemplateRequest) Do(ctx context.Context, transport req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cluster.delete_component_template") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cluster.delete_component_template") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.delete_voting_config_exclusions.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.delete_voting_config_exclusions.go index f2b850c49..be6a72d80 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.delete_voting_config_exclusions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.delete_voting_config_exclusions.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newClusterDeleteVotingConfigExclusionsFunc(t Transport) ClusterDeleteVoting for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type ClusterDeleteVotingConfigExclusionsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ClusterDeleteVotingConfigExclusionsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ClusterDeleteVotingConfigExclusionsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.delete_voting_config_exclusions") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + len("/_cluster/voting_config_exclusions")) @@ -101,6 +117,9 @@ func (r ClusterDeleteVotingConfigExclusionsRequest) Do(ctx context.Context, tran req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -128,8 +147,17 @@ func (r ClusterDeleteVotingConfigExclusionsRequest) Do(ctx context.Context, tran req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cluster.delete_voting_config_exclusions") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cluster.delete_voting_config_exclusions") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.exists_component_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.exists_component_template.go index 628f166cc..46ff5dca9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.exists_component_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.exists_component_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newClusterExistsComponentTemplateFunc(t Transport) ClusterExistsComponentTe for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -59,16 +64,27 @@ type ClusterExistsComponentTemplateRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ClusterExistsComponentTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ClusterExistsComponentTemplateRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.exists_component_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "HEAD" path.Grow(7 + 1 + len("_component_template") + 1 + len(r.Name)) @@ -77,6 +93,9 @@ func (r ClusterExistsComponentTemplateRequest) Do(ctx context.Context, transport path.WriteString("_component_template") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } params = make(map[string]string) @@ -106,6 +125,9 @@ func (r ClusterExistsComponentTemplateRequest) Do(ctx context.Context, transport req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -133,8 +155,17 @@ func (r ClusterExistsComponentTemplateRequest) Do(ctx context.Context, transport req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cluster.exists_component_template") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cluster.exists_component_template") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.get_component_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.get_component_template.go index 4aaea1b29..0a14eaefe 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.get_component_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.get_component_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newClusterGetComponentTemplateFunc(t Transport) ClusterGetComponentTemplate for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -60,16 +65,27 @@ type ClusterGetComponentTemplateRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ClusterGetComponentTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ClusterGetComponentTemplateRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.get_component_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_component_template") + 1 + len(strings.Join(r.Name, ","))) @@ -79,6 +95,9 @@ func (r ClusterGetComponentTemplateRequest) Do(ctx context.Context, transport Tr if len(r.Name) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Name, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", strings.Join(r.Name, ",")) + } } params = make(map[string]string) @@ -113,6 +132,9 @@ func (r ClusterGetComponentTemplateRequest) Do(ctx context.Context, transport Tr req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -140,8 +162,17 @@ func (r ClusterGetComponentTemplateRequest) Do(ctx context.Context, transport Tr req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cluster.get_component_template") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cluster.get_component_template") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.get_settings.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.get_settings.go index f8f3438d2..f944e8129 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.get_settings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.get_settings.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newClusterGetSettingsFunc(t Transport) ClusterGetSettings { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -59,16 +64,27 @@ type ClusterGetSettingsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ClusterGetSettingsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ClusterGetSettingsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.get_settings") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_cluster/settings")) @@ -111,6 +127,9 @@ func (r ClusterGetSettingsRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -138,8 +157,17 @@ func (r ClusterGetSettingsRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cluster.get_settings") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cluster.get_settings") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.health.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.health.go index c5fd6ad46..3833b78b1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.health.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.health.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newClusterHealthFunc(t Transport) ClusterHealth { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -68,16 +73,27 @@ type ClusterHealthRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ClusterHealthRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ClusterHealthRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.health") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_cluster") + 1 + len("health") + 1 + len(strings.Join(r.Index, ","))) @@ -89,6 +105,9 @@ func (r ClusterHealthRequest) Do(ctx context.Context, transport Transport) (*Res if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } } params = make(map[string]string) @@ -155,6 +174,9 @@ func (r ClusterHealthRequest) Do(ctx context.Context, transport Transport) (*Res req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,8 +204,17 @@ func (r ClusterHealthRequest) Do(ctx context.Context, transport Transport) (*Res req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cluster.health") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cluster.health") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.info.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.info.go index bb5c459d1..a2fc94e30 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.info.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.info.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newClusterInfoFunc(t Transport) ClusterInfo { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type ClusterInfoRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ClusterInfoRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ClusterInfoRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.info") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" if len(r.Target) == 0 { @@ -77,6 +93,9 @@ func (r ClusterInfoRequest) Do(ctx context.Context, transport Transport) (*Respo path.WriteString("_info") path.WriteString("/") path.WriteString(strings.Join(r.Target, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "target", strings.Join(r.Target, ",")) + } params = make(map[string]string) @@ -98,6 +117,9 @@ func (r ClusterInfoRequest) Do(ctx context.Context, transport Transport) (*Respo req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -125,8 +147,17 @@ func (r ClusterInfoRequest) Do(ctx context.Context, transport Transport) (*Respo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cluster.info") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cluster.info") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.pending_tasks.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.pending_tasks.go index 1d41acaf5..9d4aa3ef8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.pending_tasks.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.pending_tasks.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newClusterPendingTasksFunc(t Transport) ClusterPendingTasks { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -58,16 +63,27 @@ type ClusterPendingTasksRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ClusterPendingTasksRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ClusterPendingTasksRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.pending_tasks") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_cluster/pending_tasks")) @@ -102,6 +118,9 @@ func (r ClusterPendingTasksRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -129,8 +148,17 @@ func (r ClusterPendingTasksRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cluster.pending_tasks") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cluster.pending_tasks") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.post_voting_config_exclusions.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.post_voting_config_exclusions.go index 5a718c980..8cae2ff3d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.post_voting_config_exclusions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.post_voting_config_exclusions.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newClusterPostVotingConfigExclusionsFunc(t Transport) ClusterPostVotingConf for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -58,16 +63,27 @@ type ClusterPostVotingConfigExclusionsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ClusterPostVotingConfigExclusionsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ClusterPostVotingConfigExclusionsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.post_voting_config_exclusions") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_cluster/voting_config_exclusions")) @@ -110,6 +126,9 @@ func (r ClusterPostVotingConfigExclusionsRequest) Do(ctx context.Context, transp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -137,8 +156,17 @@ func (r ClusterPostVotingConfigExclusionsRequest) Do(ctx context.Context, transp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cluster.post_voting_config_exclusions") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cluster.post_voting_config_exclusions") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.put_component_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.put_component_template.go index da9b8e520..0f400bc33 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.put_component_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.put_component_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newClusterPutComponentTemplateFunc(t Transport) ClusterPutComponentTemplate for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -63,16 +68,27 @@ type ClusterPutComponentTemplateRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ClusterPutComponentTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ClusterPutComponentTemplateRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.put_component_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_component_template") + 1 + len(r.Name)) @@ -81,6 +97,9 @@ func (r ClusterPutComponentTemplateRequest) Do(ctx context.Context, transport Tr path.WriteString("_component_template") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } params = make(map[string]string) @@ -114,6 +133,9 @@ func (r ClusterPutComponentTemplateRequest) Do(ctx context.Context, transport Tr req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -145,8 +167,20 @@ func (r ClusterPutComponentTemplateRequest) Do(ctx context.Context, transport Tr req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cluster.put_component_template") + if reader := instrument.RecordRequestBody(ctx, "cluster.put_component_template", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cluster.put_component_template") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.put_settings.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.put_settings.go index 48bb9515d..e83014f72 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.put_settings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.put_settings.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newClusterPutSettingsFunc(t Transport) ClusterPutSettings { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -61,16 +66,27 @@ type ClusterPutSettingsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ClusterPutSettingsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ClusterPutSettingsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.put_settings") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + len("/_cluster/settings")) @@ -109,6 +125,9 @@ func (r ClusterPutSettingsRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -140,8 +159,20 @@ func (r ClusterPutSettingsRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cluster.put_settings") + if reader := instrument.RecordRequestBody(ctx, "cluster.put_settings", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cluster.put_settings") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.remote_info.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.remote_info.go index bf27a1e1b..26e40816c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.remote_info.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.remote_info.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newClusterRemoteInfoFunc(t Transport) ClusterRemoteInfo { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type ClusterRemoteInfoRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ClusterRemoteInfoRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ClusterRemoteInfoRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.remote_info") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_remote/info")) @@ -88,6 +104,9 @@ func (r ClusterRemoteInfoRequest) Do(ctx context.Context, transport Transport) ( req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r ClusterRemoteInfoRequest) Do(ctx context.Context, transport Transport) ( req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cluster.remote_info") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cluster.remote_info") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.reroute.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.reroute.go index c8f75deea..ba59117f4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.reroute.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.reroute.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newClusterRerouteFunc(t Transport) ClusterReroute { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -64,16 +69,27 @@ type ClusterRerouteRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ClusterRerouteRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ClusterRerouteRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.reroute") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_cluster/reroute")) @@ -124,6 +140,9 @@ func (r ClusterRerouteRequest) Do(ctx context.Context, transport Transport) (*Re req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -155,8 +174,20 @@ func (r ClusterRerouteRequest) Do(ctx context.Context, transport Transport) (*Re req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cluster.reroute") + if reader := instrument.RecordRequestBody(ctx, "cluster.reroute", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cluster.reroute") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.state.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.state.go index 5c0ffb135..52de2fcbe 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.state.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.state.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newClusterStateFunc(t Transport) ClusterState { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -67,16 +72,27 @@ type ClusterStateRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ClusterStateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ClusterStateRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.state") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_cluster") + 1 + len("state") + 1 + len(strings.Join(r.Metric, ",")) + 1 + len(strings.Join(r.Index, ","))) @@ -88,10 +104,16 @@ func (r ClusterStateRequest) Do(ctx context.Context, transport Transport) (*Resp if len(r.Metric) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Metric, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "metric", strings.Join(r.Metric, ",")) + } } if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } } params = make(map[string]string) @@ -146,6 +168,9 @@ func (r ClusterStateRequest) Do(ctx context.Context, transport Transport) (*Resp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -173,8 +198,17 @@ func (r ClusterStateRequest) Do(ctx context.Context, transport Transport) (*Resp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cluster.state") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cluster.state") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.stats.go index b0a20a487..16f23731b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.cluster.stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newClusterStatsFunc(t Transport) ClusterStats { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -59,16 +64,27 @@ type ClusterStatsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ClusterStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ClusterStatsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(len("/nodes/_cluster/stats/nodes/") + len(strings.Join(r.NodeID, ","))) @@ -111,6 +127,9 @@ func (r ClusterStatsRequest) Do(ctx context.Context, transport Transport) (*Resp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -138,8 +157,17 @@ func (r ClusterStatsRequest) Do(ctx context.Context, transport Transport) (*Resp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cluster.stats") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cluster.stats") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.check_in.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.check_in.go new file mode 100644 index 000000000..0c7cc9411 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.check_in.go @@ -0,0 +1,227 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// +// Code generated from specification version 8.12.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newConnectorCheckInFunc(t Transport) ConnectorCheckIn { + return func(connector_id string, o ...func(*ConnectorCheckInRequest)) (*Response, error) { + var r = ConnectorCheckInRequest{ConnectorID: connector_id} + for _, f := range o { + f(&r) + } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// ConnectorCheckIn updates the last_seen timestamp in the connector document. +// +// This API is experimental. +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/check-in-connector-api.html. +type ConnectorCheckIn func(connector_id string, o ...func(*ConnectorCheckInRequest)) (*Response, error) + +// ConnectorCheckInRequest configures the Connector Check In API request. +type ConnectorCheckInRequest struct { + ConnectorID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context + + instrument Instrumentation +} + +// Do executes the request and returns response or error. +func (r ConnectorCheckInRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ctx context.Context + ) + + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "connector.check_in") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + method = "PUT" + + path.Grow(7 + 1 + len("_connector") + 1 + len(r.ConnectorID) + 1 + len("_check_in")) + path.WriteString("http://") + path.WriteString("/") + path.WriteString("_connector") + path.WriteString("/") + path.WriteString(r.ConnectorID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "connector_id", r.ConnectorID) + } + path.WriteString("/") + path.WriteString("_check_in") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), nil) + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "connector.check_in") + } + res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "connector.check_in") + } + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +func (f ConnectorCheckIn) WithContext(v context.Context) func(*ConnectorCheckInRequest) { + return func(r *ConnectorCheckInRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +func (f ConnectorCheckIn) WithPretty() func(*ConnectorCheckInRequest) { + return func(r *ConnectorCheckInRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +func (f ConnectorCheckIn) WithHuman() func(*ConnectorCheckInRequest) { + return func(r *ConnectorCheckInRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +func (f ConnectorCheckIn) WithErrorTrace() func(*ConnectorCheckInRequest) { + return func(r *ConnectorCheckInRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +func (f ConnectorCheckIn) WithFilterPath(v ...string) func(*ConnectorCheckInRequest) { + return func(r *ConnectorCheckInRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +func (f ConnectorCheckIn) WithHeader(h map[string]string) func(*ConnectorCheckInRequest) { + return func(r *ConnectorCheckInRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +func (f ConnectorCheckIn) WithOpaqueID(s string) func(*ConnectorCheckInRequest) { + return func(r *ConnectorCheckInRequest) { + 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/v8/esapi/api.connector.delete.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.delete.go new file mode 100644 index 000000000..0081d1dc5 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.delete.go @@ -0,0 +1,225 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// +// Code generated from specification version 8.12.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newConnectorDeleteFunc(t Transport) ConnectorDelete { + return func(connector_id string, o ...func(*ConnectorDeleteRequest)) (*Response, error) { + var r = ConnectorDeleteRequest{ConnectorID: connector_id} + for _, f := range o { + f(&r) + } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// ConnectorDelete deletes a connector. +// +// This API is experimental. +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-connector-api.html. +type ConnectorDelete func(connector_id string, o ...func(*ConnectorDeleteRequest)) (*Response, error) + +// ConnectorDeleteRequest configures the Connector Delete API request. +type ConnectorDeleteRequest struct { + ConnectorID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context + + instrument Instrumentation +} + +// Do executes the request and returns response or error. +func (r ConnectorDeleteRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ctx context.Context + ) + + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "connector.delete") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + method = "DELETE" + + path.Grow(7 + 1 + len("_connector") + 1 + len(r.ConnectorID)) + path.WriteString("http://") + path.WriteString("/") + path.WriteString("_connector") + path.WriteString("/") + path.WriteString(r.ConnectorID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "connector_id", r.ConnectorID) + } + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), nil) + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "connector.delete") + } + res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "connector.delete") + } + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +func (f ConnectorDelete) WithContext(v context.Context) func(*ConnectorDeleteRequest) { + return func(r *ConnectorDeleteRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +func (f ConnectorDelete) WithPretty() func(*ConnectorDeleteRequest) { + return func(r *ConnectorDeleteRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +func (f ConnectorDelete) WithHuman() func(*ConnectorDeleteRequest) { + return func(r *ConnectorDeleteRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +func (f ConnectorDelete) WithErrorTrace() func(*ConnectorDeleteRequest) { + return func(r *ConnectorDeleteRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +func (f ConnectorDelete) WithFilterPath(v ...string) func(*ConnectorDeleteRequest) { + return func(r *ConnectorDeleteRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +func (f ConnectorDelete) WithHeader(h map[string]string) func(*ConnectorDeleteRequest) { + return func(r *ConnectorDeleteRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +func (f ConnectorDelete) WithOpaqueID(s string) func(*ConnectorDeleteRequest) { + return func(r *ConnectorDeleteRequest) { + 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/v8/esapi/api.connector.get.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.get.go new file mode 100644 index 000000000..231f0db33 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.get.go @@ -0,0 +1,225 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// +// Code generated from specification version 8.12.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newConnectorGetFunc(t Transport) ConnectorGet { + return func(connector_id string, o ...func(*ConnectorGetRequest)) (*Response, error) { + var r = ConnectorGetRequest{ConnectorID: connector_id} + for _, f := range o { + f(&r) + } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// ConnectorGet returns the details about a connector. +// +// This API is experimental. +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/get-connector-api.html. +type ConnectorGet func(connector_id string, o ...func(*ConnectorGetRequest)) (*Response, error) + +// ConnectorGetRequest configures the Connector Get API request. +type ConnectorGetRequest struct { + ConnectorID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context + + instrument Instrumentation +} + +// Do executes the request and returns response or error. +func (r ConnectorGetRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ctx context.Context + ) + + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "connector.get") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + method = "GET" + + path.Grow(7 + 1 + len("_connector") + 1 + len(r.ConnectorID)) + path.WriteString("http://") + path.WriteString("/") + path.WriteString("_connector") + path.WriteString("/") + path.WriteString(r.ConnectorID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "connector_id", r.ConnectorID) + } + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), nil) + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "connector.get") + } + res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "connector.get") + } + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +func (f ConnectorGet) WithContext(v context.Context) func(*ConnectorGetRequest) { + return func(r *ConnectorGetRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +func (f ConnectorGet) WithPretty() func(*ConnectorGetRequest) { + return func(r *ConnectorGetRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +func (f ConnectorGet) WithHuman() func(*ConnectorGetRequest) { + return func(r *ConnectorGetRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +func (f ConnectorGet) WithErrorTrace() func(*ConnectorGetRequest) { + return func(r *ConnectorGetRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +func (f ConnectorGet) WithFilterPath(v ...string) func(*ConnectorGetRequest) { + return func(r *ConnectorGetRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +func (f ConnectorGet) WithHeader(h map[string]string) func(*ConnectorGetRequest) { + return func(r *ConnectorGetRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +func (f ConnectorGet) WithOpaqueID(s string) func(*ConnectorGetRequest) { + return func(r *ConnectorGetRequest) { + 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/v8/esapi/api.connector.last_sync.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.last_sync.go new file mode 100644 index 000000000..340a9fed1 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.last_sync.go @@ -0,0 +1,237 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// +// Code generated from specification version 8.12.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newConnectorLastSyncFunc(t Transport) ConnectorLastSync { + return func(body io.Reader, connector_id string, o ...func(*ConnectorLastSyncRequest)) (*Response, error) { + var r = ConnectorLastSyncRequest{Body: body, ConnectorID: connector_id} + for _, f := range o { + f(&r) + } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// ConnectorLastSync updates the stats of last sync in the connector document. +// +// This API is experimental. +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-last-sync-api.html. +type ConnectorLastSync func(body io.Reader, connector_id string, o ...func(*ConnectorLastSyncRequest)) (*Response, error) + +// ConnectorLastSyncRequest configures the Connector Last Sync API request. +type ConnectorLastSyncRequest struct { + Body io.Reader + + ConnectorID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context + + instrument Instrumentation +} + +// Do executes the request and returns response or error. +func (r ConnectorLastSyncRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ctx context.Context + ) + + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "connector.last_sync") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + method = "PUT" + + path.Grow(7 + 1 + len("_connector") + 1 + len(r.ConnectorID) + 1 + len("_last_sync")) + path.WriteString("http://") + path.WriteString("/") + path.WriteString("_connector") + path.WriteString("/") + path.WriteString(r.ConnectorID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "connector_id", r.ConnectorID) + } + path.WriteString("/") + path.WriteString("_last_sync") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if r.Body != nil && req.Header.Get(headerContentType) == "" { + req.Header[headerContentType] = headerContentTypeJSON + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "connector.last_sync") + if reader := instrument.RecordRequestBody(ctx, "connector.last_sync", r.Body); reader != nil { + req.Body = reader + } + } + res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "connector.last_sync") + } + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +func (f ConnectorLastSync) WithContext(v context.Context) func(*ConnectorLastSyncRequest) { + return func(r *ConnectorLastSyncRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +func (f ConnectorLastSync) WithPretty() func(*ConnectorLastSyncRequest) { + return func(r *ConnectorLastSyncRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +func (f ConnectorLastSync) WithHuman() func(*ConnectorLastSyncRequest) { + return func(r *ConnectorLastSyncRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +func (f ConnectorLastSync) WithErrorTrace() func(*ConnectorLastSyncRequest) { + return func(r *ConnectorLastSyncRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +func (f ConnectorLastSync) WithFilterPath(v ...string) func(*ConnectorLastSyncRequest) { + return func(r *ConnectorLastSyncRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +func (f ConnectorLastSync) WithHeader(h map[string]string) func(*ConnectorLastSyncRequest) { + return func(r *ConnectorLastSyncRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +func (f ConnectorLastSync) WithOpaqueID(s string) func(*ConnectorLastSyncRequest) { + return func(r *ConnectorLastSyncRequest) { + 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/v8/esapi/api.connector.list.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.list.go new file mode 100644 index 000000000..bc8b0c939 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.list.go @@ -0,0 +1,243 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// +// Code generated from specification version 8.12.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" +) + +func newConnectorListFunc(t Transport) ConnectorList { + return func(o ...func(*ConnectorListRequest)) (*Response, error) { + var r = ConnectorListRequest{} + for _, f := range o { + f(&r) + } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// ConnectorList lists all connectors. +// +// This API is experimental. +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/list-connector-api.html. +type ConnectorList func(o ...func(*ConnectorListRequest)) (*Response, error) + +// ConnectorListRequest configures the Connector List API request. +type ConnectorListRequest struct { + From *int + Size *int + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context + + instrument Instrumentation +} + +// Do executes the request and returns response or error. +func (r ConnectorListRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ctx context.Context + ) + + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "connector.list") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + method = "GET" + + path.Grow(7 + len("/_connector")) + path.WriteString("http://") + path.WriteString("/_connector") + + params = make(map[string]string) + + if r.From != nil { + params["from"] = strconv.FormatInt(int64(*r.From), 10) + } + + if r.Size != nil { + params["size"] = strconv.FormatInt(int64(*r.Size), 10) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), nil) + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "connector.list") + } + res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "connector.list") + } + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +func (f ConnectorList) WithContext(v context.Context) func(*ConnectorListRequest) { + return func(r *ConnectorListRequest) { + r.ctx = v + } +} + +// WithFrom - starting offset (default: 0). +func (f ConnectorList) WithFrom(v int) func(*ConnectorListRequest) { + return func(r *ConnectorListRequest) { + r.From = &v + } +} + +// WithSize - specifies a max number of results to get (default: 100). +func (f ConnectorList) WithSize(v int) func(*ConnectorListRequest) { + return func(r *ConnectorListRequest) { + r.Size = &v + } +} + +// WithPretty makes the response body pretty-printed. +func (f ConnectorList) WithPretty() func(*ConnectorListRequest) { + return func(r *ConnectorListRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +func (f ConnectorList) WithHuman() func(*ConnectorListRequest) { + return func(r *ConnectorListRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +func (f ConnectorList) WithErrorTrace() func(*ConnectorListRequest) { + return func(r *ConnectorListRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +func (f ConnectorList) WithFilterPath(v ...string) func(*ConnectorListRequest) { + return func(r *ConnectorListRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +func (f ConnectorList) WithHeader(h map[string]string) func(*ConnectorListRequest) { + return func(r *ConnectorListRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +func (f ConnectorList) WithOpaqueID(s string) func(*ConnectorListRequest) { + return func(r *ConnectorListRequest) { + 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/v8/esapi/api.connector.post.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.post.go new file mode 100644 index 000000000..039ea9fe3 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.post.go @@ -0,0 +1,227 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// +// Code generated from specification version 8.12.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newConnectorPostFunc(t Transport) ConnectorPost { + return func(body io.Reader, o ...func(*ConnectorPostRequest)) (*Response, error) { + var r = ConnectorPostRequest{Body: body} + for _, f := range o { + f(&r) + } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// ConnectorPost creates a connector. +// +// This API is experimental. +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/create-connector-api.html. +type ConnectorPost func(body io.Reader, o ...func(*ConnectorPostRequest)) (*Response, error) + +// ConnectorPostRequest configures the Connector Post API request. +type ConnectorPostRequest struct { + Body io.Reader + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context + + instrument Instrumentation +} + +// Do executes the request and returns response or error. +func (r ConnectorPostRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ctx context.Context + ) + + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "connector.post") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + method = "POST" + + path.Grow(7 + len("/_connector")) + path.WriteString("http://") + path.WriteString("/_connector") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if r.Body != nil && req.Header.Get(headerContentType) == "" { + req.Header[headerContentType] = headerContentTypeJSON + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "connector.post") + if reader := instrument.RecordRequestBody(ctx, "connector.post", r.Body); reader != nil { + req.Body = reader + } + } + res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "connector.post") + } + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +func (f ConnectorPost) WithContext(v context.Context) func(*ConnectorPostRequest) { + return func(r *ConnectorPostRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +func (f ConnectorPost) WithPretty() func(*ConnectorPostRequest) { + return func(r *ConnectorPostRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +func (f ConnectorPost) WithHuman() func(*ConnectorPostRequest) { + return func(r *ConnectorPostRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +func (f ConnectorPost) WithErrorTrace() func(*ConnectorPostRequest) { + return func(r *ConnectorPostRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +func (f ConnectorPost) WithFilterPath(v ...string) func(*ConnectorPostRequest) { + return func(r *ConnectorPostRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +func (f ConnectorPost) WithHeader(h map[string]string) func(*ConnectorPostRequest) { + return func(r *ConnectorPostRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +func (f ConnectorPost) WithOpaqueID(s string) func(*ConnectorPostRequest) { + return func(r *ConnectorPostRequest) { + 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/v8/esapi/api.connector.put.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.put.go new file mode 100644 index 000000000..51b415566 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.put.go @@ -0,0 +1,235 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// +// Code generated from specification version 8.12.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newConnectorPutFunc(t Transport) ConnectorPut { + return func(body io.Reader, connector_id string, o ...func(*ConnectorPutRequest)) (*Response, error) { + var r = ConnectorPutRequest{Body: body, ConnectorID: connector_id} + for _, f := range o { + f(&r) + } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// ConnectorPut creates or updates a connector. +// +// This API is experimental. +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/create-connector-api.html. +type ConnectorPut func(body io.Reader, connector_id string, o ...func(*ConnectorPutRequest)) (*Response, error) + +// ConnectorPutRequest configures the Connector Put API request. +type ConnectorPutRequest struct { + Body io.Reader + + ConnectorID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context + + instrument Instrumentation +} + +// Do executes the request and returns response or error. +func (r ConnectorPutRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ctx context.Context + ) + + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "connector.put") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + method = "PUT" + + path.Grow(7 + 1 + len("_connector") + 1 + len(r.ConnectorID)) + path.WriteString("http://") + path.WriteString("/") + path.WriteString("_connector") + path.WriteString("/") + path.WriteString(r.ConnectorID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "connector_id", r.ConnectorID) + } + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if r.Body != nil && req.Header.Get(headerContentType) == "" { + req.Header[headerContentType] = headerContentTypeJSON + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "connector.put") + if reader := instrument.RecordRequestBody(ctx, "connector.put", r.Body); reader != nil { + req.Body = reader + } + } + res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "connector.put") + } + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +func (f ConnectorPut) WithContext(v context.Context) func(*ConnectorPutRequest) { + return func(r *ConnectorPutRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +func (f ConnectorPut) WithPretty() func(*ConnectorPutRequest) { + return func(r *ConnectorPutRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +func (f ConnectorPut) WithHuman() func(*ConnectorPutRequest) { + return func(r *ConnectorPutRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +func (f ConnectorPut) WithErrorTrace() func(*ConnectorPutRequest) { + return func(r *ConnectorPutRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +func (f ConnectorPut) WithFilterPath(v ...string) func(*ConnectorPutRequest) { + return func(r *ConnectorPutRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +func (f ConnectorPut) WithHeader(h map[string]string) func(*ConnectorPutRequest) { + return func(r *ConnectorPutRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +func (f ConnectorPut) WithOpaqueID(s string) func(*ConnectorPutRequest) { + return func(r *ConnectorPutRequest) { + 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/v8/esapi/api.connector.update_configuration.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.update_configuration.go new file mode 100644 index 000000000..9082be76f --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.update_configuration.go @@ -0,0 +1,237 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// +// Code generated from specification version 8.12.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newConnectorUpdateConfigurationFunc(t Transport) ConnectorUpdateConfiguration { + return func(body io.Reader, connector_id string, o ...func(*ConnectorUpdateConfigurationRequest)) (*Response, error) { + var r = ConnectorUpdateConfigurationRequest{Body: body, ConnectorID: connector_id} + for _, f := range o { + f(&r) + } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// ConnectorUpdateConfiguration updates the connector configuration. +// +// This API is experimental. +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-configuration-api.html. +type ConnectorUpdateConfiguration func(body io.Reader, connector_id string, o ...func(*ConnectorUpdateConfigurationRequest)) (*Response, error) + +// ConnectorUpdateConfigurationRequest configures the Connector Update Configuration API request. +type ConnectorUpdateConfigurationRequest struct { + Body io.Reader + + ConnectorID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context + + instrument Instrumentation +} + +// Do executes the request and returns response or error. +func (r ConnectorUpdateConfigurationRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ctx context.Context + ) + + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "connector.update_configuration") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + method = "PUT" + + path.Grow(7 + 1 + len("_connector") + 1 + len(r.ConnectorID) + 1 + len("_configuration")) + path.WriteString("http://") + path.WriteString("/") + path.WriteString("_connector") + path.WriteString("/") + path.WriteString(r.ConnectorID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "connector_id", r.ConnectorID) + } + path.WriteString("/") + path.WriteString("_configuration") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if r.Body != nil && req.Header.Get(headerContentType) == "" { + req.Header[headerContentType] = headerContentTypeJSON + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "connector.update_configuration") + if reader := instrument.RecordRequestBody(ctx, "connector.update_configuration", r.Body); reader != nil { + req.Body = reader + } + } + res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "connector.update_configuration") + } + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +func (f ConnectorUpdateConfiguration) WithContext(v context.Context) func(*ConnectorUpdateConfigurationRequest) { + return func(r *ConnectorUpdateConfigurationRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +func (f ConnectorUpdateConfiguration) WithPretty() func(*ConnectorUpdateConfigurationRequest) { + return func(r *ConnectorUpdateConfigurationRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +func (f ConnectorUpdateConfiguration) WithHuman() func(*ConnectorUpdateConfigurationRequest) { + return func(r *ConnectorUpdateConfigurationRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +func (f ConnectorUpdateConfiguration) WithErrorTrace() func(*ConnectorUpdateConfigurationRequest) { + return func(r *ConnectorUpdateConfigurationRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +func (f ConnectorUpdateConfiguration) WithFilterPath(v ...string) func(*ConnectorUpdateConfigurationRequest) { + return func(r *ConnectorUpdateConfigurationRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +func (f ConnectorUpdateConfiguration) WithHeader(h map[string]string) func(*ConnectorUpdateConfigurationRequest) { + return func(r *ConnectorUpdateConfigurationRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +func (f ConnectorUpdateConfiguration) WithOpaqueID(s string) func(*ConnectorUpdateConfigurationRequest) { + return func(r *ConnectorUpdateConfigurationRequest) { + 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/v8/esapi/api.connector.update_error.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.update_error.go new file mode 100644 index 000000000..0a078a6b4 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.update_error.go @@ -0,0 +1,237 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// +// Code generated from specification version 8.12.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newConnectorUpdateErrorFunc(t Transport) ConnectorUpdateError { + return func(body io.Reader, connector_id string, o ...func(*ConnectorUpdateErrorRequest)) (*Response, error) { + var r = ConnectorUpdateErrorRequest{Body: body, ConnectorID: connector_id} + for _, f := range o { + f(&r) + } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// ConnectorUpdateError updates the error field in the connector document. +// +// This API is experimental. +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-error-api.html. +type ConnectorUpdateError func(body io.Reader, connector_id string, o ...func(*ConnectorUpdateErrorRequest)) (*Response, error) + +// ConnectorUpdateErrorRequest configures the Connector Update Error API request. +type ConnectorUpdateErrorRequest struct { + Body io.Reader + + ConnectorID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context + + instrument Instrumentation +} + +// Do executes the request and returns response or error. +func (r ConnectorUpdateErrorRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ctx context.Context + ) + + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "connector.update_error") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + method = "PUT" + + path.Grow(7 + 1 + len("_connector") + 1 + len(r.ConnectorID) + 1 + len("_error")) + path.WriteString("http://") + path.WriteString("/") + path.WriteString("_connector") + path.WriteString("/") + path.WriteString(r.ConnectorID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "connector_id", r.ConnectorID) + } + path.WriteString("/") + path.WriteString("_error") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if r.Body != nil && req.Header.Get(headerContentType) == "" { + req.Header[headerContentType] = headerContentTypeJSON + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "connector.update_error") + if reader := instrument.RecordRequestBody(ctx, "connector.update_error", r.Body); reader != nil { + req.Body = reader + } + } + res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "connector.update_error") + } + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +func (f ConnectorUpdateError) WithContext(v context.Context) func(*ConnectorUpdateErrorRequest) { + return func(r *ConnectorUpdateErrorRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +func (f ConnectorUpdateError) WithPretty() func(*ConnectorUpdateErrorRequest) { + return func(r *ConnectorUpdateErrorRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +func (f ConnectorUpdateError) WithHuman() func(*ConnectorUpdateErrorRequest) { + return func(r *ConnectorUpdateErrorRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +func (f ConnectorUpdateError) WithErrorTrace() func(*ConnectorUpdateErrorRequest) { + return func(r *ConnectorUpdateErrorRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +func (f ConnectorUpdateError) WithFilterPath(v ...string) func(*ConnectorUpdateErrorRequest) { + return func(r *ConnectorUpdateErrorRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +func (f ConnectorUpdateError) WithHeader(h map[string]string) func(*ConnectorUpdateErrorRequest) { + return func(r *ConnectorUpdateErrorRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +func (f ConnectorUpdateError) WithOpaqueID(s string) func(*ConnectorUpdateErrorRequest) { + return func(r *ConnectorUpdateErrorRequest) { + 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/v8/esapi/api.connector.update_filtering.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.update_filtering.go new file mode 100644 index 000000000..ef4014f39 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.update_filtering.go @@ -0,0 +1,237 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// +// Code generated from specification version 8.12.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newConnectorUpdateFilteringFunc(t Transport) ConnectorUpdateFiltering { + return func(body io.Reader, connector_id string, o ...func(*ConnectorUpdateFilteringRequest)) (*Response, error) { + var r = ConnectorUpdateFilteringRequest{Body: body, ConnectorID: connector_id} + for _, f := range o { + f(&r) + } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// ConnectorUpdateFiltering updates the filtering field in the connector document. +// +// This API is experimental. +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-filtering-api.html. +type ConnectorUpdateFiltering func(body io.Reader, connector_id string, o ...func(*ConnectorUpdateFilteringRequest)) (*Response, error) + +// ConnectorUpdateFilteringRequest configures the Connector Update Filtering API request. +type ConnectorUpdateFilteringRequest struct { + Body io.Reader + + ConnectorID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context + + instrument Instrumentation +} + +// Do executes the request and returns response or error. +func (r ConnectorUpdateFilteringRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ctx context.Context + ) + + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "connector.update_filtering") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + method = "PUT" + + path.Grow(7 + 1 + len("_connector") + 1 + len(r.ConnectorID) + 1 + len("_filtering")) + path.WriteString("http://") + path.WriteString("/") + path.WriteString("_connector") + path.WriteString("/") + path.WriteString(r.ConnectorID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "connector_id", r.ConnectorID) + } + path.WriteString("/") + path.WriteString("_filtering") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if r.Body != nil && req.Header.Get(headerContentType) == "" { + req.Header[headerContentType] = headerContentTypeJSON + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "connector.update_filtering") + if reader := instrument.RecordRequestBody(ctx, "connector.update_filtering", r.Body); reader != nil { + req.Body = reader + } + } + res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "connector.update_filtering") + } + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +func (f ConnectorUpdateFiltering) WithContext(v context.Context) func(*ConnectorUpdateFilteringRequest) { + return func(r *ConnectorUpdateFilteringRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +func (f ConnectorUpdateFiltering) WithPretty() func(*ConnectorUpdateFilteringRequest) { + return func(r *ConnectorUpdateFilteringRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +func (f ConnectorUpdateFiltering) WithHuman() func(*ConnectorUpdateFilteringRequest) { + return func(r *ConnectorUpdateFilteringRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +func (f ConnectorUpdateFiltering) WithErrorTrace() func(*ConnectorUpdateFilteringRequest) { + return func(r *ConnectorUpdateFilteringRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +func (f ConnectorUpdateFiltering) WithFilterPath(v ...string) func(*ConnectorUpdateFilteringRequest) { + return func(r *ConnectorUpdateFilteringRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +func (f ConnectorUpdateFiltering) WithHeader(h map[string]string) func(*ConnectorUpdateFilteringRequest) { + return func(r *ConnectorUpdateFilteringRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +func (f ConnectorUpdateFiltering) WithOpaqueID(s string) func(*ConnectorUpdateFilteringRequest) { + return func(r *ConnectorUpdateFilteringRequest) { + 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/v8/esapi/api.connector.update_name.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.update_name.go new file mode 100644 index 000000000..0ba9e136e --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.update_name.go @@ -0,0 +1,237 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// +// Code generated from specification version 8.12.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newConnectorUpdateNameFunc(t Transport) ConnectorUpdateName { + return func(body io.Reader, connector_id string, o ...func(*ConnectorUpdateNameRequest)) (*Response, error) { + var r = ConnectorUpdateNameRequest{Body: body, ConnectorID: connector_id} + for _, f := range o { + f(&r) + } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// ConnectorUpdateName updates the name and/or description fields in the connector document. +// +// This API is experimental. +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-name-description-api.html. +type ConnectorUpdateName func(body io.Reader, connector_id string, o ...func(*ConnectorUpdateNameRequest)) (*Response, error) + +// ConnectorUpdateNameRequest configures the Connector Update Name API request. +type ConnectorUpdateNameRequest struct { + Body io.Reader + + ConnectorID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context + + instrument Instrumentation +} + +// Do executes the request and returns response or error. +func (r ConnectorUpdateNameRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ctx context.Context + ) + + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "connector.update_name") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + method = "PUT" + + path.Grow(7 + 1 + len("_connector") + 1 + len(r.ConnectorID) + 1 + len("_name")) + path.WriteString("http://") + path.WriteString("/") + path.WriteString("_connector") + path.WriteString("/") + path.WriteString(r.ConnectorID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "connector_id", r.ConnectorID) + } + path.WriteString("/") + path.WriteString("_name") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if r.Body != nil && req.Header.Get(headerContentType) == "" { + req.Header[headerContentType] = headerContentTypeJSON + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "connector.update_name") + if reader := instrument.RecordRequestBody(ctx, "connector.update_name", r.Body); reader != nil { + req.Body = reader + } + } + res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "connector.update_name") + } + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +func (f ConnectorUpdateName) WithContext(v context.Context) func(*ConnectorUpdateNameRequest) { + return func(r *ConnectorUpdateNameRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +func (f ConnectorUpdateName) WithPretty() func(*ConnectorUpdateNameRequest) { + return func(r *ConnectorUpdateNameRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +func (f ConnectorUpdateName) WithHuman() func(*ConnectorUpdateNameRequest) { + return func(r *ConnectorUpdateNameRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +func (f ConnectorUpdateName) WithErrorTrace() func(*ConnectorUpdateNameRequest) { + return func(r *ConnectorUpdateNameRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +func (f ConnectorUpdateName) WithFilterPath(v ...string) func(*ConnectorUpdateNameRequest) { + return func(r *ConnectorUpdateNameRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +func (f ConnectorUpdateName) WithHeader(h map[string]string) func(*ConnectorUpdateNameRequest) { + return func(r *ConnectorUpdateNameRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +func (f ConnectorUpdateName) WithOpaqueID(s string) func(*ConnectorUpdateNameRequest) { + return func(r *ConnectorUpdateNameRequest) { + 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/v8/esapi/api.connector.update_pipeline.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.update_pipeline.go new file mode 100644 index 000000000..b165a1913 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.update_pipeline.go @@ -0,0 +1,237 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// +// Code generated from specification version 8.12.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newConnectorUpdatePipelineFunc(t Transport) ConnectorUpdatePipeline { + return func(body io.Reader, connector_id string, o ...func(*ConnectorUpdatePipelineRequest)) (*Response, error) { + var r = ConnectorUpdatePipelineRequest{Body: body, ConnectorID: connector_id} + for _, f := range o { + f(&r) + } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// ConnectorUpdatePipeline updates the pipeline field in the connector document. +// +// This API is experimental. +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-pipeline-api.html. +type ConnectorUpdatePipeline func(body io.Reader, connector_id string, o ...func(*ConnectorUpdatePipelineRequest)) (*Response, error) + +// ConnectorUpdatePipelineRequest configures the Connector Update Pipeline API request. +type ConnectorUpdatePipelineRequest struct { + Body io.Reader + + ConnectorID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context + + instrument Instrumentation +} + +// Do executes the request and returns response or error. +func (r ConnectorUpdatePipelineRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ctx context.Context + ) + + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "connector.update_pipeline") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + method = "PUT" + + path.Grow(7 + 1 + len("_connector") + 1 + len(r.ConnectorID) + 1 + len("_pipeline")) + path.WriteString("http://") + path.WriteString("/") + path.WriteString("_connector") + path.WriteString("/") + path.WriteString(r.ConnectorID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "connector_id", r.ConnectorID) + } + path.WriteString("/") + path.WriteString("_pipeline") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if r.Body != nil && req.Header.Get(headerContentType) == "" { + req.Header[headerContentType] = headerContentTypeJSON + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "connector.update_pipeline") + if reader := instrument.RecordRequestBody(ctx, "connector.update_pipeline", r.Body); reader != nil { + req.Body = reader + } + } + res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "connector.update_pipeline") + } + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +func (f ConnectorUpdatePipeline) WithContext(v context.Context) func(*ConnectorUpdatePipelineRequest) { + return func(r *ConnectorUpdatePipelineRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +func (f ConnectorUpdatePipeline) WithPretty() func(*ConnectorUpdatePipelineRequest) { + return func(r *ConnectorUpdatePipelineRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +func (f ConnectorUpdatePipeline) WithHuman() func(*ConnectorUpdatePipelineRequest) { + return func(r *ConnectorUpdatePipelineRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +func (f ConnectorUpdatePipeline) WithErrorTrace() func(*ConnectorUpdatePipelineRequest) { + return func(r *ConnectorUpdatePipelineRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +func (f ConnectorUpdatePipeline) WithFilterPath(v ...string) func(*ConnectorUpdatePipelineRequest) { + return func(r *ConnectorUpdatePipelineRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +func (f ConnectorUpdatePipeline) WithHeader(h map[string]string) func(*ConnectorUpdatePipelineRequest) { + return func(r *ConnectorUpdatePipelineRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +func (f ConnectorUpdatePipeline) WithOpaqueID(s string) func(*ConnectorUpdatePipelineRequest) { + return func(r *ConnectorUpdatePipelineRequest) { + 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/v8/esapi/api.connector.update_scheduling.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.update_scheduling.go new file mode 100644 index 000000000..90dcc2715 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector.update_scheduling.go @@ -0,0 +1,237 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// +// Code generated from specification version 8.12.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newConnectorUpdateSchedulingFunc(t Transport) ConnectorUpdateScheduling { + return func(body io.Reader, connector_id string, o ...func(*ConnectorUpdateSchedulingRequest)) (*Response, error) { + var r = ConnectorUpdateSchedulingRequest{Body: body, ConnectorID: connector_id} + for _, f := range o { + f(&r) + } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// ConnectorUpdateScheduling updates the scheduling field in the connector document. +// +// This API is experimental. +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-scheduling-api.html. +type ConnectorUpdateScheduling func(body io.Reader, connector_id string, o ...func(*ConnectorUpdateSchedulingRequest)) (*Response, error) + +// ConnectorUpdateSchedulingRequest configures the Connector Update Scheduling API request. +type ConnectorUpdateSchedulingRequest struct { + Body io.Reader + + ConnectorID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context + + instrument Instrumentation +} + +// Do executes the request and returns response or error. +func (r ConnectorUpdateSchedulingRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ctx context.Context + ) + + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "connector.update_scheduling") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + method = "PUT" + + path.Grow(7 + 1 + len("_connector") + 1 + len(r.ConnectorID) + 1 + len("_scheduling")) + path.WriteString("http://") + path.WriteString("/") + path.WriteString("_connector") + path.WriteString("/") + path.WriteString(r.ConnectorID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "connector_id", r.ConnectorID) + } + path.WriteString("/") + path.WriteString("_scheduling") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if r.Body != nil && req.Header.Get(headerContentType) == "" { + req.Header[headerContentType] = headerContentTypeJSON + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "connector.update_scheduling") + if reader := instrument.RecordRequestBody(ctx, "connector.update_scheduling", r.Body); reader != nil { + req.Body = reader + } + } + res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "connector.update_scheduling") + } + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +func (f ConnectorUpdateScheduling) WithContext(v context.Context) func(*ConnectorUpdateSchedulingRequest) { + return func(r *ConnectorUpdateSchedulingRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +func (f ConnectorUpdateScheduling) WithPretty() func(*ConnectorUpdateSchedulingRequest) { + return func(r *ConnectorUpdateSchedulingRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +func (f ConnectorUpdateScheduling) WithHuman() func(*ConnectorUpdateSchedulingRequest) { + return func(r *ConnectorUpdateSchedulingRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +func (f ConnectorUpdateScheduling) WithErrorTrace() func(*ConnectorUpdateSchedulingRequest) { + return func(r *ConnectorUpdateSchedulingRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +func (f ConnectorUpdateScheduling) WithFilterPath(v ...string) func(*ConnectorUpdateSchedulingRequest) { + return func(r *ConnectorUpdateSchedulingRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +func (f ConnectorUpdateScheduling) WithHeader(h map[string]string) func(*ConnectorUpdateSchedulingRequest) { + return func(r *ConnectorUpdateSchedulingRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +func (f ConnectorUpdateScheduling) WithOpaqueID(s string) func(*ConnectorUpdateSchedulingRequest) { + return func(r *ConnectorUpdateSchedulingRequest) { + 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/v8/esapi/api.connector_sync_job.cancel.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector_sync_job.cancel.go new file mode 100644 index 000000000..f7a5e99bd --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector_sync_job.cancel.go @@ -0,0 +1,229 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// +// Code generated from specification version 8.12.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newConnectorSyncJobCancelFunc(t Transport) ConnectorSyncJobCancel { + return func(connector_sync_job_id string, o ...func(*ConnectorSyncJobCancelRequest)) (*Response, error) { + var r = ConnectorSyncJobCancelRequest{ConnectorSyncJobID: connector_sync_job_id} + for _, f := range o { + f(&r) + } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// ConnectorSyncJobCancel cancels a connector sync job. +// +// This API is experimental. +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cancel-connector-sync-job-api.html. +type ConnectorSyncJobCancel func(connector_sync_job_id string, o ...func(*ConnectorSyncJobCancelRequest)) (*Response, error) + +// ConnectorSyncJobCancelRequest configures the Connector Sync Job Cancel API request. +type ConnectorSyncJobCancelRequest struct { + ConnectorSyncJobID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context + + instrument Instrumentation +} + +// Do executes the request and returns response or error. +func (r ConnectorSyncJobCancelRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ctx context.Context + ) + + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "connector_sync_job.cancel") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + method = "PUT" + + path.Grow(7 + 1 + len("_connector") + 1 + len("_sync_job") + 1 + len(r.ConnectorSyncJobID) + 1 + len("_cancel")) + path.WriteString("http://") + path.WriteString("/") + path.WriteString("_connector") + path.WriteString("/") + path.WriteString("_sync_job") + path.WriteString("/") + path.WriteString(r.ConnectorSyncJobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "connector_sync_job_id", r.ConnectorSyncJobID) + } + path.WriteString("/") + path.WriteString("_cancel") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), nil) + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "connector_sync_job.cancel") + } + res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "connector_sync_job.cancel") + } + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +func (f ConnectorSyncJobCancel) WithContext(v context.Context) func(*ConnectorSyncJobCancelRequest) { + return func(r *ConnectorSyncJobCancelRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +func (f ConnectorSyncJobCancel) WithPretty() func(*ConnectorSyncJobCancelRequest) { + return func(r *ConnectorSyncJobCancelRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +func (f ConnectorSyncJobCancel) WithHuman() func(*ConnectorSyncJobCancelRequest) { + return func(r *ConnectorSyncJobCancelRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +func (f ConnectorSyncJobCancel) WithErrorTrace() func(*ConnectorSyncJobCancelRequest) { + return func(r *ConnectorSyncJobCancelRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +func (f ConnectorSyncJobCancel) WithFilterPath(v ...string) func(*ConnectorSyncJobCancelRequest) { + return func(r *ConnectorSyncJobCancelRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +func (f ConnectorSyncJobCancel) WithHeader(h map[string]string) func(*ConnectorSyncJobCancelRequest) { + return func(r *ConnectorSyncJobCancelRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +func (f ConnectorSyncJobCancel) WithOpaqueID(s string) func(*ConnectorSyncJobCancelRequest) { + return func(r *ConnectorSyncJobCancelRequest) { + 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/v8/esapi/api.connector_sync_job.check_in.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector_sync_job.check_in.go new file mode 100644 index 000000000..d8ebc7d6a --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector_sync_job.check_in.go @@ -0,0 +1,229 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// +// Code generated from specification version 8.12.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newConnectorSyncJobCheckInFunc(t Transport) ConnectorSyncJobCheckIn { + return func(connector_sync_job_id string, o ...func(*ConnectorSyncJobCheckInRequest)) (*Response, error) { + var r = ConnectorSyncJobCheckInRequest{ConnectorSyncJobID: connector_sync_job_id} + for _, f := range o { + f(&r) + } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// ConnectorSyncJobCheckIn checks in a connector sync job (refreshes 'last_seen'). +// +// This API is experimental. +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/check-in-connector-sync-job-api.html. +type ConnectorSyncJobCheckIn func(connector_sync_job_id string, o ...func(*ConnectorSyncJobCheckInRequest)) (*Response, error) + +// ConnectorSyncJobCheckInRequest configures the Connector Sync Job Check In API request. +type ConnectorSyncJobCheckInRequest struct { + ConnectorSyncJobID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context + + instrument Instrumentation +} + +// Do executes the request and returns response or error. +func (r ConnectorSyncJobCheckInRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ctx context.Context + ) + + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "connector_sync_job.check_in") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + method = "PUT" + + path.Grow(7 + 1 + len("_connector") + 1 + len("_sync_job") + 1 + len(r.ConnectorSyncJobID) + 1 + len("_check_in")) + path.WriteString("http://") + path.WriteString("/") + path.WriteString("_connector") + path.WriteString("/") + path.WriteString("_sync_job") + path.WriteString("/") + path.WriteString(r.ConnectorSyncJobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "connector_sync_job_id", r.ConnectorSyncJobID) + } + path.WriteString("/") + path.WriteString("_check_in") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), nil) + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "connector_sync_job.check_in") + } + res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "connector_sync_job.check_in") + } + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +func (f ConnectorSyncJobCheckIn) WithContext(v context.Context) func(*ConnectorSyncJobCheckInRequest) { + return func(r *ConnectorSyncJobCheckInRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +func (f ConnectorSyncJobCheckIn) WithPretty() func(*ConnectorSyncJobCheckInRequest) { + return func(r *ConnectorSyncJobCheckInRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +func (f ConnectorSyncJobCheckIn) WithHuman() func(*ConnectorSyncJobCheckInRequest) { + return func(r *ConnectorSyncJobCheckInRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +func (f ConnectorSyncJobCheckIn) WithErrorTrace() func(*ConnectorSyncJobCheckInRequest) { + return func(r *ConnectorSyncJobCheckInRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +func (f ConnectorSyncJobCheckIn) WithFilterPath(v ...string) func(*ConnectorSyncJobCheckInRequest) { + return func(r *ConnectorSyncJobCheckInRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +func (f ConnectorSyncJobCheckIn) WithHeader(h map[string]string) func(*ConnectorSyncJobCheckInRequest) { + return func(r *ConnectorSyncJobCheckInRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +func (f ConnectorSyncJobCheckIn) WithOpaqueID(s string) func(*ConnectorSyncJobCheckInRequest) { + return func(r *ConnectorSyncJobCheckInRequest) { + 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/v8/esapi/api.connector_sync_job.delete.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector_sync_job.delete.go new file mode 100644 index 000000000..358f57ab2 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector_sync_job.delete.go @@ -0,0 +1,227 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// +// Code generated from specification version 8.12.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newConnectorSyncJobDeleteFunc(t Transport) ConnectorSyncJobDelete { + return func(connector_sync_job_id string, o ...func(*ConnectorSyncJobDeleteRequest)) (*Response, error) { + var r = ConnectorSyncJobDeleteRequest{ConnectorSyncJobID: connector_sync_job_id} + for _, f := range o { + f(&r) + } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// ConnectorSyncJobDelete deletes a connector sync job. +// +// This API is experimental. +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-connector-sync-job-api.html. +type ConnectorSyncJobDelete func(connector_sync_job_id string, o ...func(*ConnectorSyncJobDeleteRequest)) (*Response, error) + +// ConnectorSyncJobDeleteRequest configures the Connector Sync Job Delete API request. +type ConnectorSyncJobDeleteRequest struct { + ConnectorSyncJobID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context + + instrument Instrumentation +} + +// Do executes the request and returns response or error. +func (r ConnectorSyncJobDeleteRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ctx context.Context + ) + + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "connector_sync_job.delete") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + method = "DELETE" + + path.Grow(7 + 1 + len("_connector") + 1 + len("_sync_job") + 1 + len(r.ConnectorSyncJobID)) + path.WriteString("http://") + path.WriteString("/") + path.WriteString("_connector") + path.WriteString("/") + path.WriteString("_sync_job") + path.WriteString("/") + path.WriteString(r.ConnectorSyncJobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "connector_sync_job_id", r.ConnectorSyncJobID) + } + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), nil) + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "connector_sync_job.delete") + } + res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "connector_sync_job.delete") + } + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +func (f ConnectorSyncJobDelete) WithContext(v context.Context) func(*ConnectorSyncJobDeleteRequest) { + return func(r *ConnectorSyncJobDeleteRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +func (f ConnectorSyncJobDelete) WithPretty() func(*ConnectorSyncJobDeleteRequest) { + return func(r *ConnectorSyncJobDeleteRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +func (f ConnectorSyncJobDelete) WithHuman() func(*ConnectorSyncJobDeleteRequest) { + return func(r *ConnectorSyncJobDeleteRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +func (f ConnectorSyncJobDelete) WithErrorTrace() func(*ConnectorSyncJobDeleteRequest) { + return func(r *ConnectorSyncJobDeleteRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +func (f ConnectorSyncJobDelete) WithFilterPath(v ...string) func(*ConnectorSyncJobDeleteRequest) { + return func(r *ConnectorSyncJobDeleteRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +func (f ConnectorSyncJobDelete) WithHeader(h map[string]string) func(*ConnectorSyncJobDeleteRequest) { + return func(r *ConnectorSyncJobDeleteRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +func (f ConnectorSyncJobDelete) WithOpaqueID(s string) func(*ConnectorSyncJobDeleteRequest) { + return func(r *ConnectorSyncJobDeleteRequest) { + 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/v8/esapi/api.connector_sync_job.error.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector_sync_job.error.go new file mode 100644 index 000000000..5883f59d6 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector_sync_job.error.go @@ -0,0 +1,239 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// +// Code generated from specification version 8.12.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newConnectorSyncJobErrorFunc(t Transport) ConnectorSyncJobError { + return func(body io.Reader, connector_sync_job_id string, o ...func(*ConnectorSyncJobErrorRequest)) (*Response, error) { + var r = ConnectorSyncJobErrorRequest{Body: body, ConnectorSyncJobID: connector_sync_job_id} + for _, f := range o { + f(&r) + } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// ConnectorSyncJobError sets an error for a connector sync job. +// +// This API is experimental. +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/set-connector-sync-job-error-api.html. +type ConnectorSyncJobError func(body io.Reader, connector_sync_job_id string, o ...func(*ConnectorSyncJobErrorRequest)) (*Response, error) + +// ConnectorSyncJobErrorRequest configures the Connector Sync Job Error API request. +type ConnectorSyncJobErrorRequest struct { + Body io.Reader + + ConnectorSyncJobID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context + + instrument Instrumentation +} + +// Do executes the request and returns response or error. +func (r ConnectorSyncJobErrorRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ctx context.Context + ) + + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "connector_sync_job.error") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + method = "PUT" + + path.Grow(7 + 1 + len("_connector") + 1 + len("_sync_job") + 1 + len(r.ConnectorSyncJobID) + 1 + len("_error")) + path.WriteString("http://") + path.WriteString("/") + path.WriteString("_connector") + path.WriteString("/") + path.WriteString("_sync_job") + path.WriteString("/") + path.WriteString(r.ConnectorSyncJobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "connector_sync_job_id", r.ConnectorSyncJobID) + } + path.WriteString("/") + path.WriteString("_error") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if r.Body != nil && req.Header.Get(headerContentType) == "" { + req.Header[headerContentType] = headerContentTypeJSON + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "connector_sync_job.error") + if reader := instrument.RecordRequestBody(ctx, "connector_sync_job.error", r.Body); reader != nil { + req.Body = reader + } + } + res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "connector_sync_job.error") + } + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +func (f ConnectorSyncJobError) WithContext(v context.Context) func(*ConnectorSyncJobErrorRequest) { + return func(r *ConnectorSyncJobErrorRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +func (f ConnectorSyncJobError) WithPretty() func(*ConnectorSyncJobErrorRequest) { + return func(r *ConnectorSyncJobErrorRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +func (f ConnectorSyncJobError) WithHuman() func(*ConnectorSyncJobErrorRequest) { + return func(r *ConnectorSyncJobErrorRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +func (f ConnectorSyncJobError) WithErrorTrace() func(*ConnectorSyncJobErrorRequest) { + return func(r *ConnectorSyncJobErrorRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +func (f ConnectorSyncJobError) WithFilterPath(v ...string) func(*ConnectorSyncJobErrorRequest) { + return func(r *ConnectorSyncJobErrorRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +func (f ConnectorSyncJobError) WithHeader(h map[string]string) func(*ConnectorSyncJobErrorRequest) { + return func(r *ConnectorSyncJobErrorRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +func (f ConnectorSyncJobError) WithOpaqueID(s string) func(*ConnectorSyncJobErrorRequest) { + return func(r *ConnectorSyncJobErrorRequest) { + 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/v8/esapi/api.connector_sync_job.get.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector_sync_job.get.go new file mode 100644 index 000000000..668fd2a87 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector_sync_job.get.go @@ -0,0 +1,227 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// +// Code generated from specification version 8.12.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newConnectorSyncJobGetFunc(t Transport) ConnectorSyncJobGet { + return func(connector_sync_job_id string, o ...func(*ConnectorSyncJobGetRequest)) (*Response, error) { + var r = ConnectorSyncJobGetRequest{ConnectorSyncJobID: connector_sync_job_id} + for _, f := range o { + f(&r) + } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// ConnectorSyncJobGet returns the details about a connector sync job. +// +// This API is experimental. +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/get-connector-sync-job-api.html. +type ConnectorSyncJobGet func(connector_sync_job_id string, o ...func(*ConnectorSyncJobGetRequest)) (*Response, error) + +// ConnectorSyncJobGetRequest configures the Connector Sync Job Get API request. +type ConnectorSyncJobGetRequest struct { + ConnectorSyncJobID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context + + instrument Instrumentation +} + +// Do executes the request and returns response or error. +func (r ConnectorSyncJobGetRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ctx context.Context + ) + + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "connector_sync_job.get") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + method = "GET" + + path.Grow(7 + 1 + len("_connector") + 1 + len("_sync_job") + 1 + len(r.ConnectorSyncJobID)) + path.WriteString("http://") + path.WriteString("/") + path.WriteString("_connector") + path.WriteString("/") + path.WriteString("_sync_job") + path.WriteString("/") + path.WriteString(r.ConnectorSyncJobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "connector_sync_job_id", r.ConnectorSyncJobID) + } + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), nil) + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "connector_sync_job.get") + } + res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "connector_sync_job.get") + } + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +func (f ConnectorSyncJobGet) WithContext(v context.Context) func(*ConnectorSyncJobGetRequest) { + return func(r *ConnectorSyncJobGetRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +func (f ConnectorSyncJobGet) WithPretty() func(*ConnectorSyncJobGetRequest) { + return func(r *ConnectorSyncJobGetRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +func (f ConnectorSyncJobGet) WithHuman() func(*ConnectorSyncJobGetRequest) { + return func(r *ConnectorSyncJobGetRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +func (f ConnectorSyncJobGet) WithErrorTrace() func(*ConnectorSyncJobGetRequest) { + return func(r *ConnectorSyncJobGetRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +func (f ConnectorSyncJobGet) WithFilterPath(v ...string) func(*ConnectorSyncJobGetRequest) { + return func(r *ConnectorSyncJobGetRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +func (f ConnectorSyncJobGet) WithHeader(h map[string]string) func(*ConnectorSyncJobGetRequest) { + return func(r *ConnectorSyncJobGetRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +func (f ConnectorSyncJobGet) WithOpaqueID(s string) func(*ConnectorSyncJobGetRequest) { + return func(r *ConnectorSyncJobGetRequest) { + 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/v8/esapi/api.connector_sync_job.list.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector_sync_job.list.go new file mode 100644 index 000000000..fe4ddf627 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector_sync_job.list.go @@ -0,0 +1,267 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// +// Code generated from specification version 8.12.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" +) + +func newConnectorSyncJobListFunc(t Transport) ConnectorSyncJobList { + return func(o ...func(*ConnectorSyncJobListRequest)) (*Response, error) { + var r = ConnectorSyncJobListRequest{} + for _, f := range o { + f(&r) + } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// ConnectorSyncJobList lists all connector sync jobs. +// +// This API is experimental. +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/list-connector-sync-jobs-api.html. +type ConnectorSyncJobList func(o ...func(*ConnectorSyncJobListRequest)) (*Response, error) + +// ConnectorSyncJobListRequest configures the Connector Sync Job List API request. +type ConnectorSyncJobListRequest struct { + ConnectorID string + From *int + Size *int + Status string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context + + instrument Instrumentation +} + +// Do executes the request and returns response or error. +func (r ConnectorSyncJobListRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ctx context.Context + ) + + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "connector_sync_job.list") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + method = "GET" + + path.Grow(7 + len("/_connector/_sync_job")) + path.WriteString("http://") + path.WriteString("/_connector/_sync_job") + + params = make(map[string]string) + + if r.ConnectorID != "" { + params["connector_id"] = r.ConnectorID + } + + if r.From != nil { + params["from"] = strconv.FormatInt(int64(*r.From), 10) + } + + if r.Size != nil { + params["size"] = strconv.FormatInt(int64(*r.Size), 10) + } + + if r.Status != "" { + params["status"] = r.Status + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), nil) + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "connector_sync_job.list") + } + res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "connector_sync_job.list") + } + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +func (f ConnectorSyncJobList) WithContext(v context.Context) func(*ConnectorSyncJobListRequest) { + return func(r *ConnectorSyncJobListRequest) { + r.ctx = v + } +} + +// WithConnectorID - ID of the connector to fetch the sync jobs for. +func (f ConnectorSyncJobList) WithConnectorID(v string) func(*ConnectorSyncJobListRequest) { + return func(r *ConnectorSyncJobListRequest) { + r.ConnectorID = v + } +} + +// WithFrom - starting offset (default: 0). +func (f ConnectorSyncJobList) WithFrom(v int) func(*ConnectorSyncJobListRequest) { + return func(r *ConnectorSyncJobListRequest) { + r.From = &v + } +} + +// WithSize - specifies a max number of results to get (default: 100). +func (f ConnectorSyncJobList) WithSize(v int) func(*ConnectorSyncJobListRequest) { + return func(r *ConnectorSyncJobListRequest) { + r.Size = &v + } +} + +// WithStatus - sync job status, which sync jobs are fetched for. +func (f ConnectorSyncJobList) WithStatus(v string) func(*ConnectorSyncJobListRequest) { + return func(r *ConnectorSyncJobListRequest) { + r.Status = v + } +} + +// WithPretty makes the response body pretty-printed. +func (f ConnectorSyncJobList) WithPretty() func(*ConnectorSyncJobListRequest) { + return func(r *ConnectorSyncJobListRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +func (f ConnectorSyncJobList) WithHuman() func(*ConnectorSyncJobListRequest) { + return func(r *ConnectorSyncJobListRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +func (f ConnectorSyncJobList) WithErrorTrace() func(*ConnectorSyncJobListRequest) { + return func(r *ConnectorSyncJobListRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +func (f ConnectorSyncJobList) WithFilterPath(v ...string) func(*ConnectorSyncJobListRequest) { + return func(r *ConnectorSyncJobListRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +func (f ConnectorSyncJobList) WithHeader(h map[string]string) func(*ConnectorSyncJobListRequest) { + return func(r *ConnectorSyncJobListRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +func (f ConnectorSyncJobList) WithOpaqueID(s string) func(*ConnectorSyncJobListRequest) { + return func(r *ConnectorSyncJobListRequest) { + 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/v8/esapi/api.connector_sync_job.post.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector_sync_job.post.go new file mode 100644 index 000000000..e58158756 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector_sync_job.post.go @@ -0,0 +1,227 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// +// Code generated from specification version 8.12.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newConnectorSyncJobPostFunc(t Transport) ConnectorSyncJobPost { + return func(body io.Reader, o ...func(*ConnectorSyncJobPostRequest)) (*Response, error) { + var r = ConnectorSyncJobPostRequest{Body: body} + for _, f := range o { + f(&r) + } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// ConnectorSyncJobPost creates a connector sync job. +// +// This API is experimental. +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/create-connector-sync-job-api.html. +type ConnectorSyncJobPost func(body io.Reader, o ...func(*ConnectorSyncJobPostRequest)) (*Response, error) + +// ConnectorSyncJobPostRequest configures the Connector Sync Job Post API request. +type ConnectorSyncJobPostRequest struct { + Body io.Reader + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context + + instrument Instrumentation +} + +// Do executes the request and returns response or error. +func (r ConnectorSyncJobPostRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ctx context.Context + ) + + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "connector_sync_job.post") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + method = "POST" + + path.Grow(7 + len("/_connector/_sync_job")) + path.WriteString("http://") + path.WriteString("/_connector/_sync_job") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if r.Body != nil && req.Header.Get(headerContentType) == "" { + req.Header[headerContentType] = headerContentTypeJSON + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "connector_sync_job.post") + if reader := instrument.RecordRequestBody(ctx, "connector_sync_job.post", r.Body); reader != nil { + req.Body = reader + } + } + res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "connector_sync_job.post") + } + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +func (f ConnectorSyncJobPost) WithContext(v context.Context) func(*ConnectorSyncJobPostRequest) { + return func(r *ConnectorSyncJobPostRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +func (f ConnectorSyncJobPost) WithPretty() func(*ConnectorSyncJobPostRequest) { + return func(r *ConnectorSyncJobPostRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +func (f ConnectorSyncJobPost) WithHuman() func(*ConnectorSyncJobPostRequest) { + return func(r *ConnectorSyncJobPostRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +func (f ConnectorSyncJobPost) WithErrorTrace() func(*ConnectorSyncJobPostRequest) { + return func(r *ConnectorSyncJobPostRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +func (f ConnectorSyncJobPost) WithFilterPath(v ...string) func(*ConnectorSyncJobPostRequest) { + return func(r *ConnectorSyncJobPostRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +func (f ConnectorSyncJobPost) WithHeader(h map[string]string) func(*ConnectorSyncJobPostRequest) { + return func(r *ConnectorSyncJobPostRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +func (f ConnectorSyncJobPost) WithOpaqueID(s string) func(*ConnectorSyncJobPostRequest) { + return func(r *ConnectorSyncJobPostRequest) { + 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/v8/esapi/api.connector_sync_job.update_stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector_sync_job.update_stats.go new file mode 100644 index 000000000..609fe4856 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.connector_sync_job.update_stats.go @@ -0,0 +1,239 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// +// Code generated from specification version 8.12.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newConnectorSyncJobUpdateStatsFunc(t Transport) ConnectorSyncJobUpdateStats { + return func(body io.Reader, connector_sync_job_id string, o ...func(*ConnectorSyncJobUpdateStatsRequest)) (*Response, error) { + var r = ConnectorSyncJobUpdateStatsRequest{Body: body, ConnectorSyncJobID: connector_sync_job_id} + for _, f := range o { + f(&r) + } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// ConnectorSyncJobUpdateStats updates the stats fields in the connector sync job document. +// +// This API is experimental. +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/set-connector-sync-job-stats-api.html. +type ConnectorSyncJobUpdateStats func(body io.Reader, connector_sync_job_id string, o ...func(*ConnectorSyncJobUpdateStatsRequest)) (*Response, error) + +// ConnectorSyncJobUpdateStatsRequest configures the Connector Sync Job Update Stats API request. +type ConnectorSyncJobUpdateStatsRequest struct { + Body io.Reader + + ConnectorSyncJobID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context + + instrument Instrumentation +} + +// Do executes the request and returns response or error. +func (r ConnectorSyncJobUpdateStatsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ctx context.Context + ) + + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "connector_sync_job.update_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + method = "PUT" + + path.Grow(7 + 1 + len("_connector") + 1 + len("_sync_job") + 1 + len(r.ConnectorSyncJobID) + 1 + len("_stats")) + path.WriteString("http://") + path.WriteString("/") + path.WriteString("_connector") + path.WriteString("/") + path.WriteString("_sync_job") + path.WriteString("/") + path.WriteString(r.ConnectorSyncJobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "connector_sync_job_id", r.ConnectorSyncJobID) + } + path.WriteString("/") + path.WriteString("_stats") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if r.Body != nil && req.Header.Get(headerContentType) == "" { + req.Header[headerContentType] = headerContentTypeJSON + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "connector_sync_job.update_stats") + if reader := instrument.RecordRequestBody(ctx, "connector_sync_job.update_stats", r.Body); reader != nil { + req.Body = reader + } + } + res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "connector_sync_job.update_stats") + } + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +func (f ConnectorSyncJobUpdateStats) WithContext(v context.Context) func(*ConnectorSyncJobUpdateStatsRequest) { + return func(r *ConnectorSyncJobUpdateStatsRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +func (f ConnectorSyncJobUpdateStats) WithPretty() func(*ConnectorSyncJobUpdateStatsRequest) { + return func(r *ConnectorSyncJobUpdateStatsRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +func (f ConnectorSyncJobUpdateStats) WithHuman() func(*ConnectorSyncJobUpdateStatsRequest) { + return func(r *ConnectorSyncJobUpdateStatsRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +func (f ConnectorSyncJobUpdateStats) WithErrorTrace() func(*ConnectorSyncJobUpdateStatsRequest) { + return func(r *ConnectorSyncJobUpdateStatsRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +func (f ConnectorSyncJobUpdateStats) WithFilterPath(v ...string) func(*ConnectorSyncJobUpdateStatsRequest) { + return func(r *ConnectorSyncJobUpdateStatsRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +func (f ConnectorSyncJobUpdateStats) WithHeader(h map[string]string) func(*ConnectorSyncJobUpdateStatsRequest) { + return func(r *ConnectorSyncJobUpdateStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +func (f ConnectorSyncJobUpdateStats) WithOpaqueID(s string) func(*ConnectorSyncJobUpdateStatsRequest) { + return func(r *ConnectorSyncJobUpdateStatsRequest) { + 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/v8/esapi/api.count.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.count.go index 37a34cd08..312e5dd26 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.count.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.count.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newCountFunc(t Transport) Count { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -73,16 +78,27 @@ type CountRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CountRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CountRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "count") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(strings.Join(r.Index, ",")) + 1 + len("_count")) @@ -90,6 +106,9 @@ func (r CountRequest) Do(ctx context.Context, transport Transport) (*Response, e if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } } path.WriteString("/") path.WriteString("_count") @@ -170,6 +189,9 @@ func (r CountRequest) Do(ctx context.Context, transport Transport) (*Response, e req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -201,8 +223,20 @@ func (r CountRequest) Do(ctx context.Context, transport Transport) (*Response, e req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "count") + if reader := instrument.RecordRequestBody(ctx, "count", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "count") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.create.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.create.go index fbf613aae..4b811a059 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.create.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.create.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newCreateFunc(t Transport) Create { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -70,26 +75,43 @@ type CreateRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CreateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CreateRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "create") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len(r.Index) + 1 + len("_create") + 1 + len(r.DocumentID)) path.WriteString("http://") path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } path.WriteString("/") path.WriteString("_create") path.WriteString("/") path.WriteString(r.DocumentID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.DocumentID) + } params = make(map[string]string) @@ -139,6 +161,9 @@ func (r CreateRequest) Do(ctx context.Context, transport Transport) (*Response, req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -170,8 +195,20 @@ func (r CreateRequest) Do(ctx context.Context, transport Transport) (*Response, req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "create") + if reader := instrument.RecordRequestBody(ctx, "create", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "create") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.dangling_indices.delete_dangling_index.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.dangling_indices.delete_dangling_index.go index f0523ec94..01fb26855 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.dangling_indices.delete_dangling_index.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.dangling_indices.delete_dangling_index.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newDanglingIndicesDeleteDanglingIndexFunc(t Transport) DanglingIndicesDelet for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -60,16 +65,27 @@ type DanglingIndicesDeleteDanglingIndexRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r DanglingIndicesDeleteDanglingIndexRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r DanglingIndicesDeleteDanglingIndexRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "dangling_indices.delete_dangling_index") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_dangling") + 1 + len(r.IndexUUID)) @@ -78,6 +94,9 @@ func (r DanglingIndicesDeleteDanglingIndexRequest) Do(ctx context.Context, trans path.WriteString("_dangling") path.WriteString("/") path.WriteString(r.IndexUUID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index_uuid", r.IndexUUID) + } params = make(map[string]string) @@ -111,6 +130,9 @@ func (r DanglingIndicesDeleteDanglingIndexRequest) Do(ctx context.Context, trans req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -138,8 +160,17 @@ func (r DanglingIndicesDeleteDanglingIndexRequest) Do(ctx context.Context, trans req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "dangling_indices.delete_dangling_index") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "dangling_indices.delete_dangling_index") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.dangling_indices.import_dangling_index.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.dangling_indices.import_dangling_index.go index 87765868a..c0a39de56 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.dangling_indices.import_dangling_index.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.dangling_indices.import_dangling_index.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newDanglingIndicesImportDanglingIndexFunc(t Transport) DanglingIndicesImpor for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -60,16 +65,27 @@ type DanglingIndicesImportDanglingIndexRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r DanglingIndicesImportDanglingIndexRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r DanglingIndicesImportDanglingIndexRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "dangling_indices.import_dangling_index") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_dangling") + 1 + len(r.IndexUUID)) @@ -78,6 +94,9 @@ func (r DanglingIndicesImportDanglingIndexRequest) Do(ctx context.Context, trans path.WriteString("_dangling") path.WriteString("/") path.WriteString(r.IndexUUID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index_uuid", r.IndexUUID) + } params = make(map[string]string) @@ -111,6 +130,9 @@ func (r DanglingIndicesImportDanglingIndexRequest) Do(ctx context.Context, trans req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -138,8 +160,17 @@ func (r DanglingIndicesImportDanglingIndexRequest) Do(ctx context.Context, trans req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "dangling_indices.import_dangling_index") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "dangling_indices.import_dangling_index") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.dangling_indices.list_dangling_indices.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.dangling_indices.list_dangling_indices.go index 7e8ffc46a..768d11f42 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.dangling_indices.list_dangling_indices.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.dangling_indices.list_dangling_indices.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newDanglingIndicesListDanglingIndicesFunc(t Transport) DanglingIndicesListD for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type DanglingIndicesListDanglingIndicesRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r DanglingIndicesListDanglingIndicesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r DanglingIndicesListDanglingIndicesRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "dangling_indices.list_dangling_indices") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_dangling")) @@ -88,6 +104,9 @@ func (r DanglingIndicesListDanglingIndicesRequest) Do(ctx context.Context, trans req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r DanglingIndicesListDanglingIndicesRequest) Do(ctx context.Context, trans req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "dangling_indices.list_dangling_indices") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "dangling_indices.list_dangling_indices") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.delete.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.delete.go index 916bf376e..1c1a185b9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.delete.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.delete.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newDeleteFunc(t Transport) Delete { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -66,26 +71,43 @@ type DeleteRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r DeleteRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r DeleteRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "delete") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len(r.Index) + 1 + len("_doc") + 1 + len(r.DocumentID)) path.WriteString("http://") path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } path.WriteString("/") path.WriteString("_doc") path.WriteString("/") path.WriteString(r.DocumentID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.DocumentID) + } params = make(map[string]string) @@ -139,6 +161,9 @@ func (r DeleteRequest) Do(ctx context.Context, transport Transport) (*Response, req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -166,8 +191,17 @@ func (r DeleteRequest) Do(ctx context.Context, transport Transport) (*Response, req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "delete") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "delete") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.delete_by_query.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.delete_by_query.go index 27054a076..601dca9b8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.delete_by_query.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.delete_by_query.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -36,6 +36,11 @@ func newDeleteByQueryFunc(t Transport) DeleteByQuery { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -91,16 +96,27 @@ type DeleteByQueryRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r DeleteByQueryRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r DeleteByQueryRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "delete_by_query") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" if len(r.Index) == 0 { @@ -111,6 +127,9 @@ func (r DeleteByQueryRequest) Do(ctx context.Context, transport Transport) (*Res path.WriteString("http://") path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } path.WriteString("/") path.WriteString("_delete_by_query") @@ -250,6 +269,9 @@ func (r DeleteByQueryRequest) Do(ctx context.Context, transport Transport) (*Res req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -281,8 +303,20 @@ func (r DeleteByQueryRequest) Do(ctx context.Context, transport Transport) (*Res req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "delete_by_query") + if reader := instrument.RecordRequestBody(ctx, "delete_by_query", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "delete_by_query") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.delete_by_query_rethrottle.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.delete_by_query_rethrottle.go index a63a553af..71b9e79fb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.delete_by_query_rethrottle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.delete_by_query_rethrottle.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newDeleteByQueryRethrottleFunc(t Transport) DeleteByQueryRethrottle { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type DeleteByQueryRethrottleRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r DeleteByQueryRethrottleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r DeleteByQueryRethrottleRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "delete_by_query_rethrottle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_delete_by_query") + 1 + len(r.TaskID) + 1 + len("_rethrottle")) @@ -75,6 +91,9 @@ func (r DeleteByQueryRethrottleRequest) Do(ctx context.Context, transport Transp path.WriteString("_delete_by_query") path.WriteString("/") path.WriteString(r.TaskID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "task_id", r.TaskID) + } path.WriteString("/") path.WriteString("_rethrottle") @@ -102,6 +121,9 @@ func (r DeleteByQueryRethrottleRequest) Do(ctx context.Context, transport Transp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -129,8 +151,17 @@ func (r DeleteByQueryRethrottleRequest) Do(ctx context.Context, transport Transp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "delete_by_query_rethrottle") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "delete_by_query_rethrottle") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.delete_script.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.delete_script.go index f7c5e6962..5ef41c35d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.delete_script.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.delete_script.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newDeleteScriptFunc(t Transport) DeleteScript { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -58,16 +63,27 @@ type DeleteScriptRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r DeleteScriptRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r DeleteScriptRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "delete_script") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_scripts") + 1 + len(r.ScriptID)) @@ -76,6 +92,9 @@ func (r DeleteScriptRequest) Do(ctx context.Context, transport Transport) (*Resp path.WriteString("_scripts") path.WriteString("/") path.WriteString(r.ScriptID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.ScriptID) + } params = make(map[string]string) @@ -105,6 +124,9 @@ func (r DeleteScriptRequest) Do(ctx context.Context, transport Transport) (*Resp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -132,8 +154,17 @@ func (r DeleteScriptRequest) Do(ctx context.Context, transport Transport) (*Resp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "delete_script") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "delete_script") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.exists.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.exists.go index 06931bd8d..6137571d4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.exists.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.exists.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newExistsFunc(t Transport) Exists { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -67,26 +72,43 @@ type ExistsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ExistsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ExistsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "exists") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "HEAD" path.Grow(7 + 1 + len(r.Index) + 1 + len("_doc") + 1 + len(r.DocumentID)) path.WriteString("http://") path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } path.WriteString("/") path.WriteString("_doc") path.WriteString("/") path.WriteString(r.DocumentID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.DocumentID) + } params = make(map[string]string) @@ -148,6 +170,9 @@ func (r ExistsRequest) Do(ctx context.Context, transport Transport) (*Response, req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,8 +200,17 @@ func (r ExistsRequest) Do(ctx context.Context, transport Transport) (*Response, req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "exists") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "exists") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.exists_source.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.exists_source.go index 752162612..274b18061 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.exists_source.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.exists_source.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newExistsSourceFunc(t Transport) ExistsSource { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -66,26 +71,43 @@ type ExistsSourceRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ExistsSourceRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ExistsSourceRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "exists_source") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "HEAD" path.Grow(7 + 1 + len(r.Index) + 1 + len("_source") + 1 + len(r.DocumentID)) path.WriteString("http://") path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } path.WriteString("/") path.WriteString("_source") path.WriteString("/") path.WriteString(r.DocumentID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.DocumentID) + } params = make(map[string]string) @@ -143,6 +165,9 @@ func (r ExistsSourceRequest) Do(ctx context.Context, transport Transport) (*Resp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -170,8 +195,17 @@ func (r ExistsSourceRequest) Do(ctx context.Context, transport Transport) (*Resp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "exists_source") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "exists_source") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.explain.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.explain.go index b0b1253e0..716f9b5e4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.explain.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.explain.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newExplainFunc(t Transport) Explain { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -72,26 +77,43 @@ type ExplainRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ExplainRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ExplainRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "explain") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(r.Index) + 1 + len("_explain") + 1 + len(r.DocumentID)) path.WriteString("http://") path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } path.WriteString("/") path.WriteString("_explain") path.WriteString("/") path.WriteString(r.DocumentID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.DocumentID) + } params = make(map[string]string) @@ -161,6 +183,9 @@ func (r ExplainRequest) Do(ctx context.Context, transport Transport) (*Response, req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -192,8 +217,20 @@ func (r ExplainRequest) Do(ctx context.Context, transport Transport) (*Response, req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "explain") + if reader := instrument.RecordRequestBody(ctx, "explain", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "explain") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.features.get_features.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.features.get_features.go index 0e0f5a759..21f5f8359 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.features.get_features.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.features.get_features.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newFeaturesGetFeaturesFunc(t Transport) FeaturesGetFeatures { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type FeaturesGetFeaturesRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r FeaturesGetFeaturesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r FeaturesGetFeaturesRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "features.get_features") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_features")) @@ -95,6 +111,9 @@ func (r FeaturesGetFeaturesRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +141,17 @@ func (r FeaturesGetFeaturesRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "features.get_features") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "features.get_features") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.features.reset_features.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.features.reset_features.go index 60b7ec36c..6ca0610b0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.features.reset_features.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.features.reset_features.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newFeaturesResetFeaturesFunc(t Transport) FeaturesResetFeatures { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type FeaturesResetFeaturesRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r FeaturesResetFeaturesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r FeaturesResetFeaturesRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "features.reset_features") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_features/_reset")) @@ -90,6 +106,9 @@ func (r FeaturesResetFeaturesRequest) Do(ctx context.Context, transport Transpor req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -117,8 +136,17 @@ func (r FeaturesResetFeaturesRequest) Do(ctx context.Context, transport Transpor req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "features.reset_features") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "features.reset_features") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.field_caps.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.field_caps.go index 083f25eb3..4b00e26b0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.field_caps.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.field_caps.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newFieldCapsFunc(t Transport) FieldCaps { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -66,16 +71,27 @@ type FieldCapsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r FieldCapsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r FieldCapsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "field_caps") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(strings.Join(r.Index, ",")) + 1 + len("_field_caps")) @@ -83,6 +99,9 @@ func (r FieldCapsRequest) Do(ctx context.Context, transport Transport) (*Respons if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } } path.WriteString("/") path.WriteString("_field_caps") @@ -135,6 +154,9 @@ func (r FieldCapsRequest) Do(ctx context.Context, transport Transport) (*Respons req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -166,8 +188,20 @@ func (r FieldCapsRequest) Do(ctx context.Context, transport Transport) (*Respons req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "field_caps") + if reader := instrument.RecordRequestBody(ctx, "field_caps", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "field_caps") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.fleet.delete_secret.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.fleet.delete_secret.go index 7bdad5a01..d661c1122 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.fleet.delete_secret.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.fleet.delete_secret.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newFleetDeleteSecretFunc(t Transport) FleetDeleteSecret { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type FleetDeleteSecretRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r FleetDeleteSecretRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r FleetDeleteSecretRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "fleet.delete_secret") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_fleet") + 1 + len("secret") + 1 + len(r.DocumentID)) @@ -74,6 +90,9 @@ func (r FleetDeleteSecretRequest) Do(ctx context.Context, transport Transport) ( path.WriteString("secret") path.WriteString("/") path.WriteString(r.DocumentID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.DocumentID) + } params = make(map[string]string) @@ -95,6 +114,9 @@ func (r FleetDeleteSecretRequest) Do(ctx context.Context, transport Transport) ( req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +144,17 @@ func (r FleetDeleteSecretRequest) Do(ctx context.Context, transport Transport) ( req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "fleet.delete_secret") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "fleet.delete_secret") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.fleet.get_secret.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.fleet.get_secret.go index f1425fb11..8c21b4ebd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.fleet.get_secret.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.fleet.get_secret.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newFleetGetSecretFunc(t Transport) FleetGetSecret { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type FleetGetSecretRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r FleetGetSecretRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r FleetGetSecretRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "fleet.get_secret") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_fleet") + 1 + len("secret") + 1 + len(r.DocumentID)) @@ -74,6 +90,9 @@ func (r FleetGetSecretRequest) Do(ctx context.Context, transport Transport) (*Re path.WriteString("secret") path.WriteString("/") path.WriteString(r.DocumentID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.DocumentID) + } params = make(map[string]string) @@ -95,6 +114,9 @@ func (r FleetGetSecretRequest) Do(ctx context.Context, transport Transport) (*Re req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +144,17 @@ func (r FleetGetSecretRequest) Do(ctx context.Context, transport Transport) (*Re req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "fleet.get_secret") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "fleet.get_secret") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.fleet.global_checkpoints.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.fleet.global_checkpoints.go index 3425bf188..859624fda 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.fleet.global_checkpoints.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.fleet.global_checkpoints.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newFleetGlobalCheckpointsFunc(t Transport) FleetGlobalCheckpoints { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -61,22 +66,36 @@ type FleetGlobalCheckpointsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r FleetGlobalCheckpointsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r FleetGlobalCheckpointsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "fleet.global_checkpoints") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len(r.Index) + 1 + len("_fleet") + 1 + len("global_checkpoints")) path.WriteString("http://") path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } path.WriteString("/") path.WriteString("_fleet") path.WriteString("/") @@ -118,6 +137,9 @@ func (r FleetGlobalCheckpointsRequest) Do(ctx context.Context, transport Transpo req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -145,8 +167,17 @@ func (r FleetGlobalCheckpointsRequest) Do(ctx context.Context, transport Transpo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "fleet.global_checkpoints") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "fleet.global_checkpoints") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.fleet.msearch.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.fleet.msearch.go index b221bb7a5..cb5934ecd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.fleet.msearch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.fleet.msearch.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newFleetMsearchFunc(t Transport) FleetMsearch { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type FleetMsearchRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r FleetMsearchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r FleetMsearchRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "fleet.msearch") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(r.Index) + 1 + len("_fleet") + 1 + len("_fleet_msearch")) @@ -74,6 +90,9 @@ func (r FleetMsearchRequest) Do(ctx context.Context, transport Transport) (*Resp if r.Index != "" { path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } } path.WriteString("/") path.WriteString("_fleet") @@ -100,6 +119,9 @@ func (r FleetMsearchRequest) Do(ctx context.Context, transport Transport) (*Resp req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -131,8 +153,20 @@ func (r FleetMsearchRequest) Do(ctx context.Context, transport Transport) (*Resp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "fleet.msearch") + if reader := instrument.RecordRequestBody(ctx, "fleet.msearch", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "fleet.msearch") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.fleet.post_secret.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.fleet.post_secret.go index c057ea210..c6a84d747 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.fleet.post_secret.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.fleet.post_secret.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newFleetPostSecretFunc(t Transport) FleetPostSecret { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type FleetPostSecretRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r FleetPostSecretRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r FleetPostSecretRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "fleet.post_secret") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_fleet/secret")) @@ -91,6 +107,9 @@ func (r FleetPostSecretRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +141,20 @@ func (r FleetPostSecretRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "fleet.post_secret") + if reader := instrument.RecordRequestBody(ctx, "fleet.post_secret", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "fleet.post_secret") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.fleet.search.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.fleet.search.go index a9072c61b..f6003d644 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.fleet.search.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.fleet.search.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newFleetSearchFunc(t Transport) FleetSearch { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -63,22 +68,36 @@ type FleetSearchRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r FleetSearchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r FleetSearchRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "fleet.search") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(r.Index) + 1 + len("_fleet") + 1 + len("_fleet_search")) path.WriteString("http://") path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } path.WriteString("/") path.WriteString("_fleet") path.WriteString("/") @@ -116,6 +135,9 @@ func (r FleetSearchRequest) Do(ctx context.Context, transport Transport) (*Respo req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -147,8 +169,20 @@ func (r FleetSearchRequest) Do(ctx context.Context, transport Transport) (*Respo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "fleet.search") + if reader := instrument.RecordRequestBody(ctx, "fleet.search", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "fleet.search") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.get.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.get.go index 11607febf..27ef6acdd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.get.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.get.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newGetFunc(t Transport) Get { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -68,26 +73,43 @@ type GetRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r GetRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r GetRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "get") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len(r.Index) + 1 + len("_doc") + 1 + len(r.DocumentID)) path.WriteString("http://") path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } path.WriteString("/") path.WriteString("_doc") path.WriteString("/") path.WriteString(r.DocumentID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.DocumentID) + } params = make(map[string]string) @@ -153,6 +175,9 @@ func (r GetRequest) Do(ctx context.Context, transport Transport) (*Response, err req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -180,8 +205,17 @@ func (r GetRequest) Do(ctx context.Context, transport Transport) (*Response, err req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "get") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "get") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.get_script.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.get_script.go index a9a79e5fd..38e993f5e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.get_script.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.get_script.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newGetScriptFunc(t Transport) GetScript { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type GetScriptRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r GetScriptRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r GetScriptRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "get_script") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_scripts") + 1 + len(r.ScriptID)) @@ -75,6 +91,9 @@ func (r GetScriptRequest) Do(ctx context.Context, transport Transport) (*Respons path.WriteString("_scripts") path.WriteString("/") path.WriteString(r.ScriptID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.ScriptID) + } params = make(map[string]string) @@ -100,6 +119,9 @@ func (r GetScriptRequest) Do(ctx context.Context, transport Transport) (*Respons req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -127,8 +149,17 @@ func (r GetScriptRequest) Do(ctx context.Context, transport Transport) (*Respons req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "get_script") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "get_script") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.get_script_context.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.get_script_context.go index 36b543368..1a3d776e1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.get_script_context.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.get_script_context.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newGetScriptContextFunc(t Transport) GetScriptContext { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type GetScriptContextRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r GetScriptContextRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r GetScriptContextRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "get_script_context") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_script_context")) @@ -88,6 +104,9 @@ func (r GetScriptContextRequest) Do(ctx context.Context, transport Transport) (* req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r GetScriptContextRequest) Do(ctx context.Context, transport Transport) (* req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "get_script_context") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "get_script_context") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.get_script_languages.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.get_script_languages.go index 6a6d2031c..aee9443a6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.get_script_languages.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.get_script_languages.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newGetScriptLanguagesFunc(t Transport) GetScriptLanguages { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type GetScriptLanguagesRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r GetScriptLanguagesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r GetScriptLanguagesRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "get_script_languages") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_script_language")) @@ -88,6 +104,9 @@ func (r GetScriptLanguagesRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r GetScriptLanguagesRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "get_script_languages") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "get_script_languages") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.get_source.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.get_source.go index 01270823b..cdc5216ee 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.get_source.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.get_source.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newGetSourceFunc(t Transport) GetSource { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -66,26 +71,43 @@ type GetSourceRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r GetSourceRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r GetSourceRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "get_source") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len(r.Index) + 1 + len("_source") + 1 + len(r.DocumentID)) path.WriteString("http://") path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } path.WriteString("/") path.WriteString("_source") path.WriteString("/") path.WriteString(r.DocumentID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.DocumentID) + } params = make(map[string]string) @@ -143,6 +165,9 @@ func (r GetSourceRequest) Do(ctx context.Context, transport Transport) (*Respons req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -170,8 +195,17 @@ func (r GetSourceRequest) Do(ctx context.Context, transport Transport) (*Respons req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "get_source") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "get_source") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.health_report.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.health_report.go index 9c4b439da..c59a68b9d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.health_report.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.health_report.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newHealthReportFunc(t Transport) HealthReport { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -60,16 +65,27 @@ type HealthReportRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r HealthReportRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r HealthReportRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "health_report") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_health_report") + 1 + len(r.Feature)) @@ -79,6 +95,9 @@ func (r HealthReportRequest) Do(ctx context.Context, transport Transport) (*Resp if r.Feature != "" { path.WriteString("/") path.WriteString(r.Feature) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "feature", r.Feature) + } } params = make(map[string]string) @@ -113,6 +132,9 @@ func (r HealthReportRequest) Do(ctx context.Context, transport Transport) (*Resp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -140,8 +162,17 @@ func (r HealthReportRequest) Do(ctx context.Context, transport Transport) (*Resp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "health_report") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "health_report") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.index.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.index.go index 0cce98b3e..f4a8cd692 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.index.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.index.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newIndexFunc(t Transport) Index { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -72,16 +77,27 @@ type IndexRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndexRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndexRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "index") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + if r.DocumentID != "" { method = "PUT" } else { @@ -92,11 +108,17 @@ func (r IndexRequest) Do(ctx context.Context, transport Transport) (*Response, e path.WriteString("http://") path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } path.WriteString("/") path.WriteString("_doc") if r.DocumentID != "" { path.WriteString("/") path.WriteString(r.DocumentID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.DocumentID) + } } params = make(map[string]string) @@ -163,6 +185,9 @@ func (r IndexRequest) Do(ctx context.Context, transport Transport) (*Response, e req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -194,8 +219,20 @@ func (r IndexRequest) Do(ctx context.Context, transport Transport) (*Response, e req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "index") + if reader := instrument.RecordRequestBody(ctx, "index", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "index") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.add_block.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.add_block.go index ca4aa76cb..1beca0374 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.add_block.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.add_block.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newIndicesAddBlockFunc(t Transport) IndicesAddBlock { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -65,16 +70,27 @@ type IndicesAddBlockRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesAddBlockRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesAddBlockRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.add_block") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" if len(r.Index) == 0 { @@ -85,10 +101,16 @@ func (r IndicesAddBlockRequest) Do(ctx context.Context, transport Transport) (*R path.WriteString("http://") path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } path.WriteString("/") path.WriteString("_block") path.WriteString("/") path.WriteString(r.Block) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "block", r.Block) + } params = make(map[string]string) @@ -130,6 +152,9 @@ func (r IndicesAddBlockRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -157,8 +182,17 @@ func (r IndicesAddBlockRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.add_block") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.add_block") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.analyze.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.analyze.go index 7473b563b..af7283bf5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.analyze.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.analyze.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newIndicesAnalyzeFunc(t Transport) IndicesAnalyze { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type IndicesAnalyzeRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesAnalyzeRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesAnalyzeRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.analyze") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(r.Index) + 1 + len("_analyze")) @@ -74,6 +90,9 @@ func (r IndicesAnalyzeRequest) Do(ctx context.Context, transport Transport) (*Re if r.Index != "" { path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } } path.WriteString("/") path.WriteString("_analyze") @@ -102,6 +121,9 @@ func (r IndicesAnalyzeRequest) Do(ctx context.Context, transport Transport) (*Re req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -133,8 +155,20 @@ func (r IndicesAnalyzeRequest) Do(ctx context.Context, transport Transport) (*Re req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.analyze") + if reader := instrument.RecordRequestBody(ctx, "indices.analyze", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.analyze") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.clear_cache.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.clear_cache.go index 0333278b3..4aae3a2ee 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.clear_cache.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.clear_cache.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newIndicesClearCacheFunc(t Transport) IndicesClearCache { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -63,16 +68,27 @@ type IndicesClearCacheRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesClearCacheRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesClearCacheRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.clear_cache") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(strings.Join(r.Index, ",")) + 1 + len("_cache") + 1 + len("clear")) @@ -80,6 +96,9 @@ func (r IndicesClearCacheRequest) Do(ctx context.Context, transport Transport) ( if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } } path.WriteString("/") path.WriteString("_cache") @@ -138,6 +157,9 @@ func (r IndicesClearCacheRequest) Do(ctx context.Context, transport Transport) ( req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -165,8 +187,17 @@ func (r IndicesClearCacheRequest) Do(ctx context.Context, transport Transport) ( req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.clear_cache") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.clear_cache") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.clone.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.clone.go index 6e197bac3..f7fb01caa 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.clone.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.clone.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newIndicesCloneFunc(t Transport) IndicesClone { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -64,26 +69,43 @@ type IndicesCloneRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesCloneRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesCloneRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.clone") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len(r.Index) + 1 + len("_clone") + 1 + len(r.Target)) path.WriteString("http://") path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } path.WriteString("/") path.WriteString("_clone") path.WriteString("/") path.WriteString(r.Target) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "target", r.Target) + } params = make(map[string]string) @@ -117,6 +139,9 @@ func (r IndicesCloneRequest) Do(ctx context.Context, transport Transport) (*Resp req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -148,8 +173,20 @@ func (r IndicesCloneRequest) Do(ctx context.Context, transport Transport) (*Resp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.clone") + if reader := instrument.RecordRequestBody(ctx, "indices.clone", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.clone") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.close.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.close.go index 0d3d4195e..41371240c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.close.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.close.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newIndicesCloseFunc(t Transport) IndicesClose { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -64,16 +69,27 @@ type IndicesCloseRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesCloseRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesCloseRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.close") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" if len(r.Index) == 0 { @@ -84,6 +100,9 @@ func (r IndicesCloseRequest) Do(ctx context.Context, transport Transport) (*Resp path.WriteString("http://") path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } path.WriteString("/") path.WriteString("_close") @@ -131,6 +150,9 @@ func (r IndicesCloseRequest) Do(ctx context.Context, transport Transport) (*Resp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -158,8 +180,17 @@ func (r IndicesCloseRequest) Do(ctx context.Context, transport Transport) (*Resp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.close") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.close") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.create.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.create.go index 2b7b8a24d..4b8bd3466 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.create.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.create.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newIndicesCreateFunc(t Transport) IndicesCreate { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -62,22 +67,36 @@ type IndicesCreateRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesCreateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesCreateRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.create") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len(r.Index)) path.WriteString("http://") path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } params = make(map[string]string) @@ -111,6 +130,9 @@ func (r IndicesCreateRequest) Do(ctx context.Context, transport Transport) (*Res req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -142,8 +164,20 @@ func (r IndicesCreateRequest) Do(ctx context.Context, transport Transport) (*Res req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.create") + if reader := instrument.RecordRequestBody(ctx, "indices.create", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.create") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.delete.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.delete.go index 3208e24b6..03595398c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.delete.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.delete.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newIndicesDeleteFunc(t Transport) IndicesDelete { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -63,16 +68,27 @@ type IndicesDeleteRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesDeleteRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesDeleteRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.delete") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" if len(r.Index) == 0 { @@ -83,6 +99,9 @@ func (r IndicesDeleteRequest) Do(ctx context.Context, transport Transport) (*Res path.WriteString("http://") path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } params = make(map[string]string) @@ -124,6 +143,9 @@ func (r IndicesDeleteRequest) Do(ctx context.Context, transport Transport) (*Res req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -151,8 +173,17 @@ func (r IndicesDeleteRequest) Do(ctx context.Context, transport Transport) (*Res req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.delete") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.delete") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.delete_alias.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.delete_alias.go index eb9336e50..0d248d2d2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.delete_alias.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.delete_alias.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newIndicesDeleteAliasFunc(t Transport) IndicesDeleteAlias { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -61,16 +66,27 @@ type IndicesDeleteAliasRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesDeleteAliasRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesDeleteAliasRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.delete_alias") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" if len(r.Index) == 0 { @@ -84,10 +100,16 @@ func (r IndicesDeleteAliasRequest) Do(ctx context.Context, transport Transport) path.WriteString("http://") path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } path.WriteString("/") path.WriteString("_aliases") path.WriteString("/") path.WriteString(strings.Join(r.Name, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", strings.Join(r.Name, ",")) + } params = make(map[string]string) @@ -117,6 +139,9 @@ func (r IndicesDeleteAliasRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -144,8 +169,17 @@ func (r IndicesDeleteAliasRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.delete_alias") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.delete_alias") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.delete_data_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.delete_data_lifecycle.go index f7670e735..a5703fc7e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.delete_data_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.delete_data_lifecycle.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newIndicesDeleteDataLifecycleFunc(t Transport) IndicesDeleteDataLifecycle { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -62,16 +67,27 @@ type IndicesDeleteDataLifecycleRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesDeleteDataLifecycleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesDeleteDataLifecycleRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.delete_data_lifecycle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" if len(r.Name) == 0 { @@ -84,6 +100,9 @@ func (r IndicesDeleteDataLifecycleRequest) Do(ctx context.Context, transport Tra path.WriteString("_data_stream") path.WriteString("/") path.WriteString(strings.Join(r.Name, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", strings.Join(r.Name, ",")) + } path.WriteString("/") path.WriteString("_lifecycle") @@ -119,6 +138,9 @@ func (r IndicesDeleteDataLifecycleRequest) Do(ctx context.Context, transport Tra req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -146,8 +168,17 @@ func (r IndicesDeleteDataLifecycleRequest) Do(ctx context.Context, transport Tra req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.delete_data_lifecycle") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.delete_data_lifecycle") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.delete_index_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.delete_index_template.go index 1b5bf94ab..e6c8136bf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.delete_index_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.delete_index_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newIndicesDeleteIndexTemplateFunc(t Transport) IndicesDeleteIndexTemplate { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -58,16 +63,27 @@ type IndicesDeleteIndexTemplateRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesDeleteIndexTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesDeleteIndexTemplateRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.delete_index_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_index_template") + 1 + len(r.Name)) @@ -76,6 +92,9 @@ func (r IndicesDeleteIndexTemplateRequest) Do(ctx context.Context, transport Tra path.WriteString("_index_template") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } params = make(map[string]string) @@ -105,6 +124,9 @@ func (r IndicesDeleteIndexTemplateRequest) Do(ctx context.Context, transport Tra req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -132,8 +154,17 @@ func (r IndicesDeleteIndexTemplateRequest) Do(ctx context.Context, transport Tra req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.delete_index_template") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.delete_index_template") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.delete_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.delete_template.go index 60897f74a..46f41c0f4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.delete_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.delete_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newIndicesDeleteTemplateFunc(t Transport) IndicesDeleteTemplate { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -58,16 +63,27 @@ type IndicesDeleteTemplateRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesDeleteTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesDeleteTemplateRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.delete_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_template") + 1 + len(r.Name)) @@ -76,6 +92,9 @@ func (r IndicesDeleteTemplateRequest) Do(ctx context.Context, transport Transpor path.WriteString("_template") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } params = make(map[string]string) @@ -105,6 +124,9 @@ func (r IndicesDeleteTemplateRequest) Do(ctx context.Context, transport Transpor req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -132,8 +154,17 @@ func (r IndicesDeleteTemplateRequest) Do(ctx context.Context, transport Transpor req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.delete_template") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.delete_template") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.disk_usage.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.disk_usage.go index c27f0cdc9..a1574fab9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.disk_usage.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.disk_usage.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newIndicesDiskUsageFunc(t Transport) IndicesDiskUsage { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -63,22 +68,36 @@ type IndicesDiskUsageRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesDiskUsageRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesDiskUsageRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.disk_usage") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(r.Index) + 1 + len("_disk_usage")) path.WriteString("http://") path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } path.WriteString("/") path.WriteString("_disk_usage") @@ -122,6 +141,9 @@ func (r IndicesDiskUsageRequest) Do(ctx context.Context, transport Transport) (* req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -149,8 +171,17 @@ func (r IndicesDiskUsageRequest) Do(ctx context.Context, transport Transport) (* req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.disk_usage") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.disk_usage") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.downsample.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.downsample.go index fd3026c15..c3c457289 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.downsample.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.downsample.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newIndicesDownsampleFunc(t Transport) IndicesDownsample { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -61,26 +66,43 @@ type IndicesDownsampleRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesDownsampleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesDownsampleRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.downsample") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(r.Index) + 1 + len("_downsample") + 1 + len(r.TargetIndex)) path.WriteString("http://") path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } path.WriteString("/") path.WriteString("_downsample") path.WriteString("/") path.WriteString(r.TargetIndex) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "target_index", r.TargetIndex) + } params = make(map[string]string) @@ -102,6 +124,9 @@ func (r IndicesDownsampleRequest) Do(ctx context.Context, transport Transport) ( req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -133,8 +158,20 @@ func (r IndicesDownsampleRequest) Do(ctx context.Context, transport Transport) ( req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.downsample") + if reader := instrument.RecordRequestBody(ctx, "indices.downsample", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.downsample") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.exists.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.exists.go index b8ff71a0b..1da6e6bec 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.exists.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.exists.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newIndicesExistsFunc(t Transport) IndicesExists { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -63,16 +68,27 @@ type IndicesExistsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesExistsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesExistsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.exists") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "HEAD" if len(r.Index) == 0 { @@ -83,6 +99,9 @@ func (r IndicesExistsRequest) Do(ctx context.Context, transport Transport) (*Res path.WriteString("http://") path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } params = make(map[string]string) @@ -128,6 +147,9 @@ func (r IndicesExistsRequest) Do(ctx context.Context, transport Transport) (*Res req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -155,8 +177,17 @@ func (r IndicesExistsRequest) Do(ctx context.Context, transport Transport) (*Res req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.exists") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.exists") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.exists_alias.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.exists_alias.go index d24827d8a..76639c412 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.exists_alias.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.exists_alias.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newIndicesExistsAliasFunc(t Transport) IndicesExistsAlias { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -63,16 +68,27 @@ type IndicesExistsAliasRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesExistsAliasRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesExistsAliasRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.exists_alias") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "HEAD" if len(r.Name) == 0 { @@ -84,11 +100,17 @@ func (r IndicesExistsAliasRequest) Do(ctx context.Context, transport Transport) if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } } path.WriteString("/") path.WriteString("_alias") path.WriteString("/") path.WriteString(strings.Join(r.Name, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", strings.Join(r.Name, ",")) + } params = make(map[string]string) @@ -126,6 +148,9 @@ func (r IndicesExistsAliasRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -153,8 +178,17 @@ func (r IndicesExistsAliasRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.exists_alias") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.exists_alias") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.exists_index_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.exists_index_template.go index e6edc0bca..36be70632 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.exists_index_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.exists_index_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newIndicesExistsIndexTemplateFunc(t Transport) IndicesExistsIndexTemplate { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -60,16 +65,27 @@ type IndicesExistsIndexTemplateRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesExistsIndexTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesExistsIndexTemplateRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.exists_index_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "HEAD" path.Grow(7 + 1 + len("_index_template") + 1 + len(r.Name)) @@ -78,6 +94,9 @@ func (r IndicesExistsIndexTemplateRequest) Do(ctx context.Context, transport Tra path.WriteString("_index_template") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } params = make(map[string]string) @@ -111,6 +130,9 @@ func (r IndicesExistsIndexTemplateRequest) Do(ctx context.Context, transport Tra req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -138,8 +160,17 @@ func (r IndicesExistsIndexTemplateRequest) Do(ctx context.Context, transport Tra req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.exists_index_template") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.exists_index_template") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.exists_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.exists_template.go index ab4b6d5db..1ca331e8d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.exists_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.exists_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newIndicesExistsTemplateFunc(t Transport) IndicesExistsTemplate { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -61,16 +66,27 @@ type IndicesExistsTemplateRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesExistsTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesExistsTemplateRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.exists_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "HEAD" if len(r.Name) == 0 { @@ -83,6 +99,9 @@ func (r IndicesExistsTemplateRequest) Do(ctx context.Context, transport Transpor path.WriteString("_template") path.WriteString("/") path.WriteString(strings.Join(r.Name, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", strings.Join(r.Name, ",")) + } params = make(map[string]string) @@ -116,6 +135,9 @@ func (r IndicesExistsTemplateRequest) Do(ctx context.Context, transport Transpor req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -143,8 +165,17 @@ func (r IndicesExistsTemplateRequest) Do(ctx context.Context, transport Transpor req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.exists_template") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.exists_template") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.explain_data_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.explain_data_lifecycle.go index 5f816e06a..324175c4d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.explain_data_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.explain_data_lifecycle.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newIndicesExplainDataLifecycleFunc(t Transport) IndicesExplainDataLifecycle for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -61,22 +66,36 @@ type IndicesExplainDataLifecycleRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesExplainDataLifecycleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesExplainDataLifecycleRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.explain_data_lifecycle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len(r.Index) + 1 + len("_lifecycle") + 1 + len("explain")) path.WriteString("http://") path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } path.WriteString("/") path.WriteString("_lifecycle") path.WriteString("/") @@ -110,6 +129,9 @@ func (r IndicesExplainDataLifecycleRequest) Do(ctx context.Context, transport Tr req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -137,8 +159,17 @@ func (r IndicesExplainDataLifecycleRequest) Do(ctx context.Context, transport Tr req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.explain_data_lifecycle") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.explain_data_lifecycle") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.field_usage_stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.field_usage_stats.go index 9b6f44117..fe0a82330 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.field_usage_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.field_usage_stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newIndicesFieldUsageStatsFunc(t Transport) IndicesFieldUsageStats { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -62,22 +67,36 @@ type IndicesFieldUsageStatsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesFieldUsageStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesFieldUsageStatsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.field_usage_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len(r.Index) + 1 + len("_field_usage_stats")) path.WriteString("http://") path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } path.WriteString("/") path.WriteString("_field_usage_stats") @@ -117,6 +136,9 @@ func (r IndicesFieldUsageStatsRequest) Do(ctx context.Context, transport Transpo req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -144,8 +166,17 @@ func (r IndicesFieldUsageStatsRequest) Do(ctx context.Context, transport Transpo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.field_usage_stats") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.field_usage_stats") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.flush.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.flush.go index bef965c22..963945097 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.flush.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.flush.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newIndicesFlushFunc(t Transport) IndicesFlush { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -61,16 +66,27 @@ type IndicesFlushRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesFlushRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesFlushRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.flush") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(strings.Join(r.Index, ",")) + 1 + len("_flush")) @@ -78,6 +94,9 @@ func (r IndicesFlushRequest) Do(ctx context.Context, transport Transport) (*Resp if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } } path.WriteString("/") path.WriteString("_flush") @@ -122,6 +141,9 @@ func (r IndicesFlushRequest) Do(ctx context.Context, transport Transport) (*Resp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -149,8 +171,17 @@ func (r IndicesFlushRequest) Do(ctx context.Context, transport Transport) (*Resp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.flush") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.flush") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.forcemerge.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.forcemerge.go index c97c2f833..392aa6f32 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.forcemerge.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.forcemerge.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newIndicesForcemergeFunc(t Transport) IndicesForcemerge { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -63,16 +68,27 @@ type IndicesForcemergeRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesForcemergeRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesForcemergeRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.forcemerge") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(strings.Join(r.Index, ",")) + 1 + len("_forcemerge")) @@ -80,6 +96,9 @@ func (r IndicesForcemergeRequest) Do(ctx context.Context, transport Transport) ( if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } } path.WriteString("/") path.WriteString("_forcemerge") @@ -132,6 +151,9 @@ func (r IndicesForcemergeRequest) Do(ctx context.Context, transport Transport) ( req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -159,8 +181,17 @@ func (r IndicesForcemergeRequest) Do(ctx context.Context, transport Transport) ( req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.forcemerge") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.forcemerge") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.get.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.get.go index d9e41095e..0a479f1a7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.get.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.get.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newIndicesGetFunc(t Transport) IndicesGet { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -66,16 +71,27 @@ type IndicesGetRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesGetRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesGetRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.get") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" if len(r.Index) == 0 { @@ -86,6 +102,9 @@ func (r IndicesGetRequest) Do(ctx context.Context, transport Transport) (*Respon path.WriteString("http://") path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } params = make(map[string]string) @@ -139,6 +158,9 @@ func (r IndicesGetRequest) Do(ctx context.Context, transport Transport) (*Respon req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -166,8 +188,17 @@ func (r IndicesGetRequest) Do(ctx context.Context, transport Transport) (*Respon req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.get") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.get") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.get_alias.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.get_alias.go index 9af6e63b6..744935869 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.get_alias.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.get_alias.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newIndicesGetAliasFunc(t Transport) IndicesGetAlias { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -62,16 +67,27 @@ type IndicesGetAliasRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesGetAliasRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesGetAliasRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.get_alias") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len(strings.Join(r.Index, ",")) + 1 + len("_alias") + 1 + len(strings.Join(r.Name, ","))) @@ -79,12 +95,18 @@ func (r IndicesGetAliasRequest) Do(ctx context.Context, transport Transport) (*R if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } } path.WriteString("/") path.WriteString("_alias") if len(r.Name) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Name, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", strings.Join(r.Name, ",")) + } } params = make(map[string]string) @@ -123,6 +145,9 @@ func (r IndicesGetAliasRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -150,8 +175,17 @@ func (r IndicesGetAliasRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.get_alias") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.get_alias") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.get_data_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.get_data_lifecycle.go index e99aa414c..e440c55a9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.get_data_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.get_data_lifecycle.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newIndicesGetDataLifecycleFunc(t Transport) IndicesGetDataLifecycle { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -61,16 +66,27 @@ type IndicesGetDataLifecycleRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesGetDataLifecycleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesGetDataLifecycleRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.get_data_lifecycle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" if len(r.Name) == 0 { @@ -83,6 +99,9 @@ func (r IndicesGetDataLifecycleRequest) Do(ctx context.Context, transport Transp path.WriteString("_data_stream") path.WriteString("/") path.WriteString(strings.Join(r.Name, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", strings.Join(r.Name, ",")) + } path.WriteString("/") path.WriteString("_lifecycle") @@ -114,6 +133,9 @@ func (r IndicesGetDataLifecycleRequest) Do(ctx context.Context, transport Transp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -141,8 +163,17 @@ func (r IndicesGetDataLifecycleRequest) Do(ctx context.Context, transport Transp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.get_data_lifecycle") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.get_data_lifecycle") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.get_field_mapping.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.get_field_mapping.go index 5b6553d82..d78f81a05 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.get_field_mapping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.get_field_mapping.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newIndicesGetFieldMappingFunc(t Transport) IndicesGetFieldMapping { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -64,16 +69,27 @@ type IndicesGetFieldMappingRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesGetFieldMappingRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesGetFieldMappingRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.get_field_mapping") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" if len(r.Fields) == 0 { @@ -85,6 +101,9 @@ func (r IndicesGetFieldMappingRequest) Do(ctx context.Context, transport Transpo if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } } path.WriteString("/") path.WriteString("_mapping") @@ -92,6 +111,9 @@ func (r IndicesGetFieldMappingRequest) Do(ctx context.Context, transport Transpo path.WriteString("field") path.WriteString("/") path.WriteString(strings.Join(r.Fields, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "fields", strings.Join(r.Fields, ",")) + } params = make(map[string]string) @@ -133,6 +155,9 @@ func (r IndicesGetFieldMappingRequest) Do(ctx context.Context, transport Transpo req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -160,8 +185,17 @@ func (r IndicesGetFieldMappingRequest) Do(ctx context.Context, transport Transpo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.get_field_mapping") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.get_field_mapping") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.get_index_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.get_index_template.go index f0cb5689d..227fb7ccd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.get_index_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.get_index_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newIndicesGetIndexTemplateFunc(t Transport) IndicesGetIndexTemplate { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -61,16 +66,27 @@ type IndicesGetIndexTemplateRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesGetIndexTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesGetIndexTemplateRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.get_index_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_index_template") + 1 + len(r.Name)) @@ -80,6 +96,9 @@ func (r IndicesGetIndexTemplateRequest) Do(ctx context.Context, transport Transp if r.Name != "" { path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } } params = make(map[string]string) @@ -118,6 +137,9 @@ func (r IndicesGetIndexTemplateRequest) Do(ctx context.Context, transport Transp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -145,8 +167,17 @@ func (r IndicesGetIndexTemplateRequest) Do(ctx context.Context, transport Transp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.get_index_template") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.get_index_template") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.get_mapping.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.get_mapping.go index e700c5717..f4ec0dd51 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.get_mapping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.get_mapping.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newIndicesGetMappingFunc(t Transport) IndicesGetMapping { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -62,16 +67,27 @@ type IndicesGetMappingRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesGetMappingRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesGetMappingRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.get_mapping") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len(strings.Join(r.Index, ",")) + 1 + len("_mapping")) @@ -79,6 +95,9 @@ func (r IndicesGetMappingRequest) Do(ctx context.Context, transport Transport) ( if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } } path.WriteString("/") path.WriteString("_mapping") @@ -123,6 +142,9 @@ func (r IndicesGetMappingRequest) Do(ctx context.Context, transport Transport) ( req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -150,8 +172,17 @@ func (r IndicesGetMappingRequest) Do(ctx context.Context, transport Transport) ( req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.get_mapping") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.get_mapping") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.get_settings.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.get_settings.go index cd0f73f0e..dacc4a922 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.get_settings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.get_settings.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newIndicesGetSettingsFunc(t Transport) IndicesGetSettings { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -66,16 +71,27 @@ type IndicesGetSettingsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesGetSettingsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesGetSettingsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.get_settings") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len(strings.Join(r.Index, ",")) + 1 + len("_settings") + 1 + len(strings.Join(r.Name, ","))) @@ -83,12 +99,18 @@ func (r IndicesGetSettingsRequest) Do(ctx context.Context, transport Transport) if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } } path.WriteString("/") path.WriteString("_settings") if len(r.Name) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Name, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", strings.Join(r.Name, ",")) + } } params = make(map[string]string) @@ -139,6 +161,9 @@ func (r IndicesGetSettingsRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -166,8 +191,17 @@ func (r IndicesGetSettingsRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.get_settings") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.get_settings") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.get_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.get_template.go index 0b7d9bcf4..85dc1a081 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.get_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.get_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newIndicesGetTemplateFunc(t Transport) IndicesGetTemplate { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -60,16 +65,27 @@ type IndicesGetTemplateRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesGetTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesGetTemplateRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.get_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_template") + 1 + len(strings.Join(r.Name, ","))) @@ -79,6 +95,9 @@ func (r IndicesGetTemplateRequest) Do(ctx context.Context, transport Transport) if len(r.Name) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Name, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", strings.Join(r.Name, ",")) + } } params = make(map[string]string) @@ -113,6 +132,9 @@ func (r IndicesGetTemplateRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -140,8 +162,17 @@ func (r IndicesGetTemplateRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.get_template") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.get_template") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.modify_data_stream.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.modify_data_stream.go index 04c2faacf..a1b872e3e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.modify_data_stream.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.modify_data_stream.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newIndicesModifyDataStreamFunc(t Transport) IndicesModifyDataStream { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type IndicesModifyDataStreamRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesModifyDataStreamRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesModifyDataStreamRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.modify_data_stream") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_data_stream/_modify")) @@ -91,6 +107,9 @@ func (r IndicesModifyDataStreamRequest) Do(ctx context.Context, transport Transp req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +141,20 @@ func (r IndicesModifyDataStreamRequest) Do(ctx context.Context, transport Transp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.modify_data_stream") + if reader := instrument.RecordRequestBody(ctx, "indices.modify_data_stream", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.modify_data_stream") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.open.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.open.go index bf73f4ae8..b3d7713ac 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.open.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.open.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newIndicesOpenFunc(t Transport) IndicesOpen { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -64,16 +69,27 @@ type IndicesOpenRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesOpenRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesOpenRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.open") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" if len(r.Index) == 0 { @@ -84,6 +100,9 @@ func (r IndicesOpenRequest) Do(ctx context.Context, transport Transport) (*Respo path.WriteString("http://") path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } path.WriteString("/") path.WriteString("_open") @@ -131,6 +150,9 @@ func (r IndicesOpenRequest) Do(ctx context.Context, transport Transport) (*Respo req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -158,8 +180,17 @@ func (r IndicesOpenRequest) Do(ctx context.Context, transport Transport) (*Respo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.open") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.open") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.put_alias.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.put_alias.go index 170cfaec0..ff8675f2e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.put_alias.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.put_alias.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newIndicesPutAliasFunc(t Transport) IndicesPutAlias { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -64,16 +69,27 @@ type IndicesPutAliasRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesPutAliasRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesPutAliasRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.put_alias") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" if len(r.Index) == 0 { @@ -84,10 +100,16 @@ func (r IndicesPutAliasRequest) Do(ctx context.Context, transport Transport) (*R path.WriteString("http://") path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } path.WriteString("/") path.WriteString("_aliases") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } params = make(map[string]string) @@ -117,6 +139,9 @@ func (r IndicesPutAliasRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -148,8 +173,20 @@ func (r IndicesPutAliasRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.put_alias") + if reader := instrument.RecordRequestBody(ctx, "indices.put_alias", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.put_alias") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.put_data_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.put_data_lifecycle.go index 50b281239..eaa3982fb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.put_data_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.put_data_lifecycle.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newIndicesPutDataLifecycleFunc(t Transport) IndicesPutDataLifecycle { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -65,16 +70,27 @@ type IndicesPutDataLifecycleRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesPutDataLifecycleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesPutDataLifecycleRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.put_data_lifecycle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" if len(r.Name) == 0 { @@ -87,6 +103,9 @@ func (r IndicesPutDataLifecycleRequest) Do(ctx context.Context, transport Transp path.WriteString("_data_stream") path.WriteString("/") path.WriteString(strings.Join(r.Name, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", strings.Join(r.Name, ",")) + } path.WriteString("/") path.WriteString("_lifecycle") @@ -122,6 +141,9 @@ func (r IndicesPutDataLifecycleRequest) Do(ctx context.Context, transport Transp req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -153,8 +175,20 @@ func (r IndicesPutDataLifecycleRequest) Do(ctx context.Context, transport Transp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.put_data_lifecycle") + if reader := instrument.RecordRequestBody(ctx, "indices.put_data_lifecycle", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.put_data_lifecycle") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.put_index_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.put_index_template.go index b7232c7e6..1f3ec6409 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.put_index_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.put_index_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newIndicesPutIndexTemplateFunc(t Transport) IndicesPutIndexTemplate { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -63,16 +68,27 @@ type IndicesPutIndexTemplateRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesPutIndexTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesPutIndexTemplateRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.put_index_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_index_template") + 1 + len(r.Name)) @@ -81,6 +97,9 @@ func (r IndicesPutIndexTemplateRequest) Do(ctx context.Context, transport Transp path.WriteString("_index_template") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } params = make(map[string]string) @@ -114,6 +133,9 @@ func (r IndicesPutIndexTemplateRequest) Do(ctx context.Context, transport Transp req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -145,8 +167,20 @@ func (r IndicesPutIndexTemplateRequest) Do(ctx context.Context, transport Transp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.put_index_template") + if reader := instrument.RecordRequestBody(ctx, "indices.put_index_template", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.put_index_template") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.put_mapping.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.put_mapping.go index 30077ba25..6456028ea 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.put_mapping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.put_mapping.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newIndicesPutMappingFunc(t Transport) IndicesPutMapping { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -66,16 +71,27 @@ type IndicesPutMappingRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesPutMappingRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesPutMappingRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.put_mapping") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(len(strings.Join(r.Index, ",")) + len("/_mapping") + 1) @@ -130,6 +146,9 @@ func (r IndicesPutMappingRequest) Do(ctx context.Context, transport Transport) ( req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -161,8 +180,20 @@ func (r IndicesPutMappingRequest) Do(ctx context.Context, transport Transport) ( req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.put_mapping") + if reader := instrument.RecordRequestBody(ctx, "indices.put_mapping", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.put_mapping") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.put_settings.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.put_settings.go index 9df13fcc3..c55b64d2e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.put_settings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.put_settings.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newIndicesPutSettingsFunc(t Transport) IndicesPutSettings { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,6 +62,7 @@ type IndicesPutSettingsRequest struct { IgnoreUnavailable *bool MasterTimeout time.Duration PreserveExisting *bool + Reopen *bool Timeout time.Duration Pretty bool @@ -67,16 +73,27 @@ type IndicesPutSettingsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesPutSettingsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesPutSettingsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.put_settings") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len(strings.Join(r.Index, ",")) + 1 + len("_settings")) @@ -84,6 +101,9 @@ func (r IndicesPutSettingsRequest) Do(ctx context.Context, transport Transport) if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } } path.WriteString("/") path.WriteString("_settings") @@ -114,6 +134,10 @@ func (r IndicesPutSettingsRequest) Do(ctx context.Context, transport Transport) params["preserve_existing"] = strconv.FormatBool(*r.PreserveExisting) } + if r.Reopen != nil { + params["reopen"] = strconv.FormatBool(*r.Reopen) + } + if r.Timeout != 0 { params["timeout"] = formatDuration(r.Timeout) } @@ -136,6 +160,9 @@ func (r IndicesPutSettingsRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -167,8 +194,20 @@ func (r IndicesPutSettingsRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.put_settings") + if reader := instrument.RecordRequestBody(ctx, "indices.put_settings", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.put_settings") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -237,6 +276,13 @@ func (f IndicesPutSettings) WithPreserveExisting(v bool) func(*IndicesPutSetting } } +// WithReopen - whether to close and reopen the index to apply non-dynamic settings. if set to `true` the indices to which the settings are being applied will be closed temporarily and then reopened in order to apply the changes. the default is `false`. +func (f IndicesPutSettings) WithReopen(v bool) func(*IndicesPutSettingsRequest) { + return func(r *IndicesPutSettingsRequest) { + r.Reopen = &v + } +} + // WithTimeout - explicit operation timeout. func (f IndicesPutSettings) WithTimeout(v time.Duration) func(*IndicesPutSettingsRequest) { return func(r *IndicesPutSettingsRequest) { diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.put_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.put_template.go index e87a80af7..c8d768c78 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.put_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.put_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newIndicesPutTemplateFunc(t Transport) IndicesPutTemplate { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -63,16 +68,27 @@ type IndicesPutTemplateRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesPutTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesPutTemplateRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.put_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_template") + 1 + len(r.Name)) @@ -81,6 +97,9 @@ func (r IndicesPutTemplateRequest) Do(ctx context.Context, transport Transport) path.WriteString("_template") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } params = make(map[string]string) @@ -114,6 +133,9 @@ func (r IndicesPutTemplateRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -145,8 +167,20 @@ func (r IndicesPutTemplateRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.put_template") + if reader := instrument.RecordRequestBody(ctx, "indices.put_template", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.put_template") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.recovery.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.recovery.go index 09dfc88b3..35cef83a8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.recovery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.recovery.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newIndicesRecoveryFunc(t Transport) IndicesRecovery { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -58,16 +63,27 @@ type IndicesRecoveryRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesRecoveryRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesRecoveryRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.recovery") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len(strings.Join(r.Index, ",")) + 1 + len("_recovery")) @@ -75,6 +91,9 @@ func (r IndicesRecoveryRequest) Do(ctx context.Context, transport Transport) (*R if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } } path.WriteString("/") path.WriteString("_recovery") @@ -107,6 +126,9 @@ func (r IndicesRecoveryRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -134,8 +156,17 @@ func (r IndicesRecoveryRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.recovery") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.recovery") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.refresh.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.refresh.go index 21d4f78c6..32dd5d52e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.refresh.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.refresh.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newIndicesRefreshFunc(t Transport) IndicesRefresh { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -59,16 +64,27 @@ type IndicesRefreshRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesRefreshRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesRefreshRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.refresh") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(strings.Join(r.Index, ",")) + 1 + len("_refresh")) @@ -76,6 +92,9 @@ func (r IndicesRefreshRequest) Do(ctx context.Context, transport Transport) (*Re if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } } path.WriteString("/") path.WriteString("_refresh") @@ -112,6 +131,9 @@ func (r IndicesRefreshRequest) Do(ctx context.Context, transport Transport) (*Re req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -139,8 +161,17 @@ func (r IndicesRefreshRequest) Do(ctx context.Context, transport Transport) (*Re req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.refresh") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.refresh") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.resolve_index.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.resolve_index.go index aba410930..c045ca42c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.resolve_index.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.resolve_index.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newIndicesResolveIndexFunc(t Transport) IndicesResolveIndex { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type IndicesResolveIndexRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesResolveIndexRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesResolveIndexRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.resolve_index") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" if len(r.Name) == 0 { @@ -81,6 +97,9 @@ func (r IndicesResolveIndexRequest) Do(ctx context.Context, transport Transport) path.WriteString("index") path.WriteString("/") path.WriteString(strings.Join(r.Name, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", strings.Join(r.Name, ",")) + } params = make(map[string]string) @@ -106,6 +125,9 @@ func (r IndicesResolveIndexRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -133,8 +155,17 @@ func (r IndicesResolveIndexRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.resolve_index") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.resolve_index") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.rollover.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.rollover.go index d436938bf..13f1cafb1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.rollover.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.rollover.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newIndicesRolloverFunc(t Transport) IndicesRollover { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -66,27 +71,44 @@ type IndicesRolloverRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesRolloverRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesRolloverRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.rollover") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(r.Alias) + 1 + len("_rollover") + 1 + len(r.NewIndex)) path.WriteString("http://") path.WriteString("/") path.WriteString(r.Alias) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "alias", r.Alias) + } path.WriteString("/") path.WriteString("_rollover") if r.NewIndex != "" { path.WriteString("/") path.WriteString(r.NewIndex) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "new_index", r.NewIndex) + } } params = make(map[string]string) @@ -125,6 +147,9 @@ func (r IndicesRolloverRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -156,8 +181,20 @@ func (r IndicesRolloverRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.rollover") + if reader := instrument.RecordRequestBody(ctx, "indices.rollover", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.rollover") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.segments.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.segments.go index 26b461346..d1af450e7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.segments.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.segments.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newIndicesSegmentsFunc(t Transport) IndicesSegments { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -60,16 +65,27 @@ type IndicesSegmentsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesSegmentsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesSegmentsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.segments") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len(strings.Join(r.Index, ",")) + 1 + len("_segments")) @@ -77,6 +93,9 @@ func (r IndicesSegmentsRequest) Do(ctx context.Context, transport Transport) (*R if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } } path.WriteString("/") path.WriteString("_segments") @@ -117,6 +136,9 @@ func (r IndicesSegmentsRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -144,8 +166,17 @@ func (r IndicesSegmentsRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.segments") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.segments") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.shard_stores.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.shard_stores.go index ac28971fa..9f27ae9b6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.shard_stores.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.shard_stores.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newIndicesShardStoresFunc(t Transport) IndicesShardStores { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -60,16 +65,27 @@ type IndicesShardStoresRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesShardStoresRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesShardStoresRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.shard_stores") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len(strings.Join(r.Index, ",")) + 1 + len("_shard_stores")) @@ -77,6 +93,9 @@ func (r IndicesShardStoresRequest) Do(ctx context.Context, transport Transport) if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } } path.WriteString("/") path.WriteString("_shard_stores") @@ -117,6 +136,9 @@ func (r IndicesShardStoresRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -144,8 +166,17 @@ func (r IndicesShardStoresRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.shard_stores") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.shard_stores") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.shrink.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.shrink.go index 72a2ffa89..37a8e5249 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.shrink.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.shrink.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newIndicesShrinkFunc(t Transport) IndicesShrink { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -64,26 +69,43 @@ type IndicesShrinkRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesShrinkRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesShrinkRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.shrink") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len(r.Index) + 1 + len("_shrink") + 1 + len(r.Target)) path.WriteString("http://") path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } path.WriteString("/") path.WriteString("_shrink") path.WriteString("/") path.WriteString(r.Target) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "target", r.Target) + } params = make(map[string]string) @@ -117,6 +139,9 @@ func (r IndicesShrinkRequest) Do(ctx context.Context, transport Transport) (*Res req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -148,8 +173,20 @@ func (r IndicesShrinkRequest) Do(ctx context.Context, transport Transport) (*Res req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.shrink") + if reader := instrument.RecordRequestBody(ctx, "indices.shrink", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.shrink") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.simulate_index_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.simulate_index_template.go index de7812883..efc3a7882 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.simulate_index_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.simulate_index_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newIndicesSimulateIndexTemplateFunc(t Transport) IndicesSimulateIndexTempla for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -64,16 +69,27 @@ type IndicesSimulateIndexTemplateRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesSimulateIndexTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesSimulateIndexTemplateRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.simulate_index_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_index_template") + 1 + len("_simulate_index") + 1 + len(r.Name)) @@ -84,6 +100,9 @@ func (r IndicesSimulateIndexTemplateRequest) Do(ctx context.Context, transport T path.WriteString("_simulate_index") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } params = make(map[string]string) @@ -121,6 +140,9 @@ func (r IndicesSimulateIndexTemplateRequest) Do(ctx context.Context, transport T req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -152,8 +174,20 @@ func (r IndicesSimulateIndexTemplateRequest) Do(ctx context.Context, transport T req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.simulate_index_template") + if reader := instrument.RecordRequestBody(ctx, "indices.simulate_index_template", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.simulate_index_template") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.simulate_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.simulate_template.go index 80b0ce27c..50df5693a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.simulate_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.simulate_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newIndicesSimulateTemplateFunc(t Transport) IndicesSimulateTemplate { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -64,16 +69,27 @@ type IndicesSimulateTemplateRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesSimulateTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesSimulateTemplateRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.simulate_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_index_template") + 1 + len("_simulate") + 1 + len(r.Name)) @@ -85,6 +101,9 @@ func (r IndicesSimulateTemplateRequest) Do(ctx context.Context, transport Transp if r.Name != "" { path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } } params = make(map[string]string) @@ -123,6 +142,9 @@ func (r IndicesSimulateTemplateRequest) Do(ctx context.Context, transport Transp req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -154,8 +176,20 @@ func (r IndicesSimulateTemplateRequest) Do(ctx context.Context, transport Transp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.simulate_template") + if reader := instrument.RecordRequestBody(ctx, "indices.simulate_template", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.simulate_template") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.split.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.split.go index 476b6cce4..9c2b067e4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.split.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.split.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newIndicesSplitFunc(t Transport) IndicesSplit { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -64,26 +69,43 @@ type IndicesSplitRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesSplitRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesSplitRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.split") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len(r.Index) + 1 + len("_split") + 1 + len(r.Target)) path.WriteString("http://") path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } path.WriteString("/") path.WriteString("_split") path.WriteString("/") path.WriteString(r.Target) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "target", r.Target) + } params = make(map[string]string) @@ -117,6 +139,9 @@ func (r IndicesSplitRequest) Do(ctx context.Context, transport Transport) (*Resp req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -148,8 +173,20 @@ func (r IndicesSplitRequest) Do(ctx context.Context, transport Transport) (*Resp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.split") + if reader := instrument.RecordRequestBody(ctx, "indices.split", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.split") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.stats.go index a84b99d79..d8da8ae0d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newIndicesStatsFunc(t Transport) IndicesStats { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -67,16 +72,27 @@ type IndicesStatsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesStatsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len(strings.Join(r.Index, ",")) + 1 + len("_stats") + 1 + len(strings.Join(r.Metric, ","))) @@ -84,12 +100,18 @@ func (r IndicesStatsRequest) Do(ctx context.Context, transport Transport) (*Resp if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } } path.WriteString("/") path.WriteString("_stats") if len(r.Metric) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Metric, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "metric", strings.Join(r.Metric, ",")) + } } params = make(map[string]string) @@ -148,6 +170,9 @@ func (r IndicesStatsRequest) Do(ctx context.Context, transport Transport) (*Resp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,8 +200,17 @@ func (r IndicesStatsRequest) Do(ctx context.Context, transport Transport) (*Resp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.stats") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.stats") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.update_aliases.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.update_aliases.go index 51419ae2b..32a9a7629 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.update_aliases.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.update_aliases.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newIndicesUpdateAliasesFunc(t Transport) IndicesUpdateAliases { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -59,16 +64,27 @@ type IndicesUpdateAliasesRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesUpdateAliasesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesUpdateAliasesRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.update_aliases") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_aliases")) @@ -103,6 +119,9 @@ func (r IndicesUpdateAliasesRequest) Do(ctx context.Context, transport Transport req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -134,8 +153,20 @@ func (r IndicesUpdateAliasesRequest) Do(ctx context.Context, transport Transport req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.update_aliases") + if reader := instrument.RecordRequestBody(ctx, "indices.update_aliases", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.update_aliases") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.validate_query.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.validate_query.go index 57a5c744f..c9532ae01 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.validate_query.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.indices.validate_query.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newIndicesValidateQueryFunc(t Transport) IndicesValidateQuery { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -71,16 +76,27 @@ type IndicesValidateQueryRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesValidateQueryRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesValidateQueryRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.validate_query") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(strings.Join(r.Index, ",")) + 1 + len("_validate") + 1 + len("query")) @@ -88,6 +104,9 @@ func (r IndicesValidateQueryRequest) Do(ctx context.Context, transport Transport if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } } path.WriteString("/") path.WriteString("_validate") @@ -162,6 +181,9 @@ func (r IndicesValidateQueryRequest) Do(ctx context.Context, transport Transport req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -193,8 +215,20 @@ func (r IndicesValidateQueryRequest) Do(ctx context.Context, transport Transport req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.validate_query") + if reader := instrument.RecordRequestBody(ctx, "indices.validate_query", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.validate_query") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.inference.delete_model.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.inference.delete_model.go index 3210092cb..c6c3c8ec8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.inference.delete_model.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.inference.delete_model.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newInferenceDeleteModelFunc(t Transport) InferenceDeleteModel { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type InferenceDeleteModelRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r InferenceDeleteModelRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r InferenceDeleteModelRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "inference.delete_model") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_inference") + 1 + len(r.TaskType) + 1 + len(r.ModelID)) @@ -75,8 +91,14 @@ func (r InferenceDeleteModelRequest) Do(ctx context.Context, transport Transport path.WriteString("_inference") path.WriteString("/") path.WriteString(r.TaskType) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "task_type", r.TaskType) + } path.WriteString("/") path.WriteString(r.ModelID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "model_id", r.ModelID) + } params = make(map[string]string) @@ -98,6 +120,9 @@ func (r InferenceDeleteModelRequest) Do(ctx context.Context, transport Transport req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -125,8 +150,17 @@ func (r InferenceDeleteModelRequest) Do(ctx context.Context, transport Transport req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "inference.delete_model") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "inference.delete_model") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.inference.get_model.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.inference.get_model.go index 2fd7e665e..be1590dcb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.inference.get_model.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.inference.get_model.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newInferenceGetModelFunc(t Transport) InferenceGetModel { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type InferenceGetModelRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r InferenceGetModelRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r InferenceGetModelRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "inference.get_model") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_inference") + 1 + len(r.TaskType) + 1 + len(r.ModelID)) @@ -75,8 +91,14 @@ func (r InferenceGetModelRequest) Do(ctx context.Context, transport Transport) ( path.WriteString("_inference") path.WriteString("/") path.WriteString(r.TaskType) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "task_type", r.TaskType) + } path.WriteString("/") path.WriteString(r.ModelID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "model_id", r.ModelID) + } params = make(map[string]string) @@ -98,6 +120,9 @@ func (r InferenceGetModelRequest) Do(ctx context.Context, transport Transport) ( req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -125,8 +150,17 @@ func (r InferenceGetModelRequest) Do(ctx context.Context, transport Transport) ( req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "inference.get_model") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "inference.get_model") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.inference.inference.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.inference.inference.go index 82e17f5b5..5b5748f66 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.inference.inference.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.inference.inference.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newInferenceInferenceFunc(t Transport) InferenceInference { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -60,16 +65,27 @@ type InferenceInferenceRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r InferenceInferenceRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r InferenceInferenceRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "inference.inference") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_inference") + 1 + len(r.TaskType) + 1 + len(r.ModelID)) @@ -78,8 +94,14 @@ func (r InferenceInferenceRequest) Do(ctx context.Context, transport Transport) path.WriteString("_inference") path.WriteString("/") path.WriteString(r.TaskType) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "task_type", r.TaskType) + } path.WriteString("/") path.WriteString(r.ModelID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "model_id", r.ModelID) + } params = make(map[string]string) @@ -101,6 +123,9 @@ func (r InferenceInferenceRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -132,8 +157,20 @@ func (r InferenceInferenceRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "inference.inference") + if reader := instrument.RecordRequestBody(ctx, "inference.inference", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "inference.inference") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.inference.put_model.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.inference.put_model.go index 7e5cc99f9..faa3c1c7a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.inference.put_model.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.inference.put_model.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newInferencePutModelFunc(t Transport) InferencePutModel { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -60,16 +65,27 @@ type InferencePutModelRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r InferencePutModelRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r InferencePutModelRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "inference.put_model") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_inference") + 1 + len(r.TaskType) + 1 + len(r.ModelID)) @@ -78,8 +94,14 @@ func (r InferencePutModelRequest) Do(ctx context.Context, transport Transport) ( path.WriteString("_inference") path.WriteString("/") path.WriteString(r.TaskType) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "task_type", r.TaskType) + } path.WriteString("/") path.WriteString(r.ModelID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "model_id", r.ModelID) + } params = make(map[string]string) @@ -101,6 +123,9 @@ func (r InferencePutModelRequest) Do(ctx context.Context, transport Transport) ( req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -132,8 +157,20 @@ func (r InferencePutModelRequest) Do(ctx context.Context, transport Transport) ( req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "inference.put_model") + if reader := instrument.RecordRequestBody(ctx, "inference.put_model", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "inference.put_model") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.info.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.info.go index d24d44302..92a7f1cb6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.info.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.info.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newInfoFunc(t Transport) Info { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type InfoRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r InfoRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r InfoRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "info") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/")) @@ -88,6 +104,9 @@ func (r InfoRequest) Do(ctx context.Context, transport Transport) (*Response, er req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r InfoRequest) Do(ctx context.Context, transport Transport) (*Response, er req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "info") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "info") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.ingest.delete_pipeline.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.ingest.delete_pipeline.go index 26c22c3c9..770c39a88 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.ingest.delete_pipeline.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.ingest.delete_pipeline.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newIngestDeletePipelineFunc(t Transport) IngestDeletePipeline { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -58,16 +63,27 @@ type IngestDeletePipelineRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IngestDeletePipelineRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IngestDeletePipelineRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ingest.delete_pipeline") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_ingest") + 1 + len("pipeline") + 1 + len(r.PipelineID)) @@ -78,6 +94,9 @@ func (r IngestDeletePipelineRequest) Do(ctx context.Context, transport Transport path.WriteString("pipeline") path.WriteString("/") path.WriteString(r.PipelineID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.PipelineID) + } params = make(map[string]string) @@ -107,6 +126,9 @@ func (r IngestDeletePipelineRequest) Do(ctx context.Context, transport Transport req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -134,8 +156,17 @@ func (r IngestDeletePipelineRequest) Do(ctx context.Context, transport Transport req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ingest.delete_pipeline") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ingest.delete_pipeline") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.ingest.geo_ip_stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.ingest.geo_ip_stats.go index 04072692a..dc2eef010 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.ingest.geo_ip_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.ingest.geo_ip_stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newIngestGeoIPStatsFunc(t Transport) IngestGeoIPStats { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type IngestGeoIPStatsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IngestGeoIPStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IngestGeoIPStatsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ingest.geo_ip_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_ingest/geoip/stats")) @@ -88,6 +104,9 @@ func (r IngestGeoIPStatsRequest) Do(ctx context.Context, transport Transport) (* req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r IngestGeoIPStatsRequest) Do(ctx context.Context, transport Transport) (* req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ingest.geo_ip_stats") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ingest.geo_ip_stats") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.ingest.get_pipeline.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.ingest.get_pipeline.go index 6b58c5de4..82977b9db 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.ingest.get_pipeline.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.ingest.get_pipeline.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newIngestGetPipelineFunc(t Transport) IngestGetPipeline { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -59,16 +64,27 @@ type IngestGetPipelineRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IngestGetPipelineRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IngestGetPipelineRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ingest.get_pipeline") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_ingest") + 1 + len("pipeline") + 1 + len(r.PipelineID)) @@ -80,6 +96,9 @@ func (r IngestGetPipelineRequest) Do(ctx context.Context, transport Transport) ( if r.PipelineID != "" { path.WriteString("/") path.WriteString(r.PipelineID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.PipelineID) + } } params = make(map[string]string) @@ -110,6 +129,9 @@ func (r IngestGetPipelineRequest) Do(ctx context.Context, transport Transport) ( req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -137,8 +159,17 @@ func (r IngestGetPipelineRequest) Do(ctx context.Context, transport Transport) ( req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ingest.get_pipeline") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ingest.get_pipeline") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.ingest.processor_grok.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.ingest.processor_grok.go index 63217bf8c..a3ecf9ea9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.ingest.processor_grok.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.ingest.processor_grok.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newIngestProcessorGrokFunc(t Transport) IngestProcessorGrok { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type IngestProcessorGrokRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IngestProcessorGrokRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IngestProcessorGrokRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ingest.processor_grok") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_ingest/processor/grok")) @@ -88,6 +104,9 @@ func (r IngestProcessorGrokRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r IngestProcessorGrokRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ingest.processor_grok") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ingest.processor_grok") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.ingest.put_pipeline.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.ingest.put_pipeline.go index c291accf3..e10755885 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.ingest.put_pipeline.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.ingest.put_pipeline.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newIngestPutPipelineFunc(t Transport) IngestPutPipeline { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -63,16 +68,27 @@ type IngestPutPipelineRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IngestPutPipelineRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IngestPutPipelineRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ingest.put_pipeline") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_ingest") + 1 + len("pipeline") + 1 + len(r.PipelineID)) @@ -83,6 +99,9 @@ func (r IngestPutPipelineRequest) Do(ctx context.Context, transport Transport) ( path.WriteString("pipeline") path.WriteString("/") path.WriteString(r.PipelineID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.PipelineID) + } params = make(map[string]string) @@ -116,6 +135,9 @@ func (r IngestPutPipelineRequest) Do(ctx context.Context, transport Transport) ( req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -147,8 +169,20 @@ func (r IngestPutPipelineRequest) Do(ctx context.Context, transport Transport) ( req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ingest.put_pipeline") + if reader := instrument.RecordRequestBody(ctx, "ingest.put_pipeline", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ingest.put_pipeline") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.ingest.simulate.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.ingest.simulate.go index 3b5f3ee0f..153a8b1fa 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.ingest.simulate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.ingest.simulate.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newIngestSimulateFunc(t Transport) IngestSimulate { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -60,16 +65,27 @@ type IngestSimulateRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IngestSimulateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IngestSimulateRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ingest.simulate") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ingest") + 1 + len("pipeline") + 1 + len(r.PipelineID) + 1 + len("_simulate")) @@ -81,6 +97,9 @@ func (r IngestSimulateRequest) Do(ctx context.Context, transport Transport) (*Re if r.PipelineID != "" { path.WriteString("/") path.WriteString(r.PipelineID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.PipelineID) + } } path.WriteString("/") path.WriteString("_simulate") @@ -109,6 +128,9 @@ func (r IngestSimulateRequest) Do(ctx context.Context, transport Transport) (*Re req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -140,8 +162,20 @@ func (r IngestSimulateRequest) Do(ctx context.Context, transport Transport) (*Re req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ingest.simulate") + if reader := instrument.RecordRequestBody(ctx, "ingest.simulate", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ingest.simulate") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.knn_search.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.knn_search.go index a70e6e5a1..9b775510b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.knn_search.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.knn_search.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newKnnSearchFunc(t Transport) KnnSearch { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -62,16 +67,27 @@ type KnnSearchRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r KnnSearchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r KnnSearchRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "knn_search") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" if len(r.Index) == 0 { @@ -82,6 +98,9 @@ func (r KnnSearchRequest) Do(ctx context.Context, transport Transport) (*Respons path.WriteString("http://") path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } path.WriteString("/") path.WriteString("_knn_search") @@ -109,6 +128,9 @@ func (r KnnSearchRequest) Do(ctx context.Context, transport Transport) (*Respons req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -140,8 +162,20 @@ func (r KnnSearchRequest) Do(ctx context.Context, transport Transport) (*Respons req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "knn_search") + if reader := instrument.RecordRequestBody(ctx, "knn_search", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "knn_search") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.mget.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.mget.go index eb6054ac1..cf00011a5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.mget.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.mget.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newMgetFunc(t Transport) Mget { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -68,16 +73,27 @@ type MgetRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MgetRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MgetRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "mget") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(r.Index) + 1 + len("_mget")) @@ -85,6 +101,9 @@ func (r MgetRequest) Do(ctx context.Context, transport Transport) (*Response, er if r.Index != "" { path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } } path.WriteString("/") path.WriteString("_mget") @@ -145,6 +164,9 @@ func (r MgetRequest) Do(ctx context.Context, transport Transport) (*Response, er req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -176,8 +198,20 @@ func (r MgetRequest) Do(ctx context.Context, transport Transport) (*Response, er req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "mget") + if reader := instrument.RecordRequestBody(ctx, "mget", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "mget") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.msearch.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.msearch.go index 77ca3de34..5c3f1032c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.msearch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.msearch.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newMsearchFunc(t Transport) Msearch { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -66,16 +71,27 @@ type MsearchRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MsearchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MsearchRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "msearch") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(strings.Join(r.Index, ",")) + 1 + len("_msearch")) @@ -83,6 +99,9 @@ func (r MsearchRequest) Do(ctx context.Context, transport Transport) (*Response, if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } } path.WriteString("/") path.WriteString("_msearch") @@ -135,6 +154,9 @@ func (r MsearchRequest) Do(ctx context.Context, transport Transport) (*Response, req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -166,8 +188,20 @@ func (r MsearchRequest) Do(ctx context.Context, transport Transport) (*Response, req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "msearch") + if reader := instrument.RecordRequestBody(ctx, "msearch", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "msearch") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.msearch_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.msearch_template.go index 414d6d130..cf3dff32b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.msearch_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.msearch_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newMsearchTemplateFunc(t Transport) MsearchTemplate { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -64,16 +69,27 @@ type MsearchTemplateRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MsearchTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MsearchTemplateRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "msearch_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(strings.Join(r.Index, ",")) + 1 + len("_msearch") + 1 + len("template")) @@ -81,6 +97,9 @@ func (r MsearchTemplateRequest) Do(ctx context.Context, transport Transport) (*R if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } } path.WriteString("/") path.WriteString("_msearch") @@ -127,6 +146,9 @@ func (r MsearchTemplateRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -158,8 +180,20 @@ func (r MsearchTemplateRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "msearch_template") + if reader := instrument.RecordRequestBody(ctx, "msearch_template", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "msearch_template") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.mtermvectors.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.mtermvectors.go index 3df6b2d24..6cb1109f9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.mtermvectors.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.mtermvectors.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newMtermvectorsFunc(t Transport) Mtermvectors { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -71,16 +76,27 @@ type MtermvectorsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MtermvectorsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MtermvectorsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "mtermvectors") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(r.Index) + 1 + len("_mtermvectors")) @@ -88,6 +104,9 @@ func (r MtermvectorsRequest) Do(ctx context.Context, transport Transport) (*Resp if r.Index != "" { path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } } path.WriteString("/") path.WriteString("_mtermvectors") @@ -160,6 +179,9 @@ func (r MtermvectorsRequest) Do(ctx context.Context, transport Transport) (*Resp req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -191,8 +213,20 @@ func (r MtermvectorsRequest) Do(ctx context.Context, transport Transport) (*Resp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "mtermvectors") + if reader := instrument.RecordRequestBody(ctx, "mtermvectors", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "mtermvectors") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.nodes.clear_repositories_metering_archive.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.nodes.clear_repositories_metering_archive.go index 43d8a6c83..72da992cb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.nodes.clear_repositories_metering_archive.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.nodes.clear_repositories_metering_archive.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newNodesClearRepositoriesMeteringArchiveFunc(t Transport) NodesClearReposit for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -59,16 +64,27 @@ type NodesClearRepositoriesMeteringArchiveRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r NodesClearRepositoriesMeteringArchiveRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r NodesClearRepositoriesMeteringArchiveRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "nodes.clear_repositories_metering_archive") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" if len(r.NodeID) == 0 { @@ -84,10 +100,16 @@ func (r NodesClearRepositoriesMeteringArchiveRequest) Do(ctx context.Context, tr path.WriteString("_nodes") path.WriteString("/") path.WriteString(strings.Join(r.NodeID, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "node_id", strings.Join(r.NodeID, ",")) + } path.WriteString("/") path.WriteString("_repositories_metering") path.WriteString("/") path.WriteString(strconv.Itoa(*r.MaxArchiveVersion)) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "max_archive_version", strconv.Itoa(*r.MaxArchiveVersion)) + } params = make(map[string]string) @@ -109,6 +131,9 @@ func (r NodesClearRepositoriesMeteringArchiveRequest) Do(ctx context.Context, tr req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -136,8 +161,17 @@ func (r NodesClearRepositoriesMeteringArchiveRequest) Do(ctx context.Context, tr req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "nodes.clear_repositories_metering_archive") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "nodes.clear_repositories_metering_archive") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.nodes.get_repositories_metering_info.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.nodes.get_repositories_metering_info.go index 53b965d25..67a9f1a49 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.nodes.get_repositories_metering_info.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.nodes.get_repositories_metering_info.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newNodesGetRepositoriesMeteringInfoFunc(t Transport) NodesGetRepositoriesMe for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type NodesGetRepositoriesMeteringInfoRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r NodesGetRepositoriesMeteringInfoRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r NodesGetRepositoriesMeteringInfoRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "nodes.get_repositories_metering_info") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" if len(r.NodeID) == 0 { @@ -79,6 +95,9 @@ func (r NodesGetRepositoriesMeteringInfoRequest) Do(ctx context.Context, transpo path.WriteString("_nodes") path.WriteString("/") path.WriteString(strings.Join(r.NodeID, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "node_id", strings.Join(r.NodeID, ",")) + } path.WriteString("/") path.WriteString("_repositories_metering") @@ -102,6 +121,9 @@ func (r NodesGetRepositoriesMeteringInfoRequest) Do(ctx context.Context, transpo req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -129,8 +151,17 @@ func (r NodesGetRepositoriesMeteringInfoRequest) Do(ctx context.Context, transpo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "nodes.get_repositories_metering_info") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "nodes.get_repositories_metering_info") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.nodes.hot_threads.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.nodes.hot_threads.go index 5904193c2..899a33d95 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.nodes.hot_threads.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.nodes.hot_threads.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newNodesHotThreadsFunc(t Transport) NodesHotThreads { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -64,16 +69,27 @@ type NodesHotThreadsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r NodesHotThreadsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r NodesHotThreadsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "nodes.hot_threads") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_nodes") + 1 + len(strings.Join(r.NodeID, ",")) + 1 + len("hot_threads")) @@ -83,6 +99,9 @@ func (r NodesHotThreadsRequest) Do(ctx context.Context, transport Transport) (*R if len(r.NodeID) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.NodeID, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "node_id", strings.Join(r.NodeID, ",")) + } } path.WriteString("/") path.WriteString("hot_threads") @@ -135,6 +154,9 @@ func (r NodesHotThreadsRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -162,8 +184,17 @@ func (r NodesHotThreadsRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "nodes.hot_threads") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "nodes.hot_threads") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.nodes.info.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.nodes.info.go index 354c9f7ae..5273b65bd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.nodes.info.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.nodes.info.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newNodesInfoFunc(t Transport) NodesInfo { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -60,16 +65,27 @@ type NodesInfoRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r NodesInfoRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r NodesInfoRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "nodes.info") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_nodes") + 1 + len(strings.Join(r.NodeID, ",")) + 1 + len(strings.Join(r.Metric, ","))) @@ -79,10 +95,16 @@ func (r NodesInfoRequest) Do(ctx context.Context, transport Transport) (*Respons if len(r.NodeID) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.NodeID, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "node_id", strings.Join(r.NodeID, ",")) + } } if len(r.Metric) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Metric, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "metric", strings.Join(r.Metric, ",")) + } } params = make(map[string]string) @@ -113,6 +135,9 @@ func (r NodesInfoRequest) Do(ctx context.Context, transport Transport) (*Respons req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -140,8 +165,17 @@ func (r NodesInfoRequest) Do(ctx context.Context, transport Transport) (*Respons req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "nodes.info") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "nodes.info") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.nodes.reload_secure_settings.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.nodes.reload_secure_settings.go index 7f5312d7f..a38ed5079 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.nodes.reload_secure_settings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.nodes.reload_secure_settings.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newNodesReloadSecureSettingsFunc(t Transport) NodesReloadSecureSettings { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -60,16 +65,27 @@ type NodesReloadSecureSettingsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r NodesReloadSecureSettingsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r NodesReloadSecureSettingsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "nodes.reload_secure_settings") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_nodes") + 1 + len(strings.Join(r.NodeID, ",")) + 1 + len("reload_secure_settings")) @@ -79,6 +95,9 @@ func (r NodesReloadSecureSettingsRequest) Do(ctx context.Context, transport Tran if len(r.NodeID) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.NodeID, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "node_id", strings.Join(r.NodeID, ",")) + } } path.WriteString("/") path.WriteString("reload_secure_settings") @@ -107,6 +126,9 @@ func (r NodesReloadSecureSettingsRequest) Do(ctx context.Context, transport Tran req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -138,8 +160,20 @@ func (r NodesReloadSecureSettingsRequest) Do(ctx context.Context, transport Tran req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "nodes.reload_secure_settings") + if reader := instrument.RecordRequestBody(ctx, "nodes.reload_secure_settings", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "nodes.reload_secure_settings") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.nodes.stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.nodes.stats.go index 73e4860ec..24ceb4e78 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.nodes.stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.nodes.stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newNodesStatsFunc(t Transport) NodesStats { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -68,16 +73,27 @@ type NodesStatsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r NodesStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r NodesStatsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "nodes.stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_nodes") + 1 + len(strings.Join(r.NodeID, ",")) + 1 + len("stats") + 1 + len(strings.Join(r.Metric, ",")) + 1 + len(strings.Join(r.IndexMetric, ","))) @@ -87,16 +103,25 @@ func (r NodesStatsRequest) Do(ctx context.Context, transport Transport) (*Respon if len(r.NodeID) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.NodeID, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "node_id", strings.Join(r.NodeID, ",")) + } } path.WriteString("/") path.WriteString("stats") if len(r.Metric) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Metric, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "metric", strings.Join(r.Metric, ",")) + } } if len(r.IndexMetric) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.IndexMetric, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index_metric", strings.Join(r.IndexMetric, ",")) + } } params = make(map[string]string) @@ -155,6 +180,9 @@ func (r NodesStatsRequest) Do(ctx context.Context, transport Transport) (*Respon req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,8 +210,17 @@ func (r NodesStatsRequest) Do(ctx context.Context, transport Transport) (*Respon req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "nodes.stats") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "nodes.stats") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.nodes.usage.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.nodes.usage.go index 720411919..0ca62442b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.nodes.usage.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.nodes.usage.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newNodesUsageFunc(t Transport) NodesUsage { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -58,16 +63,27 @@ type NodesUsageRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r NodesUsageRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r NodesUsageRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "nodes.usage") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_nodes") + 1 + len(strings.Join(r.NodeID, ",")) + 1 + len("usage") + 1 + len(strings.Join(r.Metric, ","))) @@ -77,12 +93,18 @@ func (r NodesUsageRequest) Do(ctx context.Context, transport Transport) (*Respon if len(r.NodeID) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.NodeID, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "node_id", strings.Join(r.NodeID, ",")) + } } path.WriteString("/") path.WriteString("usage") if len(r.Metric) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Metric, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "metric", strings.Join(r.Metric, ",")) + } } params = make(map[string]string) @@ -109,6 +131,9 @@ func (r NodesUsageRequest) Do(ctx context.Context, transport Transport) (*Respon req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -136,8 +161,17 @@ func (r NodesUsageRequest) Do(ctx context.Context, transport Transport) (*Respon req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "nodes.usage") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "nodes.usage") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.ping.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.ping.go index 4b8039673..291502feb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.ping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.ping.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newPingFunc(t Transport) Ping { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type PingRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r PingRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r PingRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ping") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "HEAD" path.Grow(7 + len("/")) @@ -88,6 +104,9 @@ func (r PingRequest) Do(ctx context.Context, transport Transport) (*Response, er req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r PingRequest) Do(ctx context.Context, transport Transport) (*Response, er req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ping") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ping") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.profiling.status.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.profiling.status.go new file mode 100644 index 000000000..d8530335c --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.profiling.status.go @@ -0,0 +1,254 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// +// Code generated from specification version 8.12.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" + "time" +) + +func newProfilingStatusFunc(t Transport) ProfilingStatus { + return func(o ...func(*ProfilingStatusRequest)) (*Response, error) { + var r = ProfilingStatusRequest{} + for _, f := range o { + f(&r) + } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// ProfilingStatus returns basic information about the status of Universal Profiling. +// +// See full documentation at https://www.elastic.co/guide/en/observability/current/universal-profiling.html. +type ProfilingStatus func(o ...func(*ProfilingStatusRequest)) (*Response, error) + +// ProfilingStatusRequest configures the Profiling Status API request. +type ProfilingStatusRequest struct { + MasterTimeout time.Duration + Timeout time.Duration + WaitForResourcesCreated *bool + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context + + instrument Instrumentation +} + +// Do executes the request and returns response or error. +func (r ProfilingStatusRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ctx context.Context + ) + + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "profiling.status") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + method = "GET" + + path.Grow(7 + len("/_profiling/status")) + path.WriteString("http://") + path.WriteString("/_profiling/status") + + params = make(map[string]string) + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.WaitForResourcesCreated != nil { + params["wait_for_resources_created"] = strconv.FormatBool(*r.WaitForResourcesCreated) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), nil) + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "profiling.status") + } + res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "profiling.status") + } + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +func (f ProfilingStatus) WithContext(v context.Context) func(*ProfilingStatusRequest) { + return func(r *ProfilingStatusRequest) { + r.ctx = v + } +} + +// WithMasterTimeout - explicit operation timeout for connection to master node. +func (f ProfilingStatus) WithMasterTimeout(v time.Duration) func(*ProfilingStatusRequest) { + return func(r *ProfilingStatusRequest) { + r.MasterTimeout = v + } +} + +// WithTimeout - explicit operation timeout. +func (f ProfilingStatus) WithTimeout(v time.Duration) func(*ProfilingStatusRequest) { + return func(r *ProfilingStatusRequest) { + r.Timeout = v + } +} + +// WithWaitForResourcesCreated - whether to return immediately or wait until resources have been created. +func (f ProfilingStatus) WithWaitForResourcesCreated(v bool) func(*ProfilingStatusRequest) { + return func(r *ProfilingStatusRequest) { + r.WaitForResourcesCreated = &v + } +} + +// WithPretty makes the response body pretty-printed. +func (f ProfilingStatus) WithPretty() func(*ProfilingStatusRequest) { + return func(r *ProfilingStatusRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +func (f ProfilingStatus) WithHuman() func(*ProfilingStatusRequest) { + return func(r *ProfilingStatusRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +func (f ProfilingStatus) WithErrorTrace() func(*ProfilingStatusRequest) { + return func(r *ProfilingStatusRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +func (f ProfilingStatus) WithFilterPath(v ...string) func(*ProfilingStatusRequest) { + return func(r *ProfilingStatusRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +func (f ProfilingStatus) WithHeader(h map[string]string) func(*ProfilingStatusRequest) { + return func(r *ProfilingStatusRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +func (f ProfilingStatus) WithOpaqueID(s string) func(*ProfilingStatusRequest) { + return func(r *ProfilingStatusRequest) { + 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/v8/esapi/api.put_script.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.put_script.go index 887124393..a33a7f5d5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.put_script.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.put_script.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newPutScriptFunc(t Transport) PutScript { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -63,16 +68,27 @@ type PutScriptRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r PutScriptRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r PutScriptRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "put_script") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_scripts") + 1 + len(r.ScriptID) + 1 + len(r.ScriptContext)) @@ -81,9 +97,15 @@ func (r PutScriptRequest) Do(ctx context.Context, transport Transport) (*Respons path.WriteString("_scripts") path.WriteString("/") path.WriteString(r.ScriptID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.ScriptID) + } if r.ScriptContext != "" { path.WriteString("/") path.WriteString(r.ScriptContext) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "context", r.ScriptContext) + } } params = make(map[string]string) @@ -118,6 +140,9 @@ func (r PutScriptRequest) Do(ctx context.Context, transport Transport) (*Respons req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -149,8 +174,20 @@ func (r PutScriptRequest) Do(ctx context.Context, transport Transport) (*Respons req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "put_script") + if reader := instrument.RecordRequestBody(ctx, "put_script", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "put_script") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.query_ruleset.delete.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.query_ruleset.delete.go index 72fcbaf9d..eb94e933d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.query_ruleset.delete.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.query_ruleset.delete.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newQueryRulesetDeleteFunc(t Transport) QueryRulesetDelete { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -56,16 +61,27 @@ type QueryRulesetDeleteRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r QueryRulesetDeleteRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r QueryRulesetDeleteRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "query_ruleset.delete") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_query_rules") + 1 + len(r.RulesetID)) @@ -74,6 +90,9 @@ func (r QueryRulesetDeleteRequest) Do(ctx context.Context, transport Transport) path.WriteString("_query_rules") path.WriteString("/") path.WriteString(r.RulesetID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "ruleset_id", r.RulesetID) + } params = make(map[string]string) @@ -95,6 +114,9 @@ func (r QueryRulesetDeleteRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +144,17 @@ func (r QueryRulesetDeleteRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "query_ruleset.delete") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "query_ruleset.delete") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.query_ruleset.get.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.query_ruleset.get.go index 7ac8ed363..ec935d3a9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.query_ruleset.get.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.query_ruleset.get.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newQueryRulesetGetFunc(t Transport) QueryRulesetGet { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -56,16 +61,27 @@ type QueryRulesetGetRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r QueryRulesetGetRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r QueryRulesetGetRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "query_ruleset.get") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_query_rules") + 1 + len(r.RulesetID)) @@ -74,6 +90,9 @@ func (r QueryRulesetGetRequest) Do(ctx context.Context, transport Transport) (*R path.WriteString("_query_rules") path.WriteString("/") path.WriteString(r.RulesetID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "ruleset_id", r.RulesetID) + } params = make(map[string]string) @@ -95,6 +114,9 @@ func (r QueryRulesetGetRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +144,17 @@ func (r QueryRulesetGetRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "query_ruleset.get") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "query_ruleset.get") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.query_ruleset.list.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.query_ruleset.list.go index cc75849ce..71090969b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.query_ruleset.list.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.query_ruleset.list.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newQueryRulesetListFunc(t Transport) QueryRulesetList { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -58,16 +63,27 @@ type QueryRulesetListRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r QueryRulesetListRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r QueryRulesetListRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "query_ruleset.list") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_query_rules")) @@ -102,6 +118,9 @@ func (r QueryRulesetListRequest) Do(ctx context.Context, transport Transport) (* req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -129,8 +148,17 @@ func (r QueryRulesetListRequest) Do(ctx context.Context, transport Transport) (* req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "query_ruleset.list") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "query_ruleset.list") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.query_ruleset.put.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.query_ruleset.put.go index c201a832f..5c385d2a5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.query_ruleset.put.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.query_ruleset.put.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newQueryRulesetPutFunc(t Transport) QueryRulesetPut { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -59,16 +64,27 @@ type QueryRulesetPutRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r QueryRulesetPutRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r QueryRulesetPutRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "query_ruleset.put") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_query_rules") + 1 + len(r.RulesetID)) @@ -77,6 +93,9 @@ func (r QueryRulesetPutRequest) Do(ctx context.Context, transport Transport) (*R path.WriteString("_query_rules") path.WriteString("/") path.WriteString(r.RulesetID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "ruleset_id", r.RulesetID) + } params = make(map[string]string) @@ -98,6 +117,9 @@ func (r QueryRulesetPutRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -129,8 +151,20 @@ func (r QueryRulesetPutRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "query_ruleset.put") + if reader := instrument.RecordRequestBody(ctx, "query_ruleset.put", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "query_ruleset.put") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.rank_eval.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.rank_eval.go index 5242a226c..0f616d699 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.rank_eval.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.rank_eval.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newRankEvalFunc(t Transport) RankEval { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -63,16 +68,27 @@ type RankEvalRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r RankEvalRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r RankEvalRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "rank_eval") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(strings.Join(r.Index, ",")) + 1 + len("_rank_eval")) @@ -80,6 +96,9 @@ func (r RankEvalRequest) Do(ctx context.Context, transport Transport) (*Response if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } } path.WriteString("/") path.WriteString("_rank_eval") @@ -120,6 +139,9 @@ func (r RankEvalRequest) Do(ctx context.Context, transport Transport) (*Response req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -151,8 +173,20 @@ func (r RankEvalRequest) Do(ctx context.Context, transport Transport) (*Response req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "rank_eval") + if reader := instrument.RecordRequestBody(ctx, "rank_eval", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "rank_eval") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.reindex.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.reindex.go index 68c250882..a7fd0db7e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.reindex.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.reindex.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -35,6 +35,11 @@ func newReindexFunc(t Transport) Reindex { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -69,16 +74,27 @@ type ReindexRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ReindexRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ReindexRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "reindex") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_reindex")) @@ -137,6 +153,9 @@ func (r ReindexRequest) Do(ctx context.Context, transport Transport) (*Response, req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -168,8 +187,20 @@ func (r ReindexRequest) Do(ctx context.Context, transport Transport) (*Response, req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "reindex") + if reader := instrument.RecordRequestBody(ctx, "reindex", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "reindex") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.reindex_rethrottle.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.reindex_rethrottle.go index 80b442f58..5d60fa869 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.reindex_rethrottle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.reindex_rethrottle.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newReindexRethrottleFunc(t Transport) ReindexRethrottle { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type ReindexRethrottleRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ReindexRethrottleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ReindexRethrottleRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "reindex_rethrottle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_reindex") + 1 + len(r.TaskID) + 1 + len("_rethrottle")) @@ -75,6 +91,9 @@ func (r ReindexRethrottleRequest) Do(ctx context.Context, transport Transport) ( path.WriteString("_reindex") path.WriteString("/") path.WriteString(r.TaskID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "task_id", r.TaskID) + } path.WriteString("/") path.WriteString("_rethrottle") @@ -102,6 +121,9 @@ func (r ReindexRethrottleRequest) Do(ctx context.Context, transport Transport) ( req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -129,8 +151,17 @@ func (r ReindexRethrottleRequest) Do(ctx context.Context, transport Transport) ( req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "reindex_rethrottle") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "reindex_rethrottle") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.render_search_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.render_search_template.go index cf120cb0e..d3184bb40 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.render_search_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.render_search_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newRenderSearchTemplateFunc(t Transport) RenderSearchTemplate { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type RenderSearchTemplateRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r RenderSearchTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r RenderSearchTemplateRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "render_search_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_render") + 1 + len("template") + 1 + len(r.TemplateID)) @@ -78,6 +94,9 @@ func (r RenderSearchTemplateRequest) Do(ctx context.Context, transport Transport if r.TemplateID != "" { path.WriteString("/") path.WriteString(r.TemplateID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.TemplateID) + } } params = make(map[string]string) @@ -100,6 +119,9 @@ func (r RenderSearchTemplateRequest) Do(ctx context.Context, transport Transport req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -131,8 +153,20 @@ func (r RenderSearchTemplateRequest) Do(ctx context.Context, transport Transport req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "render_search_template") + if reader := instrument.RecordRequestBody(ctx, "render_search_template", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "render_search_template") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.scripts_painless_execute.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.scripts_painless_execute.go index 8d4b88a84..debfe9ad4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.scripts_painless_execute.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.scripts_painless_execute.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newScriptsPainlessExecuteFunc(t Transport) ScriptsPainlessExecute { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type ScriptsPainlessExecuteRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ScriptsPainlessExecuteRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ScriptsPainlessExecuteRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "scripts_painless_execute") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_scripts/painless/_execute")) @@ -93,6 +109,9 @@ func (r ScriptsPainlessExecuteRequest) Do(ctx context.Context, transport Transpo req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -124,8 +143,20 @@ func (r ScriptsPainlessExecuteRequest) Do(ctx context.Context, transport Transpo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "scripts_painless_execute") + if reader := instrument.RecordRequestBody(ctx, "scripts_painless_execute", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "scripts_painless_execute") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.scroll.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.scroll.go index cc21f5a7a..cb413e7d0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.scroll.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.scroll.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newScrollFunc(t Transport) Scroll { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -62,16 +67,27 @@ type ScrollRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ScrollRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ScrollRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "scroll") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(len("/_search/scroll")) @@ -109,6 +125,9 @@ func (r ScrollRequest) Do(ctx context.Context, transport Transport) (*Response, req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -140,8 +159,20 @@ func (r ScrollRequest) Do(ctx context.Context, transport Transport) (*Response, req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "scroll") + if reader := instrument.RecordRequestBody(ctx, "scroll", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "scroll") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search.go index e641c9d0a..d01c24832 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -35,6 +35,11 @@ func newSearchFunc(t Transport) Search { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -106,16 +111,27 @@ type SearchRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SearchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SearchRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "search") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(strings.Join(r.Index, ",")) + 1 + len("_search")) @@ -123,6 +139,9 @@ func (r SearchRequest) Do(ctx context.Context, transport Transport) (*Response, if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } } path.WriteString("/") path.WriteString("_search") @@ -327,6 +346,9 @@ func (r SearchRequest) Do(ctx context.Context, transport Transport) (*Response, req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -358,8 +380,20 @@ func (r SearchRequest) Do(ctx context.Context, transport Transport) (*Response, req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "search") + if reader := instrument.RecordRequestBody(ctx, "search", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "search") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.delete.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.delete.go index b56695a9b..8e20d5282 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.delete.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.delete.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSearchApplicationDeleteFunc(t Transport) SearchApplicationDelete { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -56,16 +61,27 @@ type SearchApplicationDeleteRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SearchApplicationDeleteRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SearchApplicationDeleteRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "search_application.delete") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_application") + 1 + len("search_application") + 1 + len(r.Name)) @@ -76,6 +92,9 @@ func (r SearchApplicationDeleteRequest) Do(ctx context.Context, transport Transp path.WriteString("search_application") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } params = make(map[string]string) @@ -97,6 +116,9 @@ func (r SearchApplicationDeleteRequest) Do(ctx context.Context, transport Transp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -124,8 +146,17 @@ func (r SearchApplicationDeleteRequest) Do(ctx context.Context, transport Transp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "search_application.delete") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "search_application.delete") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.delete_behavioral_analytics.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.delete_behavioral_analytics.go index 5f309e49a..329f0576b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.delete_behavioral_analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.delete_behavioral_analytics.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSearchApplicationDeleteBehavioralAnalyticsFunc(t Transport) SearchApplic for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -56,16 +61,27 @@ type SearchApplicationDeleteBehavioralAnalyticsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SearchApplicationDeleteBehavioralAnalyticsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SearchApplicationDeleteBehavioralAnalyticsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "search_application.delete_behavioral_analytics") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_application") + 1 + len("analytics") + 1 + len(r.Name)) @@ -76,6 +92,9 @@ func (r SearchApplicationDeleteBehavioralAnalyticsRequest) Do(ctx context.Contex path.WriteString("analytics") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } params = make(map[string]string) @@ -97,6 +116,9 @@ func (r SearchApplicationDeleteBehavioralAnalyticsRequest) Do(ctx context.Contex req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -124,8 +146,17 @@ func (r SearchApplicationDeleteBehavioralAnalyticsRequest) Do(ctx context.Contex req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "search_application.delete_behavioral_analytics") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "search_application.delete_behavioral_analytics") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.get.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.get.go index 8d5d70890..4619d6b3c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.get.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.get.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSearchApplicationGetFunc(t Transport) SearchApplicationGet { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -56,16 +61,27 @@ type SearchApplicationGetRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SearchApplicationGetRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SearchApplicationGetRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "search_application.get") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_application") + 1 + len("search_application") + 1 + len(r.Name)) @@ -76,6 +92,9 @@ func (r SearchApplicationGetRequest) Do(ctx context.Context, transport Transport path.WriteString("search_application") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } params = make(map[string]string) @@ -97,6 +116,9 @@ func (r SearchApplicationGetRequest) Do(ctx context.Context, transport Transport req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -124,8 +146,17 @@ func (r SearchApplicationGetRequest) Do(ctx context.Context, transport Transport req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "search_application.get") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "search_application.get") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.get_behavioral_analytics.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.get_behavioral_analytics.go index 294756fd5..cba2e1298 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.get_behavioral_analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.get_behavioral_analytics.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSearchApplicationGetBehavioralAnalyticsFunc(t Transport) SearchApplicati for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -56,16 +61,27 @@ type SearchApplicationGetBehavioralAnalyticsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SearchApplicationGetBehavioralAnalyticsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SearchApplicationGetBehavioralAnalyticsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "search_application.get_behavioral_analytics") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_application") + 1 + len("analytics") + 1 + len(strings.Join(r.Name, ","))) @@ -77,6 +93,9 @@ func (r SearchApplicationGetBehavioralAnalyticsRequest) Do(ctx context.Context, if len(r.Name) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Name, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", strings.Join(r.Name, ",")) + } } params = make(map[string]string) @@ -99,6 +118,9 @@ func (r SearchApplicationGetBehavioralAnalyticsRequest) Do(ctx context.Context, req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -126,8 +148,17 @@ func (r SearchApplicationGetBehavioralAnalyticsRequest) Do(ctx context.Context, req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "search_application.get_behavioral_analytics") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "search_application.get_behavioral_analytics") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.list.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.list.go index 40638bc61..99fdc1e9e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.list.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.list.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSearchApplicationListFunc(t Transport) SearchApplicationList { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -59,16 +64,27 @@ type SearchApplicationListRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SearchApplicationListRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SearchApplicationListRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "search_application.list") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_application/search_application")) @@ -107,6 +123,9 @@ func (r SearchApplicationListRequest) Do(ctx context.Context, transport Transpor req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -134,8 +153,17 @@ func (r SearchApplicationListRequest) Do(ctx context.Context, transport Transpor req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "search_application.list") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "search_application.list") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.post_behavioral_analytics_event.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.post_behavioral_analytics_event.go index 5117067bf..65e56e5ef 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.post_behavioral_analytics_event.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.post_behavioral_analytics_event.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newSearchApplicationPostBehavioralAnalyticsEventFunc(t Transport) SearchApp for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -63,16 +68,27 @@ type SearchApplicationPostBehavioralAnalyticsEventRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SearchApplicationPostBehavioralAnalyticsEventRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SearchApplicationPostBehavioralAnalyticsEventRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "search_application.post_behavioral_analytics_event") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_application") + 1 + len("analytics") + 1 + len(r.CollectionName) + 1 + len("event") + 1 + len(r.EventType)) @@ -83,10 +99,16 @@ func (r SearchApplicationPostBehavioralAnalyticsEventRequest) Do(ctx context.Con path.WriteString("analytics") path.WriteString("/") path.WriteString(r.CollectionName) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "collection_name", r.CollectionName) + } path.WriteString("/") path.WriteString("event") path.WriteString("/") path.WriteString(r.EventType) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "event_type", r.EventType) + } params = make(map[string]string) @@ -112,6 +134,9 @@ func (r SearchApplicationPostBehavioralAnalyticsEventRequest) Do(ctx context.Con req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -143,8 +168,20 @@ func (r SearchApplicationPostBehavioralAnalyticsEventRequest) Do(ctx context.Con req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "search_application.post_behavioral_analytics_event") + if reader := instrument.RecordRequestBody(ctx, "search_application.post_behavioral_analytics_event", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "search_application.post_behavioral_analytics_event") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.put.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.put.go index bf1600d0b..5836dac4d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.put.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.put.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newSearchApplicationPutFunc(t Transport) SearchApplicationPut { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -62,16 +67,27 @@ type SearchApplicationPutRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SearchApplicationPutRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SearchApplicationPutRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "search_application.put") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_application") + 1 + len("search_application") + 1 + len(r.Name)) @@ -82,6 +98,9 @@ func (r SearchApplicationPutRequest) Do(ctx context.Context, transport Transport path.WriteString("search_application") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } params = make(map[string]string) @@ -107,6 +126,9 @@ func (r SearchApplicationPutRequest) Do(ctx context.Context, transport Transport req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -138,8 +160,20 @@ func (r SearchApplicationPutRequest) Do(ctx context.Context, transport Transport req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "search_application.put") + if reader := instrument.RecordRequestBody(ctx, "search_application.put", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "search_application.put") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.put_behavioral_analytics.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.put_behavioral_analytics.go index 8a6671e81..bf1d57703 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.put_behavioral_analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.put_behavioral_analytics.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSearchApplicationPutBehavioralAnalyticsFunc(t Transport) SearchApplicati for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -56,16 +61,27 @@ type SearchApplicationPutBehavioralAnalyticsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SearchApplicationPutBehavioralAnalyticsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SearchApplicationPutBehavioralAnalyticsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "search_application.put_behavioral_analytics") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_application") + 1 + len("analytics") + 1 + len(r.Name)) @@ -76,6 +92,9 @@ func (r SearchApplicationPutBehavioralAnalyticsRequest) Do(ctx context.Context, path.WriteString("analytics") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } params = make(map[string]string) @@ -97,6 +116,9 @@ func (r SearchApplicationPutBehavioralAnalyticsRequest) Do(ctx context.Context, req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -124,8 +146,17 @@ func (r SearchApplicationPutBehavioralAnalyticsRequest) Do(ctx context.Context, req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "search_application.put_behavioral_analytics") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "search_application.put_behavioral_analytics") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.render_query.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.render_query.go index 27cd75d64..70ccbc7f2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.render_query.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.render_query.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSearchApplicationRenderQueryFunc(t Transport) SearchApplicationRenderQue for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -59,16 +64,27 @@ type SearchApplicationRenderQueryRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SearchApplicationRenderQueryRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SearchApplicationRenderQueryRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "search_application.render_query") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_application") + 1 + len("search_application") + 1 + len(r.Name) + 1 + len("_render_query")) @@ -79,6 +95,9 @@ func (r SearchApplicationRenderQueryRequest) Do(ctx context.Context, transport T path.WriteString("search_application") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } path.WriteString("/") path.WriteString("_render_query") @@ -102,6 +121,9 @@ func (r SearchApplicationRenderQueryRequest) Do(ctx context.Context, transport T req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -133,8 +155,20 @@ func (r SearchApplicationRenderQueryRequest) Do(ctx context.Context, transport T req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "search_application.render_query") + if reader := instrument.RecordRequestBody(ctx, "search_application.render_query", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "search_application.render_query") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.search.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.search.go index 39b232401..a86f2e546 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.search.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_application.search.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSearchApplicationSearchFunc(t Transport) SearchApplicationSearch { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -59,16 +64,27 @@ type SearchApplicationSearchRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SearchApplicationSearchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SearchApplicationSearchRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "search_application.search") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_application") + 1 + len("search_application") + 1 + len(r.Name) + 1 + len("_search")) @@ -79,6 +95,9 @@ func (r SearchApplicationSearchRequest) Do(ctx context.Context, transport Transp path.WriteString("search_application") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } path.WriteString("/") path.WriteString("_search") @@ -102,6 +121,9 @@ func (r SearchApplicationSearchRequest) Do(ctx context.Context, transport Transp req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -133,8 +155,20 @@ func (r SearchApplicationSearchRequest) Do(ctx context.Context, transport Transp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "search_application.search") + if reader := instrument.RecordRequestBody(ctx, "search_application.search", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "search_application.search") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_mvt.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_mvt.go index 4b9891fd8..499d9bb97 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_mvt.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_mvt.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -35,6 +35,11 @@ func newSearchMvtFunc(t Transport) SearchMvt { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -75,16 +80,27 @@ type SearchMvtRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SearchMvtRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SearchMvtRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "search_mvt") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" if len(r.Index) == 0 { @@ -104,16 +120,31 @@ func (r SearchMvtRequest) Do(ctx context.Context, transport Transport) (*Respons path.WriteString("http://") path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } path.WriteString("/") path.WriteString("_mvt") path.WriteString("/") path.WriteString(r.Field) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "field", r.Field) + } path.WriteString("/") path.WriteString(strconv.Itoa(*r.Zoom)) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "zoom", strconv.Itoa(*r.Zoom)) + } path.WriteString("/") path.WriteString(strconv.Itoa(*r.X)) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "x", strconv.Itoa(*r.X)) + } path.WriteString("/") path.WriteString(strconv.Itoa(*r.Y)) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "y", strconv.Itoa(*r.Y)) + } params = make(map[string]string) @@ -163,6 +194,9 @@ func (r SearchMvtRequest) Do(ctx context.Context, transport Transport) (*Respons req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -194,8 +228,20 @@ func (r SearchMvtRequest) Do(ctx context.Context, transport Transport) (*Respons req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "search_mvt") + if reader := instrument.RecordRequestBody(ctx, "search_mvt", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "search_mvt") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_shards.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_shards.go index 2a437f341..7ff40dce3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_shards.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_shards.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSearchShardsFunc(t Transport) SearchShards { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -62,16 +67,27 @@ type SearchShardsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SearchShardsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SearchShardsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "search_shards") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(strings.Join(r.Index, ",")) + 1 + len("_search_shards")) @@ -79,6 +95,9 @@ func (r SearchShardsRequest) Do(ctx context.Context, transport Transport) (*Resp if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } } path.WriteString("/") path.WriteString("_search_shards") @@ -127,6 +146,9 @@ func (r SearchShardsRequest) Do(ctx context.Context, transport Transport) (*Resp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -154,8 +176,17 @@ func (r SearchShardsRequest) Do(ctx context.Context, transport Transport) (*Resp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "search_shards") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "search_shards") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_template.go index de7ae32af..9adcc223a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.search_template.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newSearchTemplateFunc(t Transport) SearchTemplate { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -73,16 +78,27 @@ type SearchTemplateRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SearchTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SearchTemplateRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "search_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(strings.Join(r.Index, ",")) + 1 + len("_search") + 1 + len("template")) @@ -90,6 +106,9 @@ func (r SearchTemplateRequest) Do(ctx context.Context, transport Transport) (*Re if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } } path.WriteString("/") path.WriteString("_search") @@ -168,6 +187,9 @@ func (r SearchTemplateRequest) Do(ctx context.Context, transport Transport) (*Re req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -199,8 +221,20 @@ func (r SearchTemplateRequest) Do(ctx context.Context, transport Transport) (*Re req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "search_template") + if reader := instrument.RecordRequestBody(ctx, "search_template", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "search_template") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.shutdown.delete_node.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.shutdown.delete_node.go index a32e31d8b..297afa128 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.shutdown.delete_node.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.shutdown.delete_node.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newShutdownDeleteNodeFunc(t Transport) ShutdownDeleteNode { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type ShutdownDeleteNodeRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ShutdownDeleteNodeRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ShutdownDeleteNodeRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "shutdown.delete_node") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_nodes") + 1 + len(r.NodeID) + 1 + len("shutdown")) @@ -72,6 +88,9 @@ func (r ShutdownDeleteNodeRequest) Do(ctx context.Context, transport Transport) path.WriteString("_nodes") path.WriteString("/") path.WriteString(r.NodeID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "node_id", r.NodeID) + } path.WriteString("/") path.WriteString("shutdown") @@ -95,6 +114,9 @@ func (r ShutdownDeleteNodeRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +144,17 @@ func (r ShutdownDeleteNodeRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "shutdown.delete_node") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "shutdown.delete_node") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.shutdown.get_node.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.shutdown.get_node.go index 2e721e447..c57ebf0e9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.shutdown.get_node.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.shutdown.get_node.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newShutdownGetNodeFunc(t Transport) ShutdownGetNode { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type ShutdownGetNodeRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ShutdownGetNodeRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ShutdownGetNodeRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "shutdown.get_node") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_nodes") + 1 + len(r.NodeID) + 1 + len("shutdown")) @@ -73,6 +89,9 @@ func (r ShutdownGetNodeRequest) Do(ctx context.Context, transport Transport) (*R if r.NodeID != "" { path.WriteString("/") path.WriteString(r.NodeID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "node_id", r.NodeID) + } } path.WriteString("/") path.WriteString("shutdown") @@ -97,6 +116,9 @@ func (r ShutdownGetNodeRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -124,8 +146,17 @@ func (r ShutdownGetNodeRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "shutdown.get_node") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "shutdown.get_node") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.shutdown.put_node.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.shutdown.put_node.go index d1a147ee1..42606d828 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.shutdown.put_node.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.shutdown.put_node.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newShutdownPutNodeFunc(t Transport) ShutdownPutNode { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type ShutdownPutNodeRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ShutdownPutNodeRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ShutdownPutNodeRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "shutdown.put_node") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_nodes") + 1 + len(r.NodeID) + 1 + len("shutdown")) @@ -75,6 +91,9 @@ func (r ShutdownPutNodeRequest) Do(ctx context.Context, transport Transport) (*R path.WriteString("_nodes") path.WriteString("/") path.WriteString(r.NodeID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "node_id", r.NodeID) + } path.WriteString("/") path.WriteString("shutdown") @@ -98,6 +117,9 @@ func (r ShutdownPutNodeRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -129,8 +151,20 @@ func (r ShutdownPutNodeRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "shutdown.put_node") + if reader := instrument.RecordRequestBody(ctx, "shutdown.put_node", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "shutdown.put_node") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.simulate.ingest.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.simulate.ingest.go new file mode 100644 index 000000000..8bce84864 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.simulate.ingest.go @@ -0,0 +1,259 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// +// Code generated from specification version 8.12.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newSimulateIngestFunc(t Transport) SimulateIngest { + return func(body io.Reader, o ...func(*SimulateIngestRequest)) (*Response, error) { + var r = SimulateIngestRequest{Body: body} + for _, f := range o { + f(&r) + } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SimulateIngest simulates running ingest with example documents. +// +// This API is experimental. +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/simulate-ingest-api.html. +type SimulateIngest func(body io.Reader, o ...func(*SimulateIngestRequest)) (*Response, error) + +// SimulateIngestRequest configures the Simulate Ingest API request. +type SimulateIngestRequest struct { + Index string + + Body io.Reader + + Pipeline string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context + + instrument Instrumentation +} + +// Do executes the request and returns response or error. +func (r SimulateIngestRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ctx context.Context + ) + + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "simulate.ingest") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + method = "POST" + + path.Grow(7 + 1 + len("_ingest") + 1 + len(r.Index) + 1 + len("_simulate")) + path.WriteString("http://") + path.WriteString("/") + path.WriteString("_ingest") + if r.Index != "" { + path.WriteString("/") + path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } + } + path.WriteString("/") + path.WriteString("_simulate") + + params = make(map[string]string) + + if r.Pipeline != "" { + params["pipeline"] = r.Pipeline + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if r.Body != nil && req.Header.Get(headerContentType) == "" { + req.Header[headerContentType] = headerContentTypeJSON + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "simulate.ingest") + if reader := instrument.RecordRequestBody(ctx, "simulate.ingest", r.Body); reader != nil { + req.Body = reader + } + } + res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "simulate.ingest") + } + if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +func (f SimulateIngest) WithContext(v context.Context) func(*SimulateIngestRequest) { + return func(r *SimulateIngestRequest) { + r.ctx = v + } +} + +// WithIndex - default index for docs which don't provide one. +func (f SimulateIngest) WithIndex(v string) func(*SimulateIngestRequest) { + return func(r *SimulateIngestRequest) { + r.Index = v + } +} + +// WithPipeline - the pipeline ID to preprocess incoming documents with if no pipeline is given for a particular document. +func (f SimulateIngest) WithPipeline(v string) func(*SimulateIngestRequest) { + return func(r *SimulateIngestRequest) { + r.Pipeline = v + } +} + +// WithPretty makes the response body pretty-printed. +func (f SimulateIngest) WithPretty() func(*SimulateIngestRequest) { + return func(r *SimulateIngestRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +func (f SimulateIngest) WithHuman() func(*SimulateIngestRequest) { + return func(r *SimulateIngestRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +func (f SimulateIngest) WithErrorTrace() func(*SimulateIngestRequest) { + return func(r *SimulateIngestRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +func (f SimulateIngest) WithFilterPath(v ...string) func(*SimulateIngestRequest) { + return func(r *SimulateIngestRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +func (f SimulateIngest) WithHeader(h map[string]string) func(*SimulateIngestRequest) { + return func(r *SimulateIngestRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +func (f SimulateIngest) WithOpaqueID(s string) func(*SimulateIngestRequest) { + return func(r *SimulateIngestRequest) { + 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/v8/esapi/api.snapshot.cleanup_repository.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.cleanup_repository.go index 72a549766..412229dde 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.cleanup_repository.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.cleanup_repository.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSnapshotCleanupRepositoryFunc(t Transport) SnapshotCleanupRepository { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -58,16 +63,27 @@ type SnapshotCleanupRepositoryRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SnapshotCleanupRepositoryRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SnapshotCleanupRepositoryRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "snapshot.cleanup_repository") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_snapshot") + 1 + len(r.Repository) + 1 + len("_cleanup")) @@ -76,6 +92,9 @@ func (r SnapshotCleanupRepositoryRequest) Do(ctx context.Context, transport Tran path.WriteString("_snapshot") path.WriteString("/") path.WriteString(r.Repository) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "repository", r.Repository) + } path.WriteString("/") path.WriteString("_cleanup") @@ -107,6 +126,9 @@ func (r SnapshotCleanupRepositoryRequest) Do(ctx context.Context, transport Tran req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -134,8 +156,17 @@ func (r SnapshotCleanupRepositoryRequest) Do(ctx context.Context, transport Tran req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "snapshot.cleanup_repository") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "snapshot.cleanup_repository") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.clone.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.clone.go index a1b02c44d..ae81f6c73 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.clone.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.clone.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newSnapshotCloneFunc(t Transport) SnapshotClone { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -62,16 +67,27 @@ type SnapshotCloneRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SnapshotCloneRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SnapshotCloneRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "snapshot.clone") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_snapshot") + 1 + len(r.Repository) + 1 + len(r.Snapshot) + 1 + len("_clone") + 1 + len(r.TargetSnapshot)) @@ -80,12 +96,21 @@ func (r SnapshotCloneRequest) Do(ctx context.Context, transport Transport) (*Res path.WriteString("_snapshot") path.WriteString("/") path.WriteString(r.Repository) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "repository", r.Repository) + } path.WriteString("/") path.WriteString(r.Snapshot) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "snapshot", r.Snapshot) + } path.WriteString("/") path.WriteString("_clone") path.WriteString("/") path.WriteString(r.TargetSnapshot) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "target_snapshot", r.TargetSnapshot) + } params = make(map[string]string) @@ -111,6 +136,9 @@ func (r SnapshotCloneRequest) Do(ctx context.Context, transport Transport) (*Res req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -142,8 +170,20 @@ func (r SnapshotCloneRequest) Do(ctx context.Context, transport Transport) (*Res req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "snapshot.clone") + if reader := instrument.RecordRequestBody(ctx, "snapshot.clone", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "snapshot.clone") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.create.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.create.go index 40d445ef5..1e5ef66d7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.create.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.create.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newSnapshotCreateFunc(t Transport) SnapshotCreate { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -63,16 +68,27 @@ type SnapshotCreateRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SnapshotCreateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SnapshotCreateRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "snapshot.create") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_snapshot") + 1 + len(r.Repository) + 1 + len(r.Snapshot)) @@ -81,8 +97,14 @@ func (r SnapshotCreateRequest) Do(ctx context.Context, transport Transport) (*Re path.WriteString("_snapshot") path.WriteString("/") path.WriteString(r.Repository) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "repository", r.Repository) + } path.WriteString("/") path.WriteString(r.Snapshot) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "snapshot", r.Snapshot) + } params = make(map[string]string) @@ -112,6 +134,9 @@ func (r SnapshotCreateRequest) Do(ctx context.Context, transport Transport) (*Re req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -143,8 +168,20 @@ func (r SnapshotCreateRequest) Do(ctx context.Context, transport Transport) (*Re req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "snapshot.create") + if reader := instrument.RecordRequestBody(ctx, "snapshot.create", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "snapshot.create") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.create_repository.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.create_repository.go index 8baaaff7b..b00d3e828 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.create_repository.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.create_repository.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newSnapshotCreateRepositoryFunc(t Transport) SnapshotCreateRepository { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -63,16 +68,27 @@ type SnapshotCreateRepositoryRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SnapshotCreateRepositoryRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SnapshotCreateRepositoryRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "snapshot.create_repository") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_snapshot") + 1 + len(r.Repository)) @@ -81,6 +97,9 @@ func (r SnapshotCreateRepositoryRequest) Do(ctx context.Context, transport Trans path.WriteString("_snapshot") path.WriteString("/") path.WriteString(r.Repository) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "repository", r.Repository) + } params = make(map[string]string) @@ -114,6 +133,9 @@ func (r SnapshotCreateRepositoryRequest) Do(ctx context.Context, transport Trans req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -145,8 +167,20 @@ func (r SnapshotCreateRepositoryRequest) Do(ctx context.Context, transport Trans req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "snapshot.create_repository") + if reader := instrument.RecordRequestBody(ctx, "snapshot.create_repository", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "snapshot.create_repository") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.delete.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.delete.go index 28eed17be..9db0b1e71 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.delete.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.delete.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newSnapshotDeleteFunc(t Transport) SnapshotDelete { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -59,16 +64,27 @@ type SnapshotDeleteRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SnapshotDeleteRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SnapshotDeleteRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "snapshot.delete") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" if len(r.Snapshot) == 0 { @@ -81,8 +97,14 @@ func (r SnapshotDeleteRequest) Do(ctx context.Context, transport Transport) (*Re path.WriteString("_snapshot") path.WriteString("/") path.WriteString(r.Repository) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "repository", r.Repository) + } path.WriteString("/") path.WriteString(strings.Join(r.Snapshot, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "snapshot", strings.Join(r.Snapshot, ",")) + } params = make(map[string]string) @@ -108,6 +130,9 @@ func (r SnapshotDeleteRequest) Do(ctx context.Context, transport Transport) (*Re req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -135,8 +160,17 @@ func (r SnapshotDeleteRequest) Do(ctx context.Context, transport Transport) (*Re req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "snapshot.delete") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "snapshot.delete") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.delete_repository.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.delete_repository.go index 534447c20..4a3824e52 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.delete_repository.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.delete_repository.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newSnapshotDeleteRepositoryFunc(t Transport) SnapshotDeleteRepository { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -59,16 +64,27 @@ type SnapshotDeleteRepositoryRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SnapshotDeleteRepositoryRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SnapshotDeleteRepositoryRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "snapshot.delete_repository") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" if len(r.Repository) == 0 { @@ -81,6 +97,9 @@ func (r SnapshotDeleteRepositoryRequest) Do(ctx context.Context, transport Trans path.WriteString("_snapshot") path.WriteString("/") path.WriteString(strings.Join(r.Repository, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "repository", strings.Join(r.Repository, ",")) + } params = make(map[string]string) @@ -110,6 +129,9 @@ func (r SnapshotDeleteRepositoryRequest) Do(ctx context.Context, transport Trans req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -137,8 +159,17 @@ func (r SnapshotDeleteRepositoryRequest) Do(ctx context.Context, transport Trans req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "snapshot.delete_repository") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "snapshot.delete_repository") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.get.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.get.go index 9f8bb4071..66e13afec 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.get.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.get.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newSnapshotGetFunc(t Transport) SnapshotGet { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -72,16 +77,27 @@ type SnapshotGetRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SnapshotGetRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SnapshotGetRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "snapshot.get") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" if len(r.Snapshot) == 0 { @@ -94,8 +110,14 @@ func (r SnapshotGetRequest) Do(ctx context.Context, transport Transport) (*Respo path.WriteString("_snapshot") path.WriteString("/") path.WriteString(r.Repository) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "repository", r.Repository) + } path.WriteString("/") path.WriteString(strings.Join(r.Snapshot, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "snapshot", strings.Join(r.Snapshot, ",")) + } params = make(map[string]string) @@ -169,6 +191,9 @@ func (r SnapshotGetRequest) Do(ctx context.Context, transport Transport) (*Respo req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -196,8 +221,17 @@ func (r SnapshotGetRequest) Do(ctx context.Context, transport Transport) (*Respo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "snapshot.get") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "snapshot.get") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.get_repository.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.get_repository.go index f17b98003..b96e24fe3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.get_repository.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.get_repository.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newSnapshotGetRepositoryFunc(t Transport) SnapshotGetRepository { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -59,16 +64,27 @@ type SnapshotGetRepositoryRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SnapshotGetRepositoryRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SnapshotGetRepositoryRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "snapshot.get_repository") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_snapshot") + 1 + len(strings.Join(r.Repository, ","))) @@ -78,6 +94,9 @@ func (r SnapshotGetRepositoryRequest) Do(ctx context.Context, transport Transpor if len(r.Repository) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Repository, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "repository", strings.Join(r.Repository, ",")) + } } params = make(map[string]string) @@ -108,6 +127,9 @@ func (r SnapshotGetRepositoryRequest) Do(ctx context.Context, transport Transpor req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -135,8 +157,17 @@ func (r SnapshotGetRepositoryRequest) Do(ctx context.Context, transport Transpor req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "snapshot.get_repository") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "snapshot.get_repository") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.repository_analyze.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.repository_analyze.go index 25ecd1684..6b4d84867 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.repository_analyze.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.repository_analyze.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newSnapshotRepositoryAnalyzeFunc(t Transport) SnapshotRepositoryAnalyze { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -68,16 +73,27 @@ type SnapshotRepositoryAnalyzeRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SnapshotRepositoryAnalyzeRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SnapshotRepositoryAnalyzeRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "snapshot.repository_analyze") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_snapshot") + 1 + len(r.Repository) + 1 + len("_analyze")) @@ -86,6 +102,9 @@ func (r SnapshotRepositoryAnalyzeRequest) Do(ctx context.Context, transport Tran path.WriteString("_snapshot") path.WriteString("/") path.WriteString(r.Repository) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "repository", r.Repository) + } path.WriteString("/") path.WriteString("_analyze") @@ -153,6 +172,9 @@ func (r SnapshotRepositoryAnalyzeRequest) Do(ctx context.Context, transport Tran req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -180,8 +202,17 @@ func (r SnapshotRepositoryAnalyzeRequest) Do(ctx context.Context, transport Tran req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "snapshot.repository_analyze") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "snapshot.repository_analyze") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.restore.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.restore.go index a8bb58ef9..650840ec0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.restore.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.restore.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newSnapshotRestoreFunc(t Transport) SnapshotRestore { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -63,16 +68,27 @@ type SnapshotRestoreRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SnapshotRestoreRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SnapshotRestoreRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "snapshot.restore") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_snapshot") + 1 + len(r.Repository) + 1 + len(r.Snapshot) + 1 + len("_restore")) @@ -81,8 +97,14 @@ func (r SnapshotRestoreRequest) Do(ctx context.Context, transport Transport) (*R path.WriteString("_snapshot") path.WriteString("/") path.WriteString(r.Repository) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "repository", r.Repository) + } path.WriteString("/") path.WriteString(r.Snapshot) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "snapshot", r.Snapshot) + } path.WriteString("/") path.WriteString("_restore") @@ -114,6 +136,9 @@ func (r SnapshotRestoreRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -145,8 +170,20 @@ func (r SnapshotRestoreRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "snapshot.restore") + if reader := instrument.RecordRequestBody(ctx, "snapshot.restore", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "snapshot.restore") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.status.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.status.go index 81e127078..37f452f04 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.status.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.status.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newSnapshotStatusFunc(t Transport) SnapshotStatus { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -60,16 +65,27 @@ type SnapshotStatusRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SnapshotStatusRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SnapshotStatusRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "snapshot.status") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_snapshot") + 1 + len(r.Repository) + 1 + len(strings.Join(r.Snapshot, ",")) + 1 + len("_status")) @@ -79,10 +95,16 @@ func (r SnapshotStatusRequest) Do(ctx context.Context, transport Transport) (*Re if r.Repository != "" { path.WriteString("/") path.WriteString(r.Repository) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "repository", r.Repository) + } } if len(r.Snapshot) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Snapshot, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "snapshot", strings.Join(r.Snapshot, ",")) + } } path.WriteString("/") path.WriteString("_status") @@ -115,6 +137,9 @@ func (r SnapshotStatusRequest) Do(ctx context.Context, transport Transport) (*Re req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -142,8 +167,17 @@ func (r SnapshotStatusRequest) Do(ctx context.Context, transport Transport) (*Re req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "snapshot.status") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "snapshot.status") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.verify_repository.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.verify_repository.go index 91d3230b6..036d6342c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.verify_repository.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.snapshot.verify_repository.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSnapshotVerifyRepositoryFunc(t Transport) SnapshotVerifyRepository { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -58,16 +63,27 @@ type SnapshotVerifyRepositoryRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SnapshotVerifyRepositoryRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SnapshotVerifyRepositoryRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "snapshot.verify_repository") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_snapshot") + 1 + len(r.Repository) + 1 + len("_verify")) @@ -76,6 +92,9 @@ func (r SnapshotVerifyRepositoryRequest) Do(ctx context.Context, transport Trans path.WriteString("_snapshot") path.WriteString("/") path.WriteString(r.Repository) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "repository", r.Repository) + } path.WriteString("/") path.WriteString("_verify") @@ -107,6 +126,9 @@ func (r SnapshotVerifyRepositoryRequest) Do(ctx context.Context, transport Trans req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -134,8 +156,17 @@ func (r SnapshotVerifyRepositoryRequest) Do(ctx context.Context, transport Trans req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "snapshot.verify_repository") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "snapshot.verify_repository") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.synonyms.delete_synonym.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.synonyms.delete_synonym.go index b190523dc..da700a729 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.synonyms.delete_synonym.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.synonyms.delete_synonym.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSynonymsDeleteSynonymFunc(t Transport) SynonymsDeleteSynonym { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -56,16 +61,27 @@ type SynonymsDeleteSynonymRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SynonymsDeleteSynonymRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SynonymsDeleteSynonymRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "synonyms.delete_synonym") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_synonyms") + 1 + len(r.DocumentID)) @@ -74,6 +90,9 @@ func (r SynonymsDeleteSynonymRequest) Do(ctx context.Context, transport Transpor path.WriteString("_synonyms") path.WriteString("/") path.WriteString(r.DocumentID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.DocumentID) + } params = make(map[string]string) @@ -95,6 +114,9 @@ func (r SynonymsDeleteSynonymRequest) Do(ctx context.Context, transport Transpor req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +144,17 @@ func (r SynonymsDeleteSynonymRequest) Do(ctx context.Context, transport Transpor req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "synonyms.delete_synonym") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "synonyms.delete_synonym") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.synonyms.delete_synonym_rule.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.synonyms.delete_synonym_rule.go index 1b99a6301..cd11870f0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.synonyms.delete_synonym_rule.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.synonyms.delete_synonym_rule.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSynonymsDeleteSynonymRuleFunc(t Transport) SynonymsDeleteSynonymRule { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type SynonymsDeleteSynonymRuleRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SynonymsDeleteSynonymRuleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SynonymsDeleteSynonymRuleRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "synonyms.delete_synonym_rule") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_synonyms") + 1 + len(r.SetID) + 1 + len(r.RuleID)) @@ -75,8 +91,14 @@ func (r SynonymsDeleteSynonymRuleRequest) Do(ctx context.Context, transport Tran path.WriteString("_synonyms") path.WriteString("/") path.WriteString(r.SetID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "set_id", r.SetID) + } path.WriteString("/") path.WriteString(r.RuleID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "rule_id", r.RuleID) + } params = make(map[string]string) @@ -98,6 +120,9 @@ func (r SynonymsDeleteSynonymRuleRequest) Do(ctx context.Context, transport Tran req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -125,8 +150,17 @@ func (r SynonymsDeleteSynonymRuleRequest) Do(ctx context.Context, transport Tran req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "synonyms.delete_synonym_rule") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "synonyms.delete_synonym_rule") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.synonyms.get_synonym.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.synonyms.get_synonym.go index e0b8a163c..5b405a33d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.synonyms.get_synonym.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.synonyms.get_synonym.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSynonymsGetSynonymFunc(t Transport) SynonymsGetSynonym { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -60,16 +65,27 @@ type SynonymsGetSynonymRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SynonymsGetSynonymRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SynonymsGetSynonymRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "synonyms.get_synonym") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_synonyms") + 1 + len(r.DocumentID)) @@ -78,6 +94,9 @@ func (r SynonymsGetSynonymRequest) Do(ctx context.Context, transport Transport) path.WriteString("_synonyms") path.WriteString("/") path.WriteString(r.DocumentID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.DocumentID) + } params = make(map[string]string) @@ -107,6 +126,9 @@ func (r SynonymsGetSynonymRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -134,8 +156,17 @@ func (r SynonymsGetSynonymRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "synonyms.get_synonym") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "synonyms.get_synonym") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.synonyms.get_synonym_rule.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.synonyms.get_synonym_rule.go index 0c55fa948..d54fb8dcc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.synonyms.get_synonym_rule.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.synonyms.get_synonym_rule.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSynonymsGetSynonymRuleFunc(t Transport) SynonymsGetSynonymRule { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type SynonymsGetSynonymRuleRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SynonymsGetSynonymRuleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SynonymsGetSynonymRuleRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "synonyms.get_synonym_rule") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_synonyms") + 1 + len(r.SetID) + 1 + len(r.RuleID)) @@ -75,8 +91,14 @@ func (r SynonymsGetSynonymRuleRequest) Do(ctx context.Context, transport Transpo path.WriteString("_synonyms") path.WriteString("/") path.WriteString(r.SetID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "set_id", r.SetID) + } path.WriteString("/") path.WriteString(r.RuleID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "rule_id", r.RuleID) + } params = make(map[string]string) @@ -98,6 +120,9 @@ func (r SynonymsGetSynonymRuleRequest) Do(ctx context.Context, transport Transpo req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -125,8 +150,17 @@ func (r SynonymsGetSynonymRuleRequest) Do(ctx context.Context, transport Transpo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "synonyms.get_synonym_rule") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "synonyms.get_synonym_rule") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.synonyms.get_synonyms_sets.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.synonyms.get_synonyms_sets.go index 881e168b7..fd9828e5f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.synonyms.get_synonyms_sets.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.synonyms.get_synonyms_sets.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSynonymsGetSynonymsSetsFunc(t Transport) SynonymsGetSynonymsSets { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -58,16 +63,27 @@ type SynonymsGetSynonymsSetsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SynonymsGetSynonymsSetsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SynonymsGetSynonymsSetsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "synonyms.get_synonyms_sets") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_synonyms")) @@ -102,6 +118,9 @@ func (r SynonymsGetSynonymsSetsRequest) Do(ctx context.Context, transport Transp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -129,8 +148,17 @@ func (r SynonymsGetSynonymsSetsRequest) Do(ctx context.Context, transport Transp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "synonyms.get_synonyms_sets") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "synonyms.get_synonyms_sets") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.synonyms.put_synonym.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.synonyms.put_synonym.go index b580e58a8..d0274042b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.synonyms.put_synonym.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.synonyms.put_synonym.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSynonymsPutSynonymFunc(t Transport) SynonymsPutSynonym { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -59,16 +64,27 @@ type SynonymsPutSynonymRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SynonymsPutSynonymRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SynonymsPutSynonymRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "synonyms.put_synonym") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_synonyms") + 1 + len(r.DocumentID)) @@ -77,6 +93,9 @@ func (r SynonymsPutSynonymRequest) Do(ctx context.Context, transport Transport) path.WriteString("_synonyms") path.WriteString("/") path.WriteString(r.DocumentID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.DocumentID) + } params = make(map[string]string) @@ -98,6 +117,9 @@ func (r SynonymsPutSynonymRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -129,8 +151,20 @@ func (r SynonymsPutSynonymRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "synonyms.put_synonym") + if reader := instrument.RecordRequestBody(ctx, "synonyms.put_synonym", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "synonyms.put_synonym") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.synonyms.put_synonym_rule.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.synonyms.put_synonym_rule.go index bedfdec7f..787ea534d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.synonyms.put_synonym_rule.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.synonyms.put_synonym_rule.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSynonymsPutSynonymRuleFunc(t Transport) SynonymsPutSynonymRule { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -60,16 +65,27 @@ type SynonymsPutSynonymRuleRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SynonymsPutSynonymRuleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SynonymsPutSynonymRuleRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "synonyms.put_synonym_rule") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_synonyms") + 1 + len(r.SetID) + 1 + len(r.RuleID)) @@ -78,8 +94,14 @@ func (r SynonymsPutSynonymRuleRequest) Do(ctx context.Context, transport Transpo path.WriteString("_synonyms") path.WriteString("/") path.WriteString(r.SetID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "set_id", r.SetID) + } path.WriteString("/") path.WriteString(r.RuleID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "rule_id", r.RuleID) + } params = make(map[string]string) @@ -101,6 +123,9 @@ func (r SynonymsPutSynonymRuleRequest) Do(ctx context.Context, transport Transpo req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -132,8 +157,20 @@ func (r SynonymsPutSynonymRuleRequest) Do(ctx context.Context, transport Transpo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "synonyms.put_synonym_rule") + if reader := instrument.RecordRequestBody(ctx, "synonyms.put_synonym_rule", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "synonyms.put_synonym_rule") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.tasks.cancel.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.tasks.cancel.go index 7fe76ae12..1f5db90a1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.tasks.cancel.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.tasks.cancel.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newTasksCancelFunc(t Transport) TasksCancel { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -62,16 +67,27 @@ type TasksCancelRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r TasksCancelRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r TasksCancelRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "tasks.cancel") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_tasks") + 1 + len(r.TaskID) + 1 + len("_cancel")) @@ -81,6 +97,9 @@ func (r TasksCancelRequest) Do(ctx context.Context, transport Transport) (*Respo if r.TaskID != "" { path.WriteString("/") path.WriteString(r.TaskID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "task_id", r.TaskID) + } } path.WriteString("/") path.WriteString("_cancel") @@ -121,6 +140,9 @@ func (r TasksCancelRequest) Do(ctx context.Context, transport Transport) (*Respo req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -148,8 +170,17 @@ func (r TasksCancelRequest) Do(ctx context.Context, transport Transport) (*Respo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "tasks.cancel") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "tasks.cancel") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.tasks.get.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.tasks.get.go index b235708ca..06db008b4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.tasks.get.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.tasks.get.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newTasksGetFunc(t Transport) TasksGet { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -61,16 +66,27 @@ type TasksGetRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r TasksGetRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r TasksGetRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "tasks.get") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_tasks") + 1 + len(r.TaskID)) @@ -79,6 +95,9 @@ func (r TasksGetRequest) Do(ctx context.Context, transport Transport) (*Response path.WriteString("_tasks") path.WriteString("/") path.WriteString(r.TaskID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "task_id", r.TaskID) + } params = make(map[string]string) @@ -108,6 +127,9 @@ func (r TasksGetRequest) Do(ctx context.Context, transport Transport) (*Response req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -135,8 +157,17 @@ func (r TasksGetRequest) Do(ctx context.Context, transport Transport) (*Response req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "tasks.get") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "tasks.get") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.tasks.list.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.tasks.list.go index 87335b25d..c2a8e6ce1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.tasks.list.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.tasks.list.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newTasksListFunc(t Transport) TasksList { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -64,16 +69,27 @@ type TasksListRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r TasksListRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r TasksListRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "tasks.list") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_tasks")) @@ -128,6 +144,9 @@ func (r TasksListRequest) Do(ctx context.Context, transport Transport) (*Respons req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -155,8 +174,17 @@ func (r TasksListRequest) Do(ctx context.Context, transport Transport) (*Respons req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "tasks.list") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "tasks.list") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.terms_enum.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.terms_enum.go index b4aa4d30d..2592a24d3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.terms_enum.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.terms_enum.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newTermsEnumFunc(t Transport) TermsEnum { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -58,16 +63,27 @@ type TermsEnumRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r TermsEnumRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r TermsEnumRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "terms_enum") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" if len(r.Index) == 0 { @@ -78,6 +94,9 @@ func (r TermsEnumRequest) Do(ctx context.Context, transport Transport) (*Respons path.WriteString("http://") path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } path.WriteString("/") path.WriteString("_terms_enum") @@ -101,6 +120,9 @@ func (r TermsEnumRequest) Do(ctx context.Context, transport Transport) (*Respons req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -132,8 +154,20 @@ func (r TermsEnumRequest) Do(ctx context.Context, transport Transport) (*Respons req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "terms_enum") + if reader := instrument.RecordRequestBody(ctx, "terms_enum", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "terms_enum") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.termvectors.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.termvectors.go index 28398de1b..4661d937a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.termvectors.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.termvectors.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newTermvectorsFunc(t Transport) Termvectors { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -71,27 +76,44 @@ type TermvectorsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r TermvectorsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r TermvectorsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "termvectors") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(r.Index) + 1 + len("_termvectors") + 1 + len(r.DocumentID)) path.WriteString("http://") path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } path.WriteString("/") path.WriteString("_termvectors") if r.DocumentID != "" { path.WriteString("/") path.WriteString(r.DocumentID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.DocumentID) + } } params = make(map[string]string) @@ -158,6 +180,9 @@ func (r TermvectorsRequest) Do(ctx context.Context, transport Transport) (*Respo req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -189,8 +214,20 @@ func (r TermvectorsRequest) Do(ctx context.Context, transport Transport) (*Respo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "termvectors") + if reader := instrument.RecordRequestBody(ctx, "termvectors", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "termvectors") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.update.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.update.go index 6d2a89641..154ec58d6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.update.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.update.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newUpdateFunc(t Transport) Update { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -73,26 +78,43 @@ type UpdateRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r UpdateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r UpdateRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "update") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(r.Index) + 1 + len("_update") + 1 + len(r.DocumentID)) path.WriteString("http://") path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } path.WriteString("/") path.WriteString("_update") path.WriteString("/") path.WriteString(r.DocumentID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.DocumentID) + } params = make(map[string]string) @@ -162,6 +184,9 @@ func (r UpdateRequest) Do(ctx context.Context, transport Transport) (*Response, req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -193,8 +218,20 @@ func (r UpdateRequest) Do(ctx context.Context, transport Transport) (*Response, req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "update") + if reader := instrument.RecordRequestBody(ctx, "update", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "update") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.update_by_query.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.update_by_query.go index aca32af78..21fda91ee 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.update_by_query.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.update_by_query.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -36,6 +36,11 @@ func newUpdateByQueryFunc(t Transport) UpdateByQuery { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -94,16 +99,27 @@ type UpdateByQueryRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r UpdateByQueryRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r UpdateByQueryRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "update_by_query") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" if len(r.Index) == 0 { @@ -114,6 +130,9 @@ func (r UpdateByQueryRequest) Do(ctx context.Context, transport Transport) (*Res path.WriteString("http://") path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } path.WriteString("/") path.WriteString("_update_by_query") @@ -261,6 +280,9 @@ func (r UpdateByQueryRequest) Do(ctx context.Context, transport Transport) (*Res req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -292,8 +314,20 @@ func (r UpdateByQueryRequest) Do(ctx context.Context, transport Transport) (*Res req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "update_by_query") + if reader := instrument.RecordRequestBody(ctx, "update_by_query", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "update_by_query") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.update_by_query_rethrottle.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.update_by_query_rethrottle.go index 4a9b2eb04..a117997c1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.update_by_query_rethrottle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.update_by_query_rethrottle.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newUpdateByQueryRethrottleFunc(t Transport) UpdateByQueryRethrottle { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type UpdateByQueryRethrottleRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r UpdateByQueryRethrottleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r UpdateByQueryRethrottleRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "update_by_query_rethrottle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_update_by_query") + 1 + len(r.TaskID) + 1 + len("_rethrottle")) @@ -75,6 +91,9 @@ func (r UpdateByQueryRethrottleRequest) Do(ctx context.Context, transport Transp path.WriteString("_update_by_query") path.WriteString("/") path.WriteString(r.TaskID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "task_id", r.TaskID) + } path.WriteString("/") path.WriteString("_rethrottle") @@ -102,6 +121,9 @@ func (r UpdateByQueryRethrottleRequest) Do(ctx context.Context, transport Transp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -129,8 +151,17 @@ func (r UpdateByQueryRethrottleRequest) Do(ctx context.Context, transport Transp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "update_by_query_rethrottle") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "update_by_query_rethrottle") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.async_search.delete.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.async_search.delete.go index 614608420..c383fb1fd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.async_search.delete.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.async_search.delete.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newAsyncSearchDeleteFunc(t Transport) AsyncSearchDelete { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type AsyncSearchDeleteRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r AsyncSearchDeleteRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r AsyncSearchDeleteRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "async_search.delete") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_async_search") + 1 + len(r.DocumentID)) @@ -72,6 +88,9 @@ func (r AsyncSearchDeleteRequest) Do(ctx context.Context, transport Transport) ( path.WriteString("_async_search") path.WriteString("/") path.WriteString(r.DocumentID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.DocumentID) + } params = make(map[string]string) @@ -93,6 +112,9 @@ func (r AsyncSearchDeleteRequest) Do(ctx context.Context, transport Transport) ( req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -120,8 +142,17 @@ func (r AsyncSearchDeleteRequest) Do(ctx context.Context, transport Transport) ( req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "async_search.delete") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "async_search.delete") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.async_search.get.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.async_search.get.go index 4b0955cfb..667c3599b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.async_search.get.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.async_search.get.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newAsyncSearchGetFunc(t Transport) AsyncSearchGet { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -60,16 +65,27 @@ type AsyncSearchGetRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r AsyncSearchGetRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r AsyncSearchGetRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "async_search.get") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_async_search") + 1 + len(r.DocumentID)) @@ -78,6 +94,9 @@ func (r AsyncSearchGetRequest) Do(ctx context.Context, transport Transport) (*Re path.WriteString("_async_search") path.WriteString("/") path.WriteString(r.DocumentID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.DocumentID) + } params = make(map[string]string) @@ -111,6 +130,9 @@ func (r AsyncSearchGetRequest) Do(ctx context.Context, transport Transport) (*Re req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -138,8 +160,17 @@ func (r AsyncSearchGetRequest) Do(ctx context.Context, transport Transport) (*Re req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "async_search.get") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "async_search.get") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.async_search.status.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.async_search.status.go index b3ef4c8b9..81bbcd467 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.async_search.status.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.async_search.status.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newAsyncSearchStatusFunc(t Transport) AsyncSearchStatus { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type AsyncSearchStatusRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r AsyncSearchStatusRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r AsyncSearchStatusRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "async_search.status") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_async_search") + 1 + len("status") + 1 + len(r.DocumentID)) @@ -74,6 +90,9 @@ func (r AsyncSearchStatusRequest) Do(ctx context.Context, transport Transport) ( path.WriteString("status") path.WriteString("/") path.WriteString(r.DocumentID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.DocumentID) + } params = make(map[string]string) @@ -95,6 +114,9 @@ func (r AsyncSearchStatusRequest) Do(ctx context.Context, transport Transport) ( req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +144,17 @@ func (r AsyncSearchStatusRequest) Do(ctx context.Context, transport Transport) ( req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "async_search.status") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "async_search.status") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.async_search.submit.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.async_search.submit.go index 491da6533..e0d157599 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.async_search.submit.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.async_search.submit.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -35,6 +35,11 @@ func newAsyncSearchSubmitFunc(t Transport) AsyncSearchSubmit { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -102,16 +107,27 @@ type AsyncSearchSubmitRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r AsyncSearchSubmitRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r AsyncSearchSubmitRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "async_search.submit") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(strings.Join(r.Index, ",")) + 1 + len("_async_search")) @@ -119,6 +135,9 @@ func (r AsyncSearchSubmitRequest) Do(ctx context.Context, transport Transport) ( if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } } path.WriteString("/") path.WriteString("_async_search") @@ -307,6 +326,9 @@ func (r AsyncSearchSubmitRequest) Do(ctx context.Context, transport Transport) ( req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -338,8 +360,20 @@ func (r AsyncSearchSubmitRequest) Do(ctx context.Context, transport Transport) ( req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "async_search.submit") + if reader := instrument.RecordRequestBody(ctx, "async_search.submit", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "async_search.submit") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.autoscaling.delete_autoscaling_policy.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.autoscaling.delete_autoscaling_policy.go index 17c8cd193..e42a81cd2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.autoscaling.delete_autoscaling_policy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.autoscaling.delete_autoscaling_policy.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newAutoscalingDeleteAutoscalingPolicyFunc(t Transport) AutoscalingDeleteAut for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type AutoscalingDeleteAutoscalingPolicyRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r AutoscalingDeleteAutoscalingPolicyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r AutoscalingDeleteAutoscalingPolicyRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "autoscaling.delete_autoscaling_policy") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_autoscaling") + 1 + len("policy") + 1 + len(r.Name)) @@ -74,6 +90,9 @@ func (r AutoscalingDeleteAutoscalingPolicyRequest) Do(ctx context.Context, trans path.WriteString("policy") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } params = make(map[string]string) @@ -95,6 +114,9 @@ func (r AutoscalingDeleteAutoscalingPolicyRequest) Do(ctx context.Context, trans req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +144,17 @@ func (r AutoscalingDeleteAutoscalingPolicyRequest) Do(ctx context.Context, trans req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "autoscaling.delete_autoscaling_policy") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "autoscaling.delete_autoscaling_policy") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.autoscaling.get_autoscaling_capacity.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.autoscaling.get_autoscaling_capacity.go index ddc350f43..ce59f21c7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.autoscaling.get_autoscaling_capacity.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.autoscaling.get_autoscaling_capacity.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newAutoscalingGetAutoscalingCapacityFunc(t Transport) AutoscalingGetAutosca for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type AutoscalingGetAutoscalingCapacityRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r AutoscalingGetAutoscalingCapacityRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r AutoscalingGetAutoscalingCapacityRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "autoscaling.get_autoscaling_capacity") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_autoscaling/capacity")) @@ -88,6 +104,9 @@ func (r AutoscalingGetAutoscalingCapacityRequest) Do(ctx context.Context, transp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r AutoscalingGetAutoscalingCapacityRequest) Do(ctx context.Context, transp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "autoscaling.get_autoscaling_capacity") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "autoscaling.get_autoscaling_capacity") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.autoscaling.get_autoscaling_policy.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.autoscaling.get_autoscaling_policy.go index a14ab56f6..2f3753348 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.autoscaling.get_autoscaling_policy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.autoscaling.get_autoscaling_policy.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newAutoscalingGetAutoscalingPolicyFunc(t Transport) AutoscalingGetAutoscali for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type AutoscalingGetAutoscalingPolicyRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r AutoscalingGetAutoscalingPolicyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r AutoscalingGetAutoscalingPolicyRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "autoscaling.get_autoscaling_policy") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_autoscaling") + 1 + len("policy") + 1 + len(r.Name)) @@ -74,6 +90,9 @@ func (r AutoscalingGetAutoscalingPolicyRequest) Do(ctx context.Context, transpor path.WriteString("policy") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } params = make(map[string]string) @@ -95,6 +114,9 @@ func (r AutoscalingGetAutoscalingPolicyRequest) Do(ctx context.Context, transpor req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +144,17 @@ func (r AutoscalingGetAutoscalingPolicyRequest) Do(ctx context.Context, transpor req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "autoscaling.get_autoscaling_policy") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "autoscaling.get_autoscaling_policy") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.autoscaling.put_autoscaling_policy.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.autoscaling.put_autoscaling_policy.go index bfa2812b6..8848c727f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.autoscaling.put_autoscaling_policy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.autoscaling.put_autoscaling_policy.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newAutoscalingPutAutoscalingPolicyFunc(t Transport) AutoscalingPutAutoscali for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type AutoscalingPutAutoscalingPolicyRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r AutoscalingPutAutoscalingPolicyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r AutoscalingPutAutoscalingPolicyRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "autoscaling.put_autoscaling_policy") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_autoscaling") + 1 + len("policy") + 1 + len(r.Name)) @@ -77,6 +93,9 @@ func (r AutoscalingPutAutoscalingPolicyRequest) Do(ctx context.Context, transpor path.WriteString("policy") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } params = make(map[string]string) @@ -98,6 +117,9 @@ func (r AutoscalingPutAutoscalingPolicyRequest) Do(ctx context.Context, transpor req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -129,8 +151,20 @@ func (r AutoscalingPutAutoscalingPolicyRequest) Do(ctx context.Context, transpor req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "autoscaling.put_autoscaling_policy") + if reader := instrument.RecordRequestBody(ctx, "autoscaling.put_autoscaling_policy", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "autoscaling.put_autoscaling_policy") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.cat.ml_data_frame_analytics.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.cat.ml_data_frame_analytics.go index 17f3657d8..59b1c3f2e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.cat.ml_data_frame_analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.cat.ml_data_frame_analytics.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newCatMLDataFrameAnalyticsFunc(t Transport) CatMLDataFrameAnalytics { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -64,16 +69,27 @@ type CatMLDataFrameAnalyticsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CatMLDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CatMLDataFrameAnalyticsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.ml_data_frame_analytics") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_cat") + 1 + len("ml") + 1 + len("data_frame") + 1 + len("analytics") + 1 + len(r.DocumentID)) @@ -89,6 +105,9 @@ func (r CatMLDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transp if r.DocumentID != "" { path.WriteString("/") path.WriteString(r.DocumentID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.DocumentID) + } } params = make(map[string]string) @@ -143,6 +162,9 @@ func (r CatMLDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -170,8 +192,17 @@ func (r CatMLDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cat.ml_data_frame_analytics") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.ml_data_frame_analytics") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.cat.ml_datafeeds.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.cat.ml_datafeeds.go index b07385714..23455c848 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.cat.ml_datafeeds.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.cat.ml_datafeeds.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newCatMLDatafeedsFunc(t Transport) CatMLDatafeeds { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -63,16 +68,27 @@ type CatMLDatafeedsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CatMLDatafeedsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CatMLDatafeedsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.ml_datafeeds") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_cat") + 1 + len("ml") + 1 + len("datafeeds") + 1 + len(r.DatafeedID)) @@ -86,6 +102,9 @@ func (r CatMLDatafeedsRequest) Do(ctx context.Context, transport Transport) (*Re if r.DatafeedID != "" { path.WriteString("/") path.WriteString(r.DatafeedID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "datafeed_id", r.DatafeedID) + } } params = make(map[string]string) @@ -136,6 +155,9 @@ func (r CatMLDatafeedsRequest) Do(ctx context.Context, transport Transport) (*Re req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -163,8 +185,17 @@ func (r CatMLDatafeedsRequest) Do(ctx context.Context, transport Transport) (*Re req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cat.ml_datafeeds") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.ml_datafeeds") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.cat.ml_jobs.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.cat.ml_jobs.go index 2e22252a9..c50750686 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.cat.ml_jobs.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.cat.ml_jobs.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newCatMLJobsFunc(t Transport) CatMLJobs { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -64,16 +69,27 @@ type CatMLJobsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CatMLJobsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CatMLJobsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.ml_jobs") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_cat") + 1 + len("ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID)) @@ -87,6 +103,9 @@ func (r CatMLJobsRequest) Do(ctx context.Context, transport Transport) (*Respons if r.JobID != "" { path.WriteString("/") path.WriteString(r.JobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "job_id", r.JobID) + } } params = make(map[string]string) @@ -141,6 +160,9 @@ func (r CatMLJobsRequest) Do(ctx context.Context, transport Transport) (*Respons req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -168,8 +190,17 @@ func (r CatMLJobsRequest) Do(ctx context.Context, transport Transport) (*Respons req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cat.ml_jobs") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.ml_jobs") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.cat.ml_trained_models.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.cat.ml_trained_models.go index 65535d124..f418fc950 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.cat.ml_trained_models.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.cat.ml_trained_models.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newCatMLTrainedModelsFunc(t Transport) CatMLTrainedModels { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -66,16 +71,27 @@ type CatMLTrainedModelsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CatMLTrainedModelsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CatMLTrainedModelsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.ml_trained_models") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_cat") + 1 + len("ml") + 1 + len("trained_models") + 1 + len(r.ModelID)) @@ -89,6 +105,9 @@ func (r CatMLTrainedModelsRequest) Do(ctx context.Context, transport Transport) if r.ModelID != "" { path.WriteString("/") path.WriteString(r.ModelID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "model_id", r.ModelID) + } } params = make(map[string]string) @@ -151,6 +170,9 @@ func (r CatMLTrainedModelsRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -178,8 +200,17 @@ func (r CatMLTrainedModelsRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cat.ml_trained_models") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.ml_trained_models") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.cat.transforms.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.cat.transforms.go index 45f9f87e0..1421e0a49 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.cat.transforms.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.cat.transforms.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newCatTransformsFunc(t Transport) CatTransforms { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -65,16 +70,27 @@ type CatTransformsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CatTransformsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CatTransformsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.transforms") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_cat") + 1 + len("transforms") + 1 + len(r.TransformID)) @@ -86,6 +102,9 @@ func (r CatTransformsRequest) Do(ctx context.Context, transport Transport) (*Res if r.TransformID != "" { path.WriteString("/") path.WriteString(r.TransformID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "transform_id", r.TransformID) + } } params = make(map[string]string) @@ -144,6 +163,9 @@ func (r CatTransformsRequest) Do(ctx context.Context, transport Transport) (*Res req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -171,8 +193,17 @@ func (r CatTransformsRequest) Do(ctx context.Context, transport Transport) (*Res req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "cat.transforms") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.transforms") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.delete_auto_follow_pattern.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.delete_auto_follow_pattern.go index 4b4c85e4b..ad367987e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.delete_auto_follow_pattern.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.delete_auto_follow_pattern.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newCCRDeleteAutoFollowPatternFunc(t Transport) CCRDeleteAutoFollowPattern { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type CCRDeleteAutoFollowPatternRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CCRDeleteAutoFollowPatternRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CCRDeleteAutoFollowPatternRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.delete_auto_follow_pattern") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_ccr") + 1 + len("auto_follow") + 1 + len(r.Name)) @@ -74,6 +90,9 @@ func (r CCRDeleteAutoFollowPatternRequest) Do(ctx context.Context, transport Tra path.WriteString("auto_follow") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } params = make(map[string]string) @@ -95,6 +114,9 @@ func (r CCRDeleteAutoFollowPatternRequest) Do(ctx context.Context, transport Tra req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +144,17 @@ func (r CCRDeleteAutoFollowPatternRequest) Do(ctx context.Context, transport Tra req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ccr.delete_auto_follow_pattern") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ccr.delete_auto_follow_pattern") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.follow.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.follow.go index 206240c3b..487b9c1dd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.follow.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.follow.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newCCRFollowFunc(t Transport) CCRFollow { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -59,22 +64,36 @@ type CCRFollowRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CCRFollowRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CCRFollowRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.follow") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len(r.Index) + 1 + len("_ccr") + 1 + len("follow")) path.WriteString("http://") path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } path.WriteString("/") path.WriteString("_ccr") path.WriteString("/") @@ -104,6 +123,9 @@ func (r CCRFollowRequest) Do(ctx context.Context, transport Transport) (*Respons req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -135,8 +157,20 @@ func (r CCRFollowRequest) Do(ctx context.Context, transport Transport) (*Respons req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ccr.follow") + if reader := instrument.RecordRequestBody(ctx, "ccr.follow", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ccr.follow") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.follow_info.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.follow_info.go index 522d09018..795525d82 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.follow_info.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.follow_info.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newCCRFollowInfoFunc(t Transport) CCRFollowInfo { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type CCRFollowInfoRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CCRFollowInfoRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CCRFollowInfoRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.follow_info") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" if len(r.Index) == 0 { @@ -75,6 +91,9 @@ func (r CCRFollowInfoRequest) Do(ctx context.Context, transport Transport) (*Res path.WriteString("http://") path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } path.WriteString("/") path.WriteString("_ccr") path.WriteString("/") @@ -100,6 +119,9 @@ func (r CCRFollowInfoRequest) Do(ctx context.Context, transport Transport) (*Res req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -127,8 +149,17 @@ func (r CCRFollowInfoRequest) Do(ctx context.Context, transport Transport) (*Res req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ccr.follow_info") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ccr.follow_info") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.follow_stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.follow_stats.go index 565835c89..420c0d41c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.follow_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.follow_stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newCCRFollowStatsFunc(t Transport) CCRFollowStats { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type CCRFollowStatsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CCRFollowStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CCRFollowStatsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.follow_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" if len(r.Index) == 0 { @@ -75,6 +91,9 @@ func (r CCRFollowStatsRequest) Do(ctx context.Context, transport Transport) (*Re path.WriteString("http://") path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } path.WriteString("/") path.WriteString("_ccr") path.WriteString("/") @@ -100,6 +119,9 @@ func (r CCRFollowStatsRequest) Do(ctx context.Context, transport Transport) (*Re req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -127,8 +149,17 @@ func (r CCRFollowStatsRequest) Do(ctx context.Context, transport Transport) (*Re req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ccr.follow_stats") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ccr.follow_stats") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.forget_follower.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.forget_follower.go index 4ce10aa87..91024de73 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.forget_follower.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.forget_follower.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newCCRForgetFollowerFunc(t Transport) CCRForgetFollower { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,22 +62,36 @@ type CCRForgetFollowerRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CCRForgetFollowerRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CCRForgetFollowerRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.forget_follower") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(r.Index) + 1 + len("_ccr") + 1 + len("forget_follower")) path.WriteString("http://") path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } path.WriteString("/") path.WriteString("_ccr") path.WriteString("/") @@ -98,6 +117,9 @@ func (r CCRForgetFollowerRequest) Do(ctx context.Context, transport Transport) ( req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -129,8 +151,20 @@ func (r CCRForgetFollowerRequest) Do(ctx context.Context, transport Transport) ( req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ccr.forget_follower") + if reader := instrument.RecordRequestBody(ctx, "ccr.forget_follower", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ccr.forget_follower") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.get_auto_follow_pattern.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.get_auto_follow_pattern.go index e70f88758..8922a37b4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.get_auto_follow_pattern.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.get_auto_follow_pattern.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newCCRGetAutoFollowPatternFunc(t Transport) CCRGetAutoFollowPattern { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type CCRGetAutoFollowPatternRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CCRGetAutoFollowPatternRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CCRGetAutoFollowPatternRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.get_auto_follow_pattern") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_ccr") + 1 + len("auto_follow") + 1 + len(r.Name)) @@ -75,6 +91,9 @@ func (r CCRGetAutoFollowPatternRequest) Do(ctx context.Context, transport Transp if r.Name != "" { path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } } params = make(map[string]string) @@ -97,6 +116,9 @@ func (r CCRGetAutoFollowPatternRequest) Do(ctx context.Context, transport Transp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -124,8 +146,17 @@ func (r CCRGetAutoFollowPatternRequest) Do(ctx context.Context, transport Transp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ccr.get_auto_follow_pattern") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ccr.get_auto_follow_pattern") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.pause_auto_follow_pattern.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.pause_auto_follow_pattern.go index 40605bf6b..772276707 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.pause_auto_follow_pattern.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.pause_auto_follow_pattern.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newCCRPauseAutoFollowPatternFunc(t Transport) CCRPauseAutoFollowPattern { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type CCRPauseAutoFollowPatternRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CCRPauseAutoFollowPatternRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CCRPauseAutoFollowPatternRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.pause_auto_follow_pattern") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ccr") + 1 + len("auto_follow") + 1 + len(r.Name) + 1 + len("pause")) @@ -74,6 +90,9 @@ func (r CCRPauseAutoFollowPatternRequest) Do(ctx context.Context, transport Tran path.WriteString("auto_follow") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } path.WriteString("/") path.WriteString("pause") @@ -97,6 +116,9 @@ func (r CCRPauseAutoFollowPatternRequest) Do(ctx context.Context, transport Tran req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -124,8 +146,17 @@ func (r CCRPauseAutoFollowPatternRequest) Do(ctx context.Context, transport Tran req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ccr.pause_auto_follow_pattern") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ccr.pause_auto_follow_pattern") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.pause_follow.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.pause_follow.go index a6bae1f59..a44e9fccb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.pause_follow.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.pause_follow.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newCCRPauseFollowFunc(t Transport) CCRPauseFollow { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,22 +59,36 @@ type CCRPauseFollowRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CCRPauseFollowRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CCRPauseFollowRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.pause_follow") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(r.Index) + 1 + len("_ccr") + 1 + len("pause_follow")) path.WriteString("http://") path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } path.WriteString("/") path.WriteString("_ccr") path.WriteString("/") @@ -95,6 +114,9 @@ func (r CCRPauseFollowRequest) Do(ctx context.Context, transport Transport) (*Re req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +144,17 @@ func (r CCRPauseFollowRequest) Do(ctx context.Context, transport Transport) (*Re req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ccr.pause_follow") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ccr.pause_follow") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.put_auto_follow_pattern.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.put_auto_follow_pattern.go index 919067093..47d85c6c2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.put_auto_follow_pattern.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.put_auto_follow_pattern.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newCCRPutAutoFollowPatternFunc(t Transport) CCRPutAutoFollowPattern { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type CCRPutAutoFollowPatternRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CCRPutAutoFollowPatternRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CCRPutAutoFollowPatternRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.put_auto_follow_pattern") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_ccr") + 1 + len("auto_follow") + 1 + len(r.Name)) @@ -77,6 +93,9 @@ func (r CCRPutAutoFollowPatternRequest) Do(ctx context.Context, transport Transp path.WriteString("auto_follow") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } params = make(map[string]string) @@ -98,6 +117,9 @@ func (r CCRPutAutoFollowPatternRequest) Do(ctx context.Context, transport Transp req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -129,8 +151,20 @@ func (r CCRPutAutoFollowPatternRequest) Do(ctx context.Context, transport Transp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ccr.put_auto_follow_pattern") + if reader := instrument.RecordRequestBody(ctx, "ccr.put_auto_follow_pattern", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ccr.put_auto_follow_pattern") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.resume_auto_follow_pattern.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.resume_auto_follow_pattern.go index e9986073e..17f4fd0fc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.resume_auto_follow_pattern.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.resume_auto_follow_pattern.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newCCRResumeAutoFollowPatternFunc(t Transport) CCRResumeAutoFollowPattern { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type CCRResumeAutoFollowPatternRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CCRResumeAutoFollowPatternRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CCRResumeAutoFollowPatternRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.resume_auto_follow_pattern") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ccr") + 1 + len("auto_follow") + 1 + len(r.Name) + 1 + len("resume")) @@ -74,6 +90,9 @@ func (r CCRResumeAutoFollowPatternRequest) Do(ctx context.Context, transport Tra path.WriteString("auto_follow") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } path.WriteString("/") path.WriteString("resume") @@ -97,6 +116,9 @@ func (r CCRResumeAutoFollowPatternRequest) Do(ctx context.Context, transport Tra req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -124,8 +146,17 @@ func (r CCRResumeAutoFollowPatternRequest) Do(ctx context.Context, transport Tra req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ccr.resume_auto_follow_pattern") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ccr.resume_auto_follow_pattern") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.resume_follow.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.resume_follow.go index 298f34c36..7c654961d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.resume_follow.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.resume_follow.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newCCRResumeFollowFunc(t Transport) CCRResumeFollow { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,22 +62,36 @@ type CCRResumeFollowRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CCRResumeFollowRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CCRResumeFollowRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.resume_follow") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(r.Index) + 1 + len("_ccr") + 1 + len("resume_follow")) path.WriteString("http://") path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } path.WriteString("/") path.WriteString("_ccr") path.WriteString("/") @@ -98,6 +117,9 @@ func (r CCRResumeFollowRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -129,8 +151,20 @@ func (r CCRResumeFollowRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ccr.resume_follow") + if reader := instrument.RecordRequestBody(ctx, "ccr.resume_follow", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ccr.resume_follow") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.stats.go index 8695a490f..701e8ecd7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newCCRStatsFunc(t Transport) CCRStats { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type CCRStatsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CCRStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CCRStatsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_ccr/stats")) @@ -88,6 +104,9 @@ func (r CCRStatsRequest) Do(ctx context.Context, transport Transport) (*Response req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r CCRStatsRequest) Do(ctx context.Context, transport Transport) (*Response req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ccr.stats") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ccr.stats") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.unfollow.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.unfollow.go index 1197b4f72..fc1ec6dff 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.unfollow.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ccr.unfollow.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newCCRUnfollowFunc(t Transport) CCRUnfollow { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,22 +59,36 @@ type CCRUnfollowRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r CCRUnfollowRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r CCRUnfollowRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.unfollow") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(r.Index) + 1 + len("_ccr") + 1 + len("unfollow")) path.WriteString("http://") path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } path.WriteString("/") path.WriteString("_ccr") path.WriteString("/") @@ -95,6 +114,9 @@ func (r CCRUnfollowRequest) Do(ctx context.Context, transport Transport) (*Respo req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +144,17 @@ func (r CCRUnfollowRequest) Do(ctx context.Context, transport Transport) (*Respo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ccr.unfollow") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ccr.unfollow") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.close_point_in_time.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.close_point_in_time.go index c9436762a..00503ce03 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.close_point_in_time.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.close_point_in_time.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newClosePointInTimeFunc(t Transport) ClosePointInTime { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type ClosePointInTimeRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ClosePointInTimeRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ClosePointInTimeRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "close_point_in_time") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + len("/_pit")) @@ -91,6 +107,9 @@ func (r ClosePointInTimeRequest) Do(ctx context.Context, transport Transport) (* req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +141,20 @@ func (r ClosePointInTimeRequest) Do(ctx context.Context, transport Transport) (* req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "close_point_in_time") + if reader := instrument.RecordRequestBody(ctx, "close_point_in_time", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "close_point_in_time") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.enrich.delete_policy.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.enrich.delete_policy.go index 984f01986..ae661a788 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.enrich.delete_policy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.enrich.delete_policy.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newEnrichDeletePolicyFunc(t Transport) EnrichDeletePolicy { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type EnrichDeletePolicyRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r EnrichDeletePolicyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r EnrichDeletePolicyRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "enrich.delete_policy") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_enrich") + 1 + len("policy") + 1 + len(r.Name)) @@ -74,6 +90,9 @@ func (r EnrichDeletePolicyRequest) Do(ctx context.Context, transport Transport) path.WriteString("policy") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } params = make(map[string]string) @@ -95,6 +114,9 @@ func (r EnrichDeletePolicyRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +144,17 @@ func (r EnrichDeletePolicyRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "enrich.delete_policy") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "enrich.delete_policy") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.enrich.execute_policy.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.enrich.execute_policy.go index 0dc8d0c1b..e1be21fd1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.enrich.execute_policy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.enrich.execute_policy.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newEnrichExecutePolicyFunc(t Transport) EnrichExecutePolicy { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type EnrichExecutePolicyRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r EnrichExecutePolicyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r EnrichExecutePolicyRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "enrich.execute_policy") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_enrich") + 1 + len("policy") + 1 + len(r.Name) + 1 + len("_execute")) @@ -77,6 +93,9 @@ func (r EnrichExecutePolicyRequest) Do(ctx context.Context, transport Transport) path.WriteString("policy") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } path.WriteString("/") path.WriteString("_execute") @@ -104,6 +123,9 @@ func (r EnrichExecutePolicyRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -131,8 +153,17 @@ func (r EnrichExecutePolicyRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "enrich.execute_policy") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "enrich.execute_policy") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.enrich.get_policy.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.enrich.get_policy.go index 1cea3da9c..cfee7ae2b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.enrich.get_policy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.enrich.get_policy.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newEnrichGetPolicyFunc(t Transport) EnrichGetPolicy { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type EnrichGetPolicyRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r EnrichGetPolicyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r EnrichGetPolicyRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "enrich.get_policy") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_enrich") + 1 + len("policy") + 1 + len(strings.Join(r.Name, ","))) @@ -75,6 +91,9 @@ func (r EnrichGetPolicyRequest) Do(ctx context.Context, transport Transport) (*R if len(r.Name) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Name, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", strings.Join(r.Name, ",")) + } } params = make(map[string]string) @@ -97,6 +116,9 @@ func (r EnrichGetPolicyRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -124,8 +146,17 @@ func (r EnrichGetPolicyRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "enrich.get_policy") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "enrich.get_policy") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.enrich.put_policy.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.enrich.put_policy.go index ea9baf071..bae375ce3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.enrich.put_policy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.enrich.put_policy.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newEnrichPutPolicyFunc(t Transport) EnrichPutPolicy { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type EnrichPutPolicyRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r EnrichPutPolicyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r EnrichPutPolicyRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "enrich.put_policy") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_enrich") + 1 + len("policy") + 1 + len(r.Name)) @@ -77,6 +93,9 @@ func (r EnrichPutPolicyRequest) Do(ctx context.Context, transport Transport) (*R path.WriteString("policy") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } params = make(map[string]string) @@ -98,6 +117,9 @@ func (r EnrichPutPolicyRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -129,8 +151,20 @@ func (r EnrichPutPolicyRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "enrich.put_policy") + if reader := instrument.RecordRequestBody(ctx, "enrich.put_policy", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "enrich.put_policy") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.enrich.stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.enrich.stats.go index 468af4c1b..718465391 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.enrich.stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.enrich.stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newEnrichStatsFunc(t Transport) EnrichStats { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type EnrichStatsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r EnrichStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r EnrichStatsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "enrich.stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_enrich/_stats")) @@ -88,6 +104,9 @@ func (r EnrichStatsRequest) Do(ctx context.Context, transport Transport) (*Respo req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r EnrichStatsRequest) Do(ctx context.Context, transport Transport) (*Respo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "enrich.stats") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "enrich.stats") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.eql.delete.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.eql.delete.go index ea1631821..10aaff33a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.eql.delete.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.eql.delete.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newEqlDeleteFunc(t Transport) EqlDelete { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type EqlDeleteRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r EqlDeleteRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r EqlDeleteRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "eql.delete") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_eql") + 1 + len("search") + 1 + len(r.DocumentID)) @@ -74,6 +90,9 @@ func (r EqlDeleteRequest) Do(ctx context.Context, transport Transport) (*Respons path.WriteString("search") path.WriteString("/") path.WriteString(r.DocumentID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.DocumentID) + } params = make(map[string]string) @@ -95,6 +114,9 @@ func (r EqlDeleteRequest) Do(ctx context.Context, transport Transport) (*Respons req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +144,17 @@ func (r EqlDeleteRequest) Do(ctx context.Context, transport Transport) (*Respons req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "eql.delete") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "eql.delete") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.eql.get.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.eql.get.go index 24c51618b..518aafec8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.eql.get.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.eql.get.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newEqlGetFunc(t Transport) EqlGet { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -58,16 +63,27 @@ type EqlGetRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r EqlGetRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r EqlGetRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "eql.get") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_eql") + 1 + len("search") + 1 + len(r.DocumentID)) @@ -78,6 +94,9 @@ func (r EqlGetRequest) Do(ctx context.Context, transport Transport) (*Response, path.WriteString("search") path.WriteString("/") path.WriteString(r.DocumentID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.DocumentID) + } params = make(map[string]string) @@ -107,6 +126,9 @@ func (r EqlGetRequest) Do(ctx context.Context, transport Transport) (*Response, req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -134,8 +156,17 @@ func (r EqlGetRequest) Do(ctx context.Context, transport Transport) (*Response, req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "eql.get") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "eql.get") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.eql.get_status.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.eql.get_status.go index 01724d0ea..f11e6e75c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.eql.get_status.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.eql.get_status.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newEqlGetStatusFunc(t Transport) EqlGetStatus { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type EqlGetStatusRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r EqlGetStatusRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r EqlGetStatusRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "eql.get_status") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_eql") + 1 + len("search") + 1 + len("status") + 1 + len(r.DocumentID)) @@ -76,6 +92,9 @@ func (r EqlGetStatusRequest) Do(ctx context.Context, transport Transport) (*Resp path.WriteString("status") path.WriteString("/") path.WriteString(r.DocumentID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.DocumentID) + } params = make(map[string]string) @@ -97,6 +116,9 @@ func (r EqlGetStatusRequest) Do(ctx context.Context, transport Transport) (*Resp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -124,8 +146,17 @@ func (r EqlGetStatusRequest) Do(ctx context.Context, transport Transport) (*Resp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "eql.get_status") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "eql.get_status") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.eql.search.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.eql.search.go index cf2137412..07df8ddc8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.eql.search.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.eql.search.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newEqlSearchFunc(t Transport) EqlSearch { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -63,22 +68,36 @@ type EqlSearchRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r EqlSearchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r EqlSearchRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "eql.search") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(r.Index) + 1 + len("_eql") + 1 + len("search")) path.WriteString("http://") path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } path.WriteString("/") path.WriteString("_eql") path.WriteString("/") @@ -116,6 +135,9 @@ func (r EqlSearchRequest) Do(ctx context.Context, transport Transport) (*Respons req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -147,8 +169,20 @@ func (r EqlSearchRequest) Do(ctx context.Context, transport Transport) (*Respons req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "eql.search") + if reader := instrument.RecordRequestBody(ctx, "eql.search", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "eql.search") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.esql.query.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.esql.query.go index 4b7a4f730..9fc4dfd72 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.esql.query.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.esql.query.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newEsqlQueryFunc(t Transport) EsqlQuery { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -60,16 +65,27 @@ type EsqlQueryRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r EsqlQueryRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r EsqlQueryRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "esql.query") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_query")) @@ -104,6 +120,9 @@ func (r EsqlQueryRequest) Do(ctx context.Context, transport Transport) (*Respons req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -135,8 +154,20 @@ func (r EsqlQueryRequest) Do(ctx context.Context, transport Transport) (*Respons req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "esql.query") + if reader := instrument.RecordRequestBody(ctx, "esql.query", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "esql.query") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.graph.explore.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.graph.explore.go index d2f7ae871..868fa9fb2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.graph.explore.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.graph.explore.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newGraphExploreFunc(t Transport) GraphExplore { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -62,16 +67,27 @@ type GraphExploreRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r GraphExploreRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r GraphExploreRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "graph.explore") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" if len(r.Index) == 0 { @@ -82,6 +98,9 @@ func (r GraphExploreRequest) Do(ctx context.Context, transport Transport) (*Resp path.WriteString("http://") path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } path.WriteString("/") path.WriteString("_graph") path.WriteString("/") @@ -115,6 +134,9 @@ func (r GraphExploreRequest) Do(ctx context.Context, transport Transport) (*Resp req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -146,8 +168,20 @@ func (r GraphExploreRequest) Do(ctx context.Context, transport Transport) (*Resp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "graph.explore") + if reader := instrument.RecordRequestBody(ctx, "graph.explore", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "graph.explore") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.delete_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.delete_lifecycle.go index fb3b75f44..51b1baba6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.delete_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.delete_lifecycle.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newILMDeleteLifecycleFunc(t Transport) ILMDeleteLifecycle { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type ILMDeleteLifecycleRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ILMDeleteLifecycleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ILMDeleteLifecycleRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ilm.delete_lifecycle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_ilm") + 1 + len("policy") + 1 + len(r.Policy)) @@ -74,6 +90,9 @@ func (r ILMDeleteLifecycleRequest) Do(ctx context.Context, transport Transport) path.WriteString("policy") path.WriteString("/") path.WriteString(r.Policy) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "policy", r.Policy) + } params = make(map[string]string) @@ -95,6 +114,9 @@ func (r ILMDeleteLifecycleRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +144,17 @@ func (r ILMDeleteLifecycleRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ilm.delete_lifecycle") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ilm.delete_lifecycle") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.explain_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.explain_lifecycle.go index 7b2bee2d8..a4e0d87a2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.explain_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.explain_lifecycle.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newILMExplainLifecycleFunc(t Transport) ILMExplainLifecycle { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -58,22 +63,36 @@ type ILMExplainLifecycleRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ILMExplainLifecycleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ILMExplainLifecycleRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ilm.explain_lifecycle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len(r.Index) + 1 + len("_ilm") + 1 + len("explain")) path.WriteString("http://") path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } path.WriteString("/") path.WriteString("_ilm") path.WriteString("/") @@ -107,6 +126,9 @@ func (r ILMExplainLifecycleRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -134,8 +156,17 @@ func (r ILMExplainLifecycleRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ilm.explain_lifecycle") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ilm.explain_lifecycle") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.get_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.get_lifecycle.go index 2032a1b08..e427fa7d6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.get_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.get_lifecycle.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newILMGetLifecycleFunc(t Transport) ILMGetLifecycle { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type ILMGetLifecycleRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ILMGetLifecycleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ILMGetLifecycleRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ilm.get_lifecycle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_ilm") + 1 + len("policy") + 1 + len(r.Policy)) @@ -75,6 +91,9 @@ func (r ILMGetLifecycleRequest) Do(ctx context.Context, transport Transport) (*R if r.Policy != "" { path.WriteString("/") path.WriteString(r.Policy) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "policy", r.Policy) + } } params = make(map[string]string) @@ -97,6 +116,9 @@ func (r ILMGetLifecycleRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -124,8 +146,17 @@ func (r ILMGetLifecycleRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ilm.get_lifecycle") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ilm.get_lifecycle") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.get_status.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.get_status.go index 5affd0f85..92422ead1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.get_status.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.get_status.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newILMGetStatusFunc(t Transport) ILMGetStatus { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type ILMGetStatusRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ILMGetStatusRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ILMGetStatusRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ilm.get_status") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_ilm/status")) @@ -88,6 +104,9 @@ func (r ILMGetStatusRequest) Do(ctx context.Context, transport Transport) (*Resp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r ILMGetStatusRequest) Do(ctx context.Context, transport Transport) (*Resp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ilm.get_status") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ilm.get_status") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.migrate_to_data_tiers.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.migrate_to_data_tiers.go index 07615a067..d00ad3c7e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.migrate_to_data_tiers.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.migrate_to_data_tiers.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newILMMigrateToDataTiersFunc(t Transport) ILMMigrateToDataTiers { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -58,16 +63,27 @@ type ILMMigrateToDataTiersRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ILMMigrateToDataTiersRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ILMMigrateToDataTiersRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ilm.migrate_to_data_tiers") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_ilm/migrate_to_data_tiers")) @@ -98,6 +114,9 @@ func (r ILMMigrateToDataTiersRequest) Do(ctx context.Context, transport Transpor req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -129,8 +148,20 @@ func (r ILMMigrateToDataTiersRequest) Do(ctx context.Context, transport Transpor req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ilm.migrate_to_data_tiers") + if reader := instrument.RecordRequestBody(ctx, "ilm.migrate_to_data_tiers", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ilm.migrate_to_data_tiers") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.move_to_step.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.move_to_step.go index 5342d0988..09c1a405f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.move_to_step.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.move_to_step.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newILMMoveToStepFunc(t Transport) ILMMoveToStep { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type ILMMoveToStepRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ILMMoveToStepRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ILMMoveToStepRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ilm.move_to_step") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ilm") + 1 + len("move") + 1 + len(r.Index)) @@ -77,6 +93,9 @@ func (r ILMMoveToStepRequest) Do(ctx context.Context, transport Transport) (*Res path.WriteString("move") path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } params = make(map[string]string) @@ -98,6 +117,9 @@ func (r ILMMoveToStepRequest) Do(ctx context.Context, transport Transport) (*Res req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -129,8 +151,20 @@ func (r ILMMoveToStepRequest) Do(ctx context.Context, transport Transport) (*Res req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ilm.move_to_step") + if reader := instrument.RecordRequestBody(ctx, "ilm.move_to_step", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ilm.move_to_step") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.put_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.put_lifecycle.go index e485697bf..e5db200fa 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.put_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.put_lifecycle.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newILMPutLifecycleFunc(t Transport) ILMPutLifecycle { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type ILMPutLifecycleRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ILMPutLifecycleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ILMPutLifecycleRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ilm.put_lifecycle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_ilm") + 1 + len("policy") + 1 + len(r.Policy)) @@ -77,6 +93,9 @@ func (r ILMPutLifecycleRequest) Do(ctx context.Context, transport Transport) (*R path.WriteString("policy") path.WriteString("/") path.WriteString(r.Policy) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "policy", r.Policy) + } params = make(map[string]string) @@ -98,6 +117,9 @@ func (r ILMPutLifecycleRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -129,8 +151,20 @@ func (r ILMPutLifecycleRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ilm.put_lifecycle") + if reader := instrument.RecordRequestBody(ctx, "ilm.put_lifecycle", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ilm.put_lifecycle") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.remove_policy.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.remove_policy.go index 1ebf50c46..1af1d7d38 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.remove_policy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.remove_policy.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newILMRemovePolicyFunc(t Transport) ILMRemovePolicy { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,22 +59,36 @@ type ILMRemovePolicyRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ILMRemovePolicyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ILMRemovePolicyRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ilm.remove_policy") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(r.Index) + 1 + len("_ilm") + 1 + len("remove")) path.WriteString("http://") path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } path.WriteString("/") path.WriteString("_ilm") path.WriteString("/") @@ -95,6 +114,9 @@ func (r ILMRemovePolicyRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +144,17 @@ func (r ILMRemovePolicyRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ilm.remove_policy") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ilm.remove_policy") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.retry.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.retry.go index e274176ce..629221e27 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.retry.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.retry.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newILMRetryFunc(t Transport) ILMRetry { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,22 +59,36 @@ type ILMRetryRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ILMRetryRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ILMRetryRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ilm.retry") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(r.Index) + 1 + len("_ilm") + 1 + len("retry")) path.WriteString("http://") path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } path.WriteString("/") path.WriteString("_ilm") path.WriteString("/") @@ -95,6 +114,9 @@ func (r ILMRetryRequest) Do(ctx context.Context, transport Transport) (*Response req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +144,17 @@ func (r ILMRetryRequest) Do(ctx context.Context, transport Transport) (*Response req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ilm.retry") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ilm.retry") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.start.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.start.go index aa68dee6d..05dbae206 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.start.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.start.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newILMStartFunc(t Transport) ILMStart { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type ILMStartRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ILMStartRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ILMStartRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ilm.start") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_ilm/start")) @@ -88,6 +104,9 @@ func (r ILMStartRequest) Do(ctx context.Context, transport Transport) (*Response req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r ILMStartRequest) Do(ctx context.Context, transport Transport) (*Response req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ilm.start") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ilm.start") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.stop.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.stop.go index 65c0d343e..37bca4ba4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.stop.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ilm.stop.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newILMStopFunc(t Transport) ILMStop { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type ILMStopRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r ILMStopRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r ILMStopRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ilm.stop") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_ilm/stop")) @@ -88,6 +104,9 @@ func (r ILMStopRequest) Do(ctx context.Context, transport Transport) (*Response, req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r ILMStopRequest) Do(ctx context.Context, transport Transport) (*Response, req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ilm.stop") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ilm.stop") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.indices.create_data_stream.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.indices.create_data_stream.go index 9bbe3825f..719b456a9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.indices.create_data_stream.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.indices.create_data_stream.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newIndicesCreateDataStreamFunc(t Transport) IndicesCreateDataStream { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type IndicesCreateDataStreamRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesCreateDataStreamRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesCreateDataStreamRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.create_data_stream") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_data_stream") + 1 + len(r.Name)) @@ -72,6 +88,9 @@ func (r IndicesCreateDataStreamRequest) Do(ctx context.Context, transport Transp path.WriteString("_data_stream") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } params = make(map[string]string) @@ -93,6 +112,9 @@ func (r IndicesCreateDataStreamRequest) Do(ctx context.Context, transport Transp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -120,8 +142,17 @@ func (r IndicesCreateDataStreamRequest) Do(ctx context.Context, transport Transp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.create_data_stream") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.create_data_stream") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.indices.data_streams_stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.indices.data_streams_stats.go index 7e006383e..d66be8291 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.indices.data_streams_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.indices.data_streams_stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newIndicesDataStreamsStatsFunc(t Transport) IndicesDataStreamsStats { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type IndicesDataStreamsStatsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesDataStreamsStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesDataStreamsStatsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.data_streams_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_data_stream") + 1 + len(strings.Join(r.Name, ",")) + 1 + len("_stats")) @@ -73,6 +89,9 @@ func (r IndicesDataStreamsStatsRequest) Do(ctx context.Context, transport Transp if len(r.Name) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Name, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", strings.Join(r.Name, ",")) + } } path.WriteString("/") path.WriteString("_stats") @@ -97,6 +116,9 @@ func (r IndicesDataStreamsStatsRequest) Do(ctx context.Context, transport Transp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -124,8 +146,17 @@ func (r IndicesDataStreamsStatsRequest) Do(ctx context.Context, transport Transp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.data_streams_stats") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.data_streams_stats") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.indices.delete_data_stream.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.indices.delete_data_stream.go index b0df2ffb2..12f64b4ba 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.indices.delete_data_stream.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.indices.delete_data_stream.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newIndicesDeleteDataStreamFunc(t Transport) IndicesDeleteDataStream { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type IndicesDeleteDataStreamRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesDeleteDataStreamRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesDeleteDataStreamRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.delete_data_stream") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" if len(r.Name) == 0 { @@ -79,6 +95,9 @@ func (r IndicesDeleteDataStreamRequest) Do(ctx context.Context, transport Transp path.WriteString("_data_stream") path.WriteString("/") path.WriteString(strings.Join(r.Name, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", strings.Join(r.Name, ",")) + } params = make(map[string]string) @@ -104,6 +123,9 @@ func (r IndicesDeleteDataStreamRequest) Do(ctx context.Context, transport Transp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -131,8 +153,17 @@ func (r IndicesDeleteDataStreamRequest) Do(ctx context.Context, transport Transp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.delete_data_stream") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.delete_data_stream") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.indices.get_data_stream.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.indices.get_data_stream.go index 062feedca..9de2c3708 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.indices.get_data_stream.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.indices.get_data_stream.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newIndicesGetDataStreamFunc(t Transport) IndicesGetDataStream { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -58,16 +63,27 @@ type IndicesGetDataStreamRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesGetDataStreamRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesGetDataStreamRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.get_data_stream") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_data_stream") + 1 + len(strings.Join(r.Name, ","))) @@ -77,6 +93,9 @@ func (r IndicesGetDataStreamRequest) Do(ctx context.Context, transport Transport if len(r.Name) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Name, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", strings.Join(r.Name, ",")) + } } params = make(map[string]string) @@ -107,6 +126,9 @@ func (r IndicesGetDataStreamRequest) Do(ctx context.Context, transport Transport req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -134,8 +156,17 @@ func (r IndicesGetDataStreamRequest) Do(ctx context.Context, transport Transport req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.get_data_stream") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.get_data_stream") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.indices.migrate_to_data_stream.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.indices.migrate_to_data_stream.go index 20996caae..c67026cc5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.indices.migrate_to_data_stream.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.indices.migrate_to_data_stream.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newIndicesMigrateToDataStreamFunc(t Transport) IndicesMigrateToDataStream { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type IndicesMigrateToDataStreamRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesMigrateToDataStreamRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesMigrateToDataStreamRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.migrate_to_data_stream") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_data_stream") + 1 + len("_migrate") + 1 + len(r.Name)) @@ -74,6 +90,9 @@ func (r IndicesMigrateToDataStreamRequest) Do(ctx context.Context, transport Tra path.WriteString("_migrate") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } params = make(map[string]string) @@ -95,6 +114,9 @@ func (r IndicesMigrateToDataStreamRequest) Do(ctx context.Context, transport Tra req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +144,17 @@ func (r IndicesMigrateToDataStreamRequest) Do(ctx context.Context, transport Tra req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.migrate_to_data_stream") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.migrate_to_data_stream") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.indices.promote_data_stream.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.indices.promote_data_stream.go index 0c4f5e9fa..b9b7404e1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.indices.promote_data_stream.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.indices.promote_data_stream.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newIndicesPromoteDataStreamFunc(t Transport) IndicesPromoteDataStream { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type IndicesPromoteDataStreamRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesPromoteDataStreamRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesPromoteDataStreamRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.promote_data_stream") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_data_stream") + 1 + len("_promote") + 1 + len(r.Name)) @@ -74,6 +90,9 @@ func (r IndicesPromoteDataStreamRequest) Do(ctx context.Context, transport Trans path.WriteString("_promote") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } params = make(map[string]string) @@ -95,6 +114,9 @@ func (r IndicesPromoteDataStreamRequest) Do(ctx context.Context, transport Trans req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +144,17 @@ func (r IndicesPromoteDataStreamRequest) Do(ctx context.Context, transport Trans req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.promote_data_stream") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.promote_data_stream") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.indices.reload_search_analyzers.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.indices.reload_search_analyzers.go index b7bda8e40..88b8e223d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.indices.reload_search_analyzers.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.indices.reload_search_analyzers.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newIndicesReloadSearchAnalyzersFunc(t Transport) IndicesReloadSearchAnalyze for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -61,16 +66,27 @@ type IndicesReloadSearchAnalyzersRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesReloadSearchAnalyzersRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesReloadSearchAnalyzersRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.reload_search_analyzers") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" if len(r.Index) == 0 { @@ -81,6 +97,9 @@ func (r IndicesReloadSearchAnalyzersRequest) Do(ctx context.Context, transport T path.WriteString("http://") path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } path.WriteString("/") path.WriteString("_reload_search_analyzers") @@ -120,6 +139,9 @@ func (r IndicesReloadSearchAnalyzersRequest) Do(ctx context.Context, transport T req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -147,8 +169,17 @@ func (r IndicesReloadSearchAnalyzersRequest) Do(ctx context.Context, transport T req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.reload_search_analyzers") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.reload_search_analyzers") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.indices.unfreeze.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.indices.unfreeze.go index 0cde389ac..0608671b6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.indices.unfreeze.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.indices.unfreeze.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newIndicesUnfreezeFunc(t Transport) IndicesUnfreeze { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -63,22 +68,36 @@ type IndicesUnfreezeRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r IndicesUnfreezeRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesUnfreezeRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.unfreeze") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(r.Index) + 1 + len("_unfreeze")) path.WriteString("http://") path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } path.WriteString("/") path.WriteString("_unfreeze") @@ -126,6 +145,9 @@ func (r IndicesUnfreezeRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -153,8 +175,17 @@ func (r IndicesUnfreezeRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "indices.unfreeze") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.unfreeze") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.license.delete.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.license.delete.go index 66a3a2d4f..75f6d1a0c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.license.delete.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.license.delete.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newLicenseDeleteFunc(t Transport) LicenseDelete { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type LicenseDeleteRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r LicenseDeleteRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r LicenseDeleteRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "license.delete") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + len("/_license")) @@ -88,6 +104,9 @@ func (r LicenseDeleteRequest) Do(ctx context.Context, transport Transport) (*Res req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r LicenseDeleteRequest) Do(ctx context.Context, transport Transport) (*Res req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "license.delete") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "license.delete") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.license.get.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.license.get.go index c1564940b..1a9a90300 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.license.get.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.license.get.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newLicenseGetFunc(t Transport) LicenseGet { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -56,16 +61,27 @@ type LicenseGetRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r LicenseGetRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r LicenseGetRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "license.get") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_license")) @@ -100,6 +116,9 @@ func (r LicenseGetRequest) Do(ctx context.Context, transport Transport) (*Respon req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -127,8 +146,17 @@ func (r LicenseGetRequest) Do(ctx context.Context, transport Transport) (*Respon req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "license.get") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "license.get") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.license.get_basic_status.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.license.get_basic_status.go index 91c1a29b5..638c5a6d7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.license.get_basic_status.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.license.get_basic_status.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newLicenseGetBasicStatusFunc(t Transport) LicenseGetBasicStatus { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type LicenseGetBasicStatusRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r LicenseGetBasicStatusRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r LicenseGetBasicStatusRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "license.get_basic_status") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_license/basic_status")) @@ -88,6 +104,9 @@ func (r LicenseGetBasicStatusRequest) Do(ctx context.Context, transport Transpor req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r LicenseGetBasicStatusRequest) Do(ctx context.Context, transport Transpor req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "license.get_basic_status") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "license.get_basic_status") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.license.get_trial_status.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.license.get_trial_status.go index 4512c99dc..9f5d750e2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.license.get_trial_status.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.license.get_trial_status.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newLicenseGetTrialStatusFunc(t Transport) LicenseGetTrialStatus { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type LicenseGetTrialStatusRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r LicenseGetTrialStatusRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r LicenseGetTrialStatusRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "license.get_trial_status") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_license/trial_status")) @@ -88,6 +104,9 @@ func (r LicenseGetTrialStatusRequest) Do(ctx context.Context, transport Transpor req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r LicenseGetTrialStatusRequest) Do(ctx context.Context, transport Transpor req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "license.get_trial_status") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "license.get_trial_status") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.license.post.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.license.post.go index 3afb36bb2..95055bf6f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.license.post.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.license.post.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newLicensePostFunc(t Transport) LicensePost { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -58,16 +63,27 @@ type LicensePostRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r LicensePostRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r LicensePostRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "license.post") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + len("/_license")) @@ -98,6 +114,9 @@ func (r LicensePostRequest) Do(ctx context.Context, transport Transport) (*Respo req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -129,8 +148,20 @@ func (r LicensePostRequest) Do(ctx context.Context, transport Transport) (*Respo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "license.post") + if reader := instrument.RecordRequestBody(ctx, "license.post", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "license.post") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.license.post_start_basic.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.license.post_start_basic.go index 7003ffe5e..7d830a82f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.license.post_start_basic.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.license.post_start_basic.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newLicensePostStartBasicFunc(t Transport) LicensePostStartBasic { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type LicensePostStartBasicRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r LicensePostStartBasicRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r LicensePostStartBasicRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "license.post_start_basic") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_license/start_basic")) @@ -95,6 +111,9 @@ func (r LicensePostStartBasicRequest) Do(ctx context.Context, transport Transpor req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +141,17 @@ func (r LicensePostStartBasicRequest) Do(ctx context.Context, transport Transpor req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "license.post_start_basic") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "license.post_start_basic") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.license.post_start_trial.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.license.post_start_trial.go index 7af010461..3f2e1fe09 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.license.post_start_trial.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.license.post_start_trial.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newLicensePostStartTrialFunc(t Transport) LicensePostStartTrial { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -56,16 +61,27 @@ type LicensePostStartTrialRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r LicensePostStartTrialRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r LicensePostStartTrialRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "license.post_start_trial") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_license/start_trial")) @@ -100,6 +116,9 @@ func (r LicensePostStartTrialRequest) Do(ctx context.Context, transport Transpor req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -127,8 +146,17 @@ func (r LicensePostStartTrialRequest) Do(ctx context.Context, transport Transpor req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "license.post_start_trial") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "license.post_start_trial") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.logstash.delete_pipeline.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.logstash.delete_pipeline.go index 2ed67ea01..4567b09ce 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.logstash.delete_pipeline.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.logstash.delete_pipeline.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newLogstashDeletePipelineFunc(t Transport) LogstashDeletePipeline { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type LogstashDeletePipelineRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r LogstashDeletePipelineRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r LogstashDeletePipelineRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "logstash.delete_pipeline") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_logstash") + 1 + len("pipeline") + 1 + len(r.DocumentID)) @@ -74,6 +90,9 @@ func (r LogstashDeletePipelineRequest) Do(ctx context.Context, transport Transpo path.WriteString("pipeline") path.WriteString("/") path.WriteString(r.DocumentID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.DocumentID) + } params = make(map[string]string) @@ -95,6 +114,9 @@ func (r LogstashDeletePipelineRequest) Do(ctx context.Context, transport Transpo req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +144,17 @@ func (r LogstashDeletePipelineRequest) Do(ctx context.Context, transport Transpo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "logstash.delete_pipeline") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "logstash.delete_pipeline") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.logstash.get_pipeline.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.logstash.get_pipeline.go index f945d2ca9..770d956ea 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.logstash.get_pipeline.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.logstash.get_pipeline.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newLogstashGetPipelineFunc(t Transport) LogstashGetPipeline { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type LogstashGetPipelineRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r LogstashGetPipelineRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r LogstashGetPipelineRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "logstash.get_pipeline") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_logstash") + 1 + len("pipeline") + 1 + len(r.DocumentID)) @@ -75,6 +91,9 @@ func (r LogstashGetPipelineRequest) Do(ctx context.Context, transport Transport) if r.DocumentID != "" { path.WriteString("/") path.WriteString(r.DocumentID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.DocumentID) + } } params = make(map[string]string) @@ -97,6 +116,9 @@ func (r LogstashGetPipelineRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -124,8 +146,17 @@ func (r LogstashGetPipelineRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "logstash.get_pipeline") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "logstash.get_pipeline") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.logstash.put_pipeline.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.logstash.put_pipeline.go index 29b13baa4..13553e20b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.logstash.put_pipeline.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.logstash.put_pipeline.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newLogstashPutPipelineFunc(t Transport) LogstashPutPipeline { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type LogstashPutPipelineRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r LogstashPutPipelineRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r LogstashPutPipelineRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "logstash.put_pipeline") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_logstash") + 1 + len("pipeline") + 1 + len(r.DocumentID)) @@ -77,6 +93,9 @@ func (r LogstashPutPipelineRequest) Do(ctx context.Context, transport Transport) path.WriteString("pipeline") path.WriteString("/") path.WriteString(r.DocumentID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.DocumentID) + } params = make(map[string]string) @@ -98,6 +117,9 @@ func (r LogstashPutPipelineRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -129,8 +151,20 @@ func (r LogstashPutPipelineRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "logstash.put_pipeline") + if reader := instrument.RecordRequestBody(ctx, "logstash.put_pipeline", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "logstash.put_pipeline") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.migration.deprecations.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.migration.deprecations.go index 763498273..1837ea5be 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.migration.deprecations.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.migration.deprecations.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newMigrationDeprecationsFunc(t Transport) MigrationDeprecations { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type MigrationDeprecationsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MigrationDeprecationsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MigrationDeprecationsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "migration.deprecations") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len(r.Index) + 1 + len("_migration") + 1 + len("deprecations")) @@ -71,6 +87,9 @@ func (r MigrationDeprecationsRequest) Do(ctx context.Context, transport Transpor if r.Index != "" { path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } } path.WriteString("/") path.WriteString("_migration") @@ -97,6 +116,9 @@ func (r MigrationDeprecationsRequest) Do(ctx context.Context, transport Transpor req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -124,8 +146,17 @@ func (r MigrationDeprecationsRequest) Do(ctx context.Context, transport Transpor req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "migration.deprecations") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "migration.deprecations") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.migration.get_feature_upgrade_status.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.migration.get_feature_upgrade_status.go index ed2a9ebaa..e7fb42ca0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.migration.get_feature_upgrade_status.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.migration.get_feature_upgrade_status.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newMigrationGetFeatureUpgradeStatusFunc(t Transport) MigrationGetFeatureUpg for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type MigrationGetFeatureUpgradeStatusRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MigrationGetFeatureUpgradeStatusRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MigrationGetFeatureUpgradeStatusRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "migration.get_feature_upgrade_status") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_migration/system_features")) @@ -88,6 +104,9 @@ func (r MigrationGetFeatureUpgradeStatusRequest) Do(ctx context.Context, transpo req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r MigrationGetFeatureUpgradeStatusRequest) Do(ctx context.Context, transpo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "migration.get_feature_upgrade_status") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "migration.get_feature_upgrade_status") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.migration.post_feature_upgrade.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.migration.post_feature_upgrade.go index 19c68fd62..72b5dbb5e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.migration.post_feature_upgrade.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.migration.post_feature_upgrade.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newMigrationPostFeatureUpgradeFunc(t Transport) MigrationPostFeatureUpgrade for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type MigrationPostFeatureUpgradeRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MigrationPostFeatureUpgradeRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MigrationPostFeatureUpgradeRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "migration.post_feature_upgrade") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_migration/system_features")) @@ -88,6 +104,9 @@ func (r MigrationPostFeatureUpgradeRequest) Do(ctx context.Context, transport Tr req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r MigrationPostFeatureUpgradeRequest) Do(ctx context.Context, transport Tr req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "migration.post_feature_upgrade") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "migration.post_feature_upgrade") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.clear_trained_model_deployment_cache.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.clear_trained_model_deployment_cache.go index 011cc974a..66a3594d7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.clear_trained_model_deployment_cache.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.clear_trained_model_deployment_cache.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newMLClearTrainedModelDeploymentCacheFunc(t Transport) MLClearTrainedModelD for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type MLClearTrainedModelDeploymentCacheRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLClearTrainedModelDeploymentCacheRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLClearTrainedModelDeploymentCacheRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.clear_trained_model_deployment_cache") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ml") + 1 + len("trained_models") + 1 + len(r.ModelID) + 1 + len("deployment") + 1 + len("cache") + 1 + len("_clear")) @@ -74,6 +90,9 @@ func (r MLClearTrainedModelDeploymentCacheRequest) Do(ctx context.Context, trans path.WriteString("trained_models") path.WriteString("/") path.WriteString(r.ModelID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "model_id", r.ModelID) + } path.WriteString("/") path.WriteString("deployment") path.WriteString("/") @@ -101,6 +120,9 @@ func (r MLClearTrainedModelDeploymentCacheRequest) Do(ctx context.Context, trans req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -128,8 +150,17 @@ func (r MLClearTrainedModelDeploymentCacheRequest) Do(ctx context.Context, trans req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.clear_trained_model_deployment_cache") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.clear_trained_model_deployment_cache") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.close_job.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.close_job.go index eeef7f444..dbb041ed7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.close_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.close_job.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newMLCloseJobFunc(t Transport) MLCloseJob { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -63,16 +68,27 @@ type MLCloseJobRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLCloseJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLCloseJobRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.close_job") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("_close")) @@ -83,6 +99,9 @@ func (r MLCloseJobRequest) Do(ctx context.Context, transport Transport) (*Respon path.WriteString("anomaly_detectors") path.WriteString("/") path.WriteString(r.JobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "job_id", r.JobID) + } path.WriteString("/") path.WriteString("_close") @@ -118,6 +137,9 @@ func (r MLCloseJobRequest) Do(ctx context.Context, transport Transport) (*Respon req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -149,8 +171,20 @@ func (r MLCloseJobRequest) Do(ctx context.Context, transport Transport) (*Respon req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.close_job") + if reader := instrument.RecordRequestBody(ctx, "ml.close_job", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.close_job") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_calendar.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_calendar.go index a3dceb79f..7261ea2ad 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_calendar.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_calendar.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newMLDeleteCalendarFunc(t Transport) MLDeleteCalendar { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type MLDeleteCalendarRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLDeleteCalendarRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLDeleteCalendarRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_calendar") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_ml") + 1 + len("calendars") + 1 + len(r.CalendarID)) @@ -74,6 +90,9 @@ func (r MLDeleteCalendarRequest) Do(ctx context.Context, transport Transport) (* path.WriteString("calendars") path.WriteString("/") path.WriteString(r.CalendarID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "calendar_id", r.CalendarID) + } params = make(map[string]string) @@ -95,6 +114,9 @@ func (r MLDeleteCalendarRequest) Do(ctx context.Context, transport Transport) (* req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +144,17 @@ func (r MLDeleteCalendarRequest) Do(ctx context.Context, transport Transport) (* req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.delete_calendar") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.delete_calendar") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_calendar_event.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_calendar_event.go index 7152b9348..6604a80d4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_calendar_event.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_calendar_event.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newMLDeleteCalendarEventFunc(t Transport) MLDeleteCalendarEvent { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type MLDeleteCalendarEventRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLDeleteCalendarEventRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLDeleteCalendarEventRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_calendar_event") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_ml") + 1 + len("calendars") + 1 + len(r.CalendarID) + 1 + len("events") + 1 + len(r.EventID)) @@ -75,10 +91,16 @@ func (r MLDeleteCalendarEventRequest) Do(ctx context.Context, transport Transpor path.WriteString("calendars") path.WriteString("/") path.WriteString(r.CalendarID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "calendar_id", r.CalendarID) + } path.WriteString("/") path.WriteString("events") path.WriteString("/") path.WriteString(r.EventID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "event_id", r.EventID) + } params = make(map[string]string) @@ -100,6 +122,9 @@ func (r MLDeleteCalendarEventRequest) Do(ctx context.Context, transport Transpor req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -127,8 +152,17 @@ func (r MLDeleteCalendarEventRequest) Do(ctx context.Context, transport Transpor req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.delete_calendar_event") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.delete_calendar_event") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_calendar_job.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_calendar_job.go index 46fdda9bd..f15a266b2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_calendar_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_calendar_job.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newMLDeleteCalendarJobFunc(t Transport) MLDeleteCalendarJob { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type MLDeleteCalendarJobRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLDeleteCalendarJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLDeleteCalendarJobRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_calendar_job") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_ml") + 1 + len("calendars") + 1 + len(r.CalendarID) + 1 + len("jobs") + 1 + len(r.JobID)) @@ -75,10 +91,16 @@ func (r MLDeleteCalendarJobRequest) Do(ctx context.Context, transport Transport) path.WriteString("calendars") path.WriteString("/") path.WriteString(r.CalendarID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "calendar_id", r.CalendarID) + } path.WriteString("/") path.WriteString("jobs") path.WriteString("/") path.WriteString(r.JobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "job_id", r.JobID) + } params = make(map[string]string) @@ -100,6 +122,9 @@ func (r MLDeleteCalendarJobRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -127,8 +152,17 @@ func (r MLDeleteCalendarJobRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.delete_calendar_job") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.delete_calendar_job") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_data_frame_analytics.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_data_frame_analytics.go index ed4d927e8..2538cb4f2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_data_frame_analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_data_frame_analytics.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newMLDeleteDataFrameAnalyticsFunc(t Transport) MLDeleteDataFrameAnalytics { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -59,16 +64,27 @@ type MLDeleteDataFrameAnalyticsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLDeleteDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLDeleteDataFrameAnalyticsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_data_frame_analytics") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_ml") + 1 + len("data_frame") + 1 + len("analytics") + 1 + len(r.ID)) @@ -81,6 +97,9 @@ func (r MLDeleteDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tra path.WriteString("analytics") path.WriteString("/") path.WriteString(r.ID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.ID) + } params = make(map[string]string) @@ -110,6 +129,9 @@ func (r MLDeleteDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tra req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -137,8 +159,17 @@ func (r MLDeleteDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tra req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.delete_data_frame_analytics") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.delete_data_frame_analytics") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_datafeed.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_datafeed.go index 3c0b46ffd..09012b24b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_datafeed.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_datafeed.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLDeleteDatafeedFunc(t Transport) MLDeleteDatafeed { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type MLDeleteDatafeedRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLDeleteDatafeedRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLDeleteDatafeedRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_datafeed") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_ml") + 1 + len("datafeeds") + 1 + len(r.DatafeedID)) @@ -77,6 +93,9 @@ func (r MLDeleteDatafeedRequest) Do(ctx context.Context, transport Transport) (* path.WriteString("datafeeds") path.WriteString("/") path.WriteString(r.DatafeedID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "datafeed_id", r.DatafeedID) + } params = make(map[string]string) @@ -102,6 +121,9 @@ func (r MLDeleteDatafeedRequest) Do(ctx context.Context, transport Transport) (* req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -129,8 +151,17 @@ func (r MLDeleteDatafeedRequest) Do(ctx context.Context, transport Transport) (* req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.delete_datafeed") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.delete_datafeed") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_expired_data.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_expired_data.go index 2ff710352..868c36510 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_expired_data.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_expired_data.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newMLDeleteExpiredDataFunc(t Transport) MLDeleteExpiredData { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -62,16 +67,27 @@ type MLDeleteExpiredDataRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLDeleteExpiredDataRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLDeleteExpiredDataRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_expired_data") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_ml") + 1 + len("_delete_expired_data") + 1 + len(r.JobID)) @@ -83,6 +99,9 @@ func (r MLDeleteExpiredDataRequest) Do(ctx context.Context, transport Transport) if r.JobID != "" { path.WriteString("/") path.WriteString(r.JobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "job_id", r.JobID) + } } params = make(map[string]string) @@ -113,6 +132,9 @@ func (r MLDeleteExpiredDataRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -144,8 +166,20 @@ func (r MLDeleteExpiredDataRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.delete_expired_data") + if reader := instrument.RecordRequestBody(ctx, "ml.delete_expired_data", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.delete_expired_data") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_filter.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_filter.go index 790c25ab5..e88ba7d8d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_filter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_filter.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newMLDeleteFilterFunc(t Transport) MLDeleteFilter { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type MLDeleteFilterRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLDeleteFilterRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLDeleteFilterRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_filter") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_ml") + 1 + len("filters") + 1 + len(r.FilterID)) @@ -74,6 +90,9 @@ func (r MLDeleteFilterRequest) Do(ctx context.Context, transport Transport) (*Re path.WriteString("filters") path.WriteString("/") path.WriteString(r.FilterID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "filter_id", r.FilterID) + } params = make(map[string]string) @@ -95,6 +114,9 @@ func (r MLDeleteFilterRequest) Do(ctx context.Context, transport Transport) (*Re req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +144,17 @@ func (r MLDeleteFilterRequest) Do(ctx context.Context, transport Transport) (*Re req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.delete_filter") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.delete_filter") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_forecast.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_forecast.go index 8820d559d..9667840e7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_forecast.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_forecast.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newMLDeleteForecastFunc(t Transport) MLDeleteForecast { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -60,16 +65,27 @@ type MLDeleteForecastRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLDeleteForecastRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLDeleteForecastRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_forecast") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("_forecast") + 1 + len(r.ForecastID)) @@ -80,11 +96,17 @@ func (r MLDeleteForecastRequest) Do(ctx context.Context, transport Transport) (* path.WriteString("anomaly_detectors") path.WriteString("/") path.WriteString(r.JobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "job_id", r.JobID) + } path.WriteString("/") path.WriteString("_forecast") if r.ForecastID != "" { path.WriteString("/") path.WriteString(r.ForecastID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "forecast_id", r.ForecastID) + } } params = make(map[string]string) @@ -115,6 +137,9 @@ func (r MLDeleteForecastRequest) Do(ctx context.Context, transport Transport) (* req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -142,8 +167,17 @@ func (r MLDeleteForecastRequest) Do(ctx context.Context, transport Transport) (* req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.delete_forecast") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.delete_forecast") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_job.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_job.go index 5180253db..b4c82a97b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_job.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLDeleteJobFunc(t Transport) MLDeleteJob { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -59,16 +64,27 @@ type MLDeleteJobRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLDeleteJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLDeleteJobRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_job") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID)) @@ -79,6 +95,9 @@ func (r MLDeleteJobRequest) Do(ctx context.Context, transport Transport) (*Respo path.WriteString("anomaly_detectors") path.WriteString("/") path.WriteString(r.JobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "job_id", r.JobID) + } params = make(map[string]string) @@ -112,6 +131,9 @@ func (r MLDeleteJobRequest) Do(ctx context.Context, transport Transport) (*Respo req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -139,8 +161,17 @@ func (r MLDeleteJobRequest) Do(ctx context.Context, transport Transport) (*Respo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.delete_job") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.delete_job") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_model_snapshot.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_model_snapshot.go index 55c1a6993..0ecbc34cb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_model_snapshot.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_model_snapshot.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newMLDeleteModelSnapshotFunc(t Transport) MLDeleteModelSnapshot { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type MLDeleteModelSnapshotRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLDeleteModelSnapshotRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLDeleteModelSnapshotRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_model_snapshot") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("model_snapshots") + 1 + len(r.SnapshotID)) @@ -75,10 +91,16 @@ func (r MLDeleteModelSnapshotRequest) Do(ctx context.Context, transport Transpor path.WriteString("anomaly_detectors") path.WriteString("/") path.WriteString(r.JobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "job_id", r.JobID) + } path.WriteString("/") path.WriteString("model_snapshots") path.WriteString("/") path.WriteString(r.SnapshotID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "snapshot_id", r.SnapshotID) + } params = make(map[string]string) @@ -100,6 +122,9 @@ func (r MLDeleteModelSnapshotRequest) Do(ctx context.Context, transport Transpor req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -127,8 +152,17 @@ func (r MLDeleteModelSnapshotRequest) Do(ctx context.Context, transport Transpor req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.delete_model_snapshot") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.delete_model_snapshot") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_trained_model.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_trained_model.go index 44fb58ff8..38a299e70 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_trained_model.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_trained_model.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newMLDeleteTrainedModelFunc(t Transport) MLDeleteTrainedModel { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -59,16 +64,27 @@ type MLDeleteTrainedModelRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLDeleteTrainedModelRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLDeleteTrainedModelRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_trained_model") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_ml") + 1 + len("trained_models") + 1 + len(r.ModelID)) @@ -79,6 +95,9 @@ func (r MLDeleteTrainedModelRequest) Do(ctx context.Context, transport Transport path.WriteString("trained_models") path.WriteString("/") path.WriteString(r.ModelID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "model_id", r.ModelID) + } params = make(map[string]string) @@ -108,6 +127,9 @@ func (r MLDeleteTrainedModelRequest) Do(ctx context.Context, transport Transport req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -135,8 +157,17 @@ func (r MLDeleteTrainedModelRequest) Do(ctx context.Context, transport Transport req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.delete_trained_model") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.delete_trained_model") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_trained_model_alias.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_trained_model_alias.go index ccbbdc7c3..37a0cab97 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_trained_model_alias.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.delete_trained_model_alias.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newMLDeleteTrainedModelAliasFunc(t Transport) MLDeleteTrainedModelAlias { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type MLDeleteTrainedModelAliasRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLDeleteTrainedModelAliasRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLDeleteTrainedModelAliasRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_trained_model_alias") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_ml") + 1 + len("trained_models") + 1 + len(r.ModelID) + 1 + len("model_aliases") + 1 + len(r.ModelAlias)) @@ -75,10 +91,16 @@ func (r MLDeleteTrainedModelAliasRequest) Do(ctx context.Context, transport Tran path.WriteString("trained_models") path.WriteString("/") path.WriteString(r.ModelID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "model_id", r.ModelID) + } path.WriteString("/") path.WriteString("model_aliases") path.WriteString("/") path.WriteString(r.ModelAlias) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "model_alias", r.ModelAlias) + } params = make(map[string]string) @@ -100,6 +122,9 @@ func (r MLDeleteTrainedModelAliasRequest) Do(ctx context.Context, transport Tran req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -127,8 +152,17 @@ func (r MLDeleteTrainedModelAliasRequest) Do(ctx context.Context, transport Tran req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.delete_trained_model_alias") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.delete_trained_model_alias") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.estimate_model_memory.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.estimate_model_memory.go index d47f3a07e..9aac0ac62 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.estimate_model_memory.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.estimate_model_memory.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLEstimateModelMemoryFunc(t Transport) MLEstimateModelMemory { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type MLEstimateModelMemoryRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLEstimateModelMemoryRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLEstimateModelMemoryRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.estimate_model_memory") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_ml/anomaly_detectors/_estimate_model_memory")) @@ -91,6 +107,9 @@ func (r MLEstimateModelMemoryRequest) Do(ctx context.Context, transport Transpor req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +141,20 @@ func (r MLEstimateModelMemoryRequest) Do(ctx context.Context, transport Transpor req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.estimate_model_memory") + if reader := instrument.RecordRequestBody(ctx, "ml.estimate_model_memory", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.estimate_model_memory") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.evaluate_data_frame.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.evaluate_data_frame.go index 5cb640266..d2da56d5e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.evaluate_data_frame.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.evaluate_data_frame.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLEvaluateDataFrameFunc(t Transport) MLEvaluateDataFrame { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type MLEvaluateDataFrameRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLEvaluateDataFrameRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLEvaluateDataFrameRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.evaluate_data_frame") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_ml/data_frame/_evaluate")) @@ -91,6 +107,9 @@ func (r MLEvaluateDataFrameRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +141,20 @@ func (r MLEvaluateDataFrameRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.evaluate_data_frame") + if reader := instrument.RecordRequestBody(ctx, "ml.evaluate_data_frame", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.evaluate_data_frame") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.explain_data_frame_analytics.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.explain_data_frame_analytics.go index 1eac7dc28..5b990b2cb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.explain_data_frame_analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.explain_data_frame_analytics.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLExplainDataFrameAnalyticsFunc(t Transport) MLExplainDataFrameAnalytics for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type MLExplainDataFrameAnalyticsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLExplainDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLExplainDataFrameAnalyticsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.explain_data_frame_analytics") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ml") + 1 + len("data_frame") + 1 + len("analytics") + 1 + len(r.DocumentID) + 1 + len("_explain")) @@ -80,6 +96,9 @@ func (r MLExplainDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tr if r.DocumentID != "" { path.WriteString("/") path.WriteString(r.DocumentID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.DocumentID) + } } path.WriteString("/") path.WriteString("_explain") @@ -104,6 +123,9 @@ func (r MLExplainDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tr req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -135,8 +157,20 @@ func (r MLExplainDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tr req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.explain_data_frame_analytics") + if reader := instrument.RecordRequestBody(ctx, "ml.explain_data_frame_analytics", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.explain_data_frame_analytics") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.flush_job.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.flush_job.go index ce7252a07..73f831555 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.flush_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.flush_job.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newMLFlushJobFunc(t Transport) MLFlushJob { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -64,16 +69,27 @@ type MLFlushJobRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLFlushJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLFlushJobRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.flush_job") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("_flush")) @@ -84,6 +100,9 @@ func (r MLFlushJobRequest) Do(ctx context.Context, transport Transport) (*Respon path.WriteString("anomaly_detectors") path.WriteString("/") path.WriteString(r.JobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "job_id", r.JobID) + } path.WriteString("/") path.WriteString("_flush") @@ -127,6 +146,9 @@ func (r MLFlushJobRequest) Do(ctx context.Context, transport Transport) (*Respon req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -158,8 +180,20 @@ func (r MLFlushJobRequest) Do(ctx context.Context, transport Transport) (*Respon req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.flush_job") + if reader := instrument.RecordRequestBody(ctx, "ml.flush_job", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.flush_job") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.forecast.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.forecast.go index b0efc7208..74908ad3f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.forecast.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.forecast.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newMLForecastFunc(t Transport) MLForecast { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -62,16 +67,27 @@ type MLForecastRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLForecastRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLForecastRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.forecast") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("_forecast")) @@ -82,6 +98,9 @@ func (r MLForecastRequest) Do(ctx context.Context, transport Transport) (*Respon path.WriteString("anomaly_detectors") path.WriteString("/") path.WriteString(r.JobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "job_id", r.JobID) + } path.WriteString("/") path.WriteString("_forecast") @@ -117,6 +136,9 @@ func (r MLForecastRequest) Do(ctx context.Context, transport Transport) (*Respon req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -148,8 +170,20 @@ func (r MLForecastRequest) Do(ctx context.Context, transport Transport) (*Respon req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.forecast") + if reader := instrument.RecordRequestBody(ctx, "ml.forecast", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.forecast") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_buckets.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_buckets.go index 30d34fd64..eb59ba4c7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_buckets.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_buckets.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newMLGetBucketsFunc(t Transport) MLGetBuckets { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -70,16 +75,27 @@ type MLGetBucketsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLGetBucketsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLGetBucketsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_buckets") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("results") + 1 + len("buckets") + 1 + len(r.Timestamp)) @@ -90,6 +106,9 @@ func (r MLGetBucketsRequest) Do(ctx context.Context, transport Transport) (*Resp path.WriteString("anomaly_detectors") path.WriteString("/") path.WriteString(r.JobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "job_id", r.JobID) + } path.WriteString("/") path.WriteString("results") path.WriteString("/") @@ -97,6 +116,9 @@ func (r MLGetBucketsRequest) Do(ctx context.Context, transport Transport) (*Resp if r.Timestamp != "" { path.WriteString("/") path.WriteString(r.Timestamp) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "timestamp", r.Timestamp) + } } params = make(map[string]string) @@ -155,6 +177,9 @@ func (r MLGetBucketsRequest) Do(ctx context.Context, transport Transport) (*Resp req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -186,8 +211,20 @@ func (r MLGetBucketsRequest) Do(ctx context.Context, transport Transport) (*Resp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_buckets") + if reader := instrument.RecordRequestBody(ctx, "ml.get_buckets", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_buckets") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_calendar_events.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_calendar_events.go index 1f200e2d0..ea3287894 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_calendar_events.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_calendar_events.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newMLGetCalendarEventsFunc(t Transport) MLGetCalendarEvents { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -62,16 +67,27 @@ type MLGetCalendarEventsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLGetCalendarEventsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLGetCalendarEventsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_calendar_events") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_ml") + 1 + len("calendars") + 1 + len(r.CalendarID) + 1 + len("events")) @@ -82,6 +98,9 @@ func (r MLGetCalendarEventsRequest) Do(ctx context.Context, transport Transport) path.WriteString("calendars") path.WriteString("/") path.WriteString(r.CalendarID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "calendar_id", r.CalendarID) + } path.WriteString("/") path.WriteString("events") @@ -125,6 +144,9 @@ func (r MLGetCalendarEventsRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -152,8 +174,17 @@ func (r MLGetCalendarEventsRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_calendar_events") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_calendar_events") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_calendars.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_calendars.go index f4692bfb0..a1584e629 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_calendars.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_calendars.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newMLGetCalendarsFunc(t Transport) MLGetCalendars { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -61,16 +66,27 @@ type MLGetCalendarsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLGetCalendarsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLGetCalendarsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_calendars") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ml") + 1 + len("calendars") + 1 + len(r.CalendarID)) @@ -82,6 +98,9 @@ func (r MLGetCalendarsRequest) Do(ctx context.Context, transport Transport) (*Re if r.CalendarID != "" { path.WriteString("/") path.WriteString(r.CalendarID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "calendar_id", r.CalendarID) + } } params = make(map[string]string) @@ -112,6 +131,9 @@ func (r MLGetCalendarsRequest) Do(ctx context.Context, transport Transport) (*Re req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -143,8 +165,20 @@ func (r MLGetCalendarsRequest) Do(ctx context.Context, transport Transport) (*Re req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_calendars") + if reader := instrument.RecordRequestBody(ctx, "ml.get_calendars", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_calendars") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_categories.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_categories.go index b9586b218..6929c2e89 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_categories.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_categories.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newMLGetCategoriesFunc(t Transport) MLGetCategories { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -63,16 +68,27 @@ type MLGetCategoriesRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLGetCategoriesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLGetCategoriesRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_categories") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("results") + 1 + len("categories")) @@ -83,6 +99,9 @@ func (r MLGetCategoriesRequest) Do(ctx context.Context, transport Transport) (*R path.WriteString("anomaly_detectors") path.WriteString("/") path.WriteString(r.JobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "job_id", r.JobID) + } path.WriteString("/") path.WriteString("results") path.WriteString("/") @@ -92,6 +111,9 @@ func (r MLGetCategoriesRequest) Do(ctx context.Context, transport Transport) (*R path.Grow(1 + len(value)) path.WriteString("/") path.WriteString(value) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "category_id", value) + } } params = make(map[string]string) @@ -126,6 +148,9 @@ func (r MLGetCategoriesRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -157,8 +182,20 @@ func (r MLGetCategoriesRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_categories") + if reader := instrument.RecordRequestBody(ctx, "ml.get_categories", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_categories") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_data_frame_analytics.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_data_frame_analytics.go index 39bda0a7e..4c5bc2e1e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_data_frame_analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_data_frame_analytics.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLGetDataFrameAnalyticsFunc(t Transport) MLGetDataFrameAnalytics { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -60,16 +65,27 @@ type MLGetDataFrameAnalyticsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLGetDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLGetDataFrameAnalyticsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_data_frame_analytics") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_ml") + 1 + len("data_frame") + 1 + len("analytics") + 1 + len(r.ID)) @@ -83,6 +99,9 @@ func (r MLGetDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transp if r.ID != "" { path.WriteString("/") path.WriteString(r.ID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.ID) + } } params = make(map[string]string) @@ -121,6 +140,9 @@ func (r MLGetDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -148,8 +170,17 @@ func (r MLGetDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_data_frame_analytics") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_data_frame_analytics") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_data_frame_analytics_stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_data_frame_analytics_stats.go index d7d96a458..694afae3e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_data_frame_analytics_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_data_frame_analytics_stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLGetDataFrameAnalyticsStatsFunc(t Transport) MLGetDataFrameAnalyticsSta for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -60,16 +65,27 @@ type MLGetDataFrameAnalyticsStatsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLGetDataFrameAnalyticsStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLGetDataFrameAnalyticsStatsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_data_frame_analytics_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_ml") + 1 + len("data_frame") + 1 + len("analytics") + 1 + len(r.ID) + 1 + len("_stats")) @@ -83,6 +99,9 @@ func (r MLGetDataFrameAnalyticsStatsRequest) Do(ctx context.Context, transport T if r.ID != "" { path.WriteString("/") path.WriteString(r.ID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.ID) + } } path.WriteString("/") path.WriteString("_stats") @@ -123,6 +142,9 @@ func (r MLGetDataFrameAnalyticsStatsRequest) Do(ctx context.Context, transport T req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -150,8 +172,17 @@ func (r MLGetDataFrameAnalyticsStatsRequest) Do(ctx context.Context, transport T req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_data_frame_analytics_stats") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_data_frame_analytics_stats") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_datafeed_stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_datafeed_stats.go index 663c6fb48..2c647426c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_datafeed_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_datafeed_stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLGetDatafeedStatsFunc(t Transport) MLGetDatafeedStats { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type MLGetDatafeedStatsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLGetDatafeedStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLGetDatafeedStatsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_datafeed_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_ml") + 1 + len("datafeeds") + 1 + len(r.DatafeedID) + 1 + len("_stats")) @@ -78,6 +94,9 @@ func (r MLGetDatafeedStatsRequest) Do(ctx context.Context, transport Transport) if r.DatafeedID != "" { path.WriteString("/") path.WriteString(r.DatafeedID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "datafeed_id", r.DatafeedID) + } } path.WriteString("/") path.WriteString("_stats") @@ -106,6 +125,9 @@ func (r MLGetDatafeedStatsRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -133,8 +155,17 @@ func (r MLGetDatafeedStatsRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_datafeed_stats") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_datafeed_stats") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_datafeeds.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_datafeeds.go index 08abcc18a..1c1171bde 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_datafeeds.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_datafeeds.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLGetDatafeedsFunc(t Transport) MLGetDatafeeds { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -58,16 +63,27 @@ type MLGetDatafeedsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLGetDatafeedsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLGetDatafeedsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_datafeeds") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_ml") + 1 + len("datafeeds") + 1 + len(r.DatafeedID)) @@ -79,6 +95,9 @@ func (r MLGetDatafeedsRequest) Do(ctx context.Context, transport Transport) (*Re if r.DatafeedID != "" { path.WriteString("/") path.WriteString(r.DatafeedID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "datafeed_id", r.DatafeedID) + } } params = make(map[string]string) @@ -109,6 +128,9 @@ func (r MLGetDatafeedsRequest) Do(ctx context.Context, transport Transport) (*Re req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -136,8 +158,17 @@ func (r MLGetDatafeedsRequest) Do(ctx context.Context, transport Transport) (*Re req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_datafeeds") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_datafeeds") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_filters.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_filters.go index 2028809fd..db045cba6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_filters.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_filters.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLGetFiltersFunc(t Transport) MLGetFilters { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -58,16 +63,27 @@ type MLGetFiltersRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLGetFiltersRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLGetFiltersRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_filters") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_ml") + 1 + len("filters") + 1 + len(r.FilterID)) @@ -79,6 +95,9 @@ func (r MLGetFiltersRequest) Do(ctx context.Context, transport Transport) (*Resp if r.FilterID != "" { path.WriteString("/") path.WriteString(r.FilterID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "filter_id", r.FilterID) + } } params = make(map[string]string) @@ -109,6 +128,9 @@ func (r MLGetFiltersRequest) Do(ctx context.Context, transport Transport) (*Resp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -136,8 +158,17 @@ func (r MLGetFiltersRequest) Do(ctx context.Context, transport Transport) (*Resp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_filters") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_filters") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_influencers.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_influencers.go index a9e2dd3f7..743702b64 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_influencers.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_influencers.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newMLGetInfluencersFunc(t Transport) MLGetInfluencers { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -68,16 +73,27 @@ type MLGetInfluencersRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLGetInfluencersRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLGetInfluencersRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_influencers") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("results") + 1 + len("influencers")) @@ -88,6 +104,9 @@ func (r MLGetInfluencersRequest) Do(ctx context.Context, transport Transport) (* path.WriteString("anomaly_detectors") path.WriteString("/") path.WriteString(r.JobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "job_id", r.JobID) + } path.WriteString("/") path.WriteString("results") path.WriteString("/") @@ -145,6 +164,9 @@ func (r MLGetInfluencersRequest) Do(ctx context.Context, transport Transport) (* req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -176,8 +198,20 @@ func (r MLGetInfluencersRequest) Do(ctx context.Context, transport Transport) (* req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_influencers") + if reader := instrument.RecordRequestBody(ctx, "ml.get_influencers", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_influencers") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_job_stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_job_stats.go index 0c0be6fa3..066654e4d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_job_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_job_stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLGetJobStatsFunc(t Transport) MLGetJobStats { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type MLGetJobStatsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLGetJobStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLGetJobStatsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_job_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("_stats")) @@ -78,6 +94,9 @@ func (r MLGetJobStatsRequest) Do(ctx context.Context, transport Transport) (*Res if r.JobID != "" { path.WriteString("/") path.WriteString(r.JobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "job_id", r.JobID) + } } path.WriteString("/") path.WriteString("_stats") @@ -106,6 +125,9 @@ func (r MLGetJobStatsRequest) Do(ctx context.Context, transport Transport) (*Res req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -133,8 +155,17 @@ func (r MLGetJobStatsRequest) Do(ctx context.Context, transport Transport) (*Res req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_job_stats") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_job_stats") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_jobs.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_jobs.go index f2af6d2a3..6b345a5e8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_jobs.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_jobs.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLGetJobsFunc(t Transport) MLGetJobs { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -58,16 +63,27 @@ type MLGetJobsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLGetJobsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLGetJobsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_jobs") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID)) @@ -79,6 +95,9 @@ func (r MLGetJobsRequest) Do(ctx context.Context, transport Transport) (*Respons if r.JobID != "" { path.WriteString("/") path.WriteString(r.JobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "job_id", r.JobID) + } } params = make(map[string]string) @@ -109,6 +128,9 @@ func (r MLGetJobsRequest) Do(ctx context.Context, transport Transport) (*Respons req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -136,8 +158,17 @@ func (r MLGetJobsRequest) Do(ctx context.Context, transport Transport) (*Respons req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_jobs") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_jobs") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_memory_stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_memory_stats.go index 827379de3..07c5bbfc4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_memory_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_memory_stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLGetMemoryStatsFunc(t Transport) MLGetMemoryStats { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -58,16 +63,27 @@ type MLGetMemoryStatsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLGetMemoryStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLGetMemoryStatsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_memory_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_ml") + 1 + len("memory") + 1 + len(r.NodeID) + 1 + len("_stats")) @@ -79,6 +95,9 @@ func (r MLGetMemoryStatsRequest) Do(ctx context.Context, transport Transport) (* if r.NodeID != "" { path.WriteString("/") path.WriteString(r.NodeID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "node_id", r.NodeID) + } } path.WriteString("/") path.WriteString("_stats") @@ -111,6 +130,9 @@ func (r MLGetMemoryStatsRequest) Do(ctx context.Context, transport Transport) (* req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -138,8 +160,17 @@ func (r MLGetMemoryStatsRequest) Do(ctx context.Context, transport Transport) (* req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_memory_stats") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_memory_stats") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_model_snapshot_upgrade_stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_model_snapshot_upgrade_stats.go index 0cd1ed946..edfefed82 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_model_snapshot_upgrade_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_model_snapshot_upgrade_stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLGetModelSnapshotUpgradeStatsFunc(t Transport) MLGetModelSnapshotUpgrad for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -58,16 +63,27 @@ type MLGetModelSnapshotUpgradeStatsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLGetModelSnapshotUpgradeStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLGetModelSnapshotUpgradeStatsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_model_snapshot_upgrade_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("model_snapshots") + 1 + len(r.SnapshotID) + 1 + len("_upgrade") + 1 + len("_stats")) @@ -78,10 +94,16 @@ func (r MLGetModelSnapshotUpgradeStatsRequest) Do(ctx context.Context, transport path.WriteString("anomaly_detectors") path.WriteString("/") path.WriteString(r.JobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "job_id", r.JobID) + } path.WriteString("/") path.WriteString("model_snapshots") path.WriteString("/") path.WriteString(r.SnapshotID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "snapshot_id", r.SnapshotID) + } path.WriteString("/") path.WriteString("_upgrade") path.WriteString("/") @@ -111,6 +133,9 @@ func (r MLGetModelSnapshotUpgradeStatsRequest) Do(ctx context.Context, transport req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -138,8 +163,17 @@ func (r MLGetModelSnapshotUpgradeStatsRequest) Do(ctx context.Context, transport req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_model_snapshot_upgrade_stats") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_model_snapshot_upgrade_stats") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_model_snapshots.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_model_snapshots.go index 3478bdfda..14001c279 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_model_snapshots.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_model_snapshots.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newMLGetModelSnapshotsFunc(t Transport) MLGetModelSnapshots { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -67,16 +72,27 @@ type MLGetModelSnapshotsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLGetModelSnapshotsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLGetModelSnapshotsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_model_snapshots") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("model_snapshots") + 1 + len(r.SnapshotID)) @@ -87,11 +103,17 @@ func (r MLGetModelSnapshotsRequest) Do(ctx context.Context, transport Transport) path.WriteString("anomaly_detectors") path.WriteString("/") path.WriteString(r.JobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "job_id", r.JobID) + } path.WriteString("/") path.WriteString("model_snapshots") if r.SnapshotID != "" { path.WriteString("/") path.WriteString(r.SnapshotID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "snapshot_id", r.SnapshotID) + } } params = make(map[string]string) @@ -138,6 +160,9 @@ func (r MLGetModelSnapshotsRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -169,8 +194,20 @@ func (r MLGetModelSnapshotsRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_model_snapshots") + if reader := instrument.RecordRequestBody(ctx, "ml.get_model_snapshots", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_model_snapshots") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_overall_buckets.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_overall_buckets.go index e392d3883..bf5d5c042 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_overall_buckets.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_overall_buckets.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newMLGetOverallBucketsFunc(t Transport) MLGetOverallBuckets { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -67,16 +72,27 @@ type MLGetOverallBucketsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLGetOverallBucketsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLGetOverallBucketsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_overall_buckets") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("results") + 1 + len("overall_buckets")) @@ -87,6 +103,9 @@ func (r MLGetOverallBucketsRequest) Do(ctx context.Context, transport Transport) path.WriteString("anomaly_detectors") path.WriteString("/") path.WriteString(r.JobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "job_id", r.JobID) + } path.WriteString("/") path.WriteString("results") path.WriteString("/") @@ -140,6 +159,9 @@ func (r MLGetOverallBucketsRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -171,8 +193,20 @@ func (r MLGetOverallBucketsRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_overall_buckets") + if reader := instrument.RecordRequestBody(ctx, "ml.get_overall_buckets", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_overall_buckets") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_records.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_records.go index 83fad6221..6b1952451 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_records.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_records.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newMLGetRecordsFunc(t Transport) MLGetRecords { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -68,16 +73,27 @@ type MLGetRecordsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLGetRecordsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLGetRecordsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_records") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("results") + 1 + len("records")) @@ -88,6 +104,9 @@ func (r MLGetRecordsRequest) Do(ctx context.Context, transport Transport) (*Resp path.WriteString("anomaly_detectors") path.WriteString("/") path.WriteString(r.JobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "job_id", r.JobID) + } path.WriteString("/") path.WriteString("results") path.WriteString("/") @@ -145,6 +164,9 @@ func (r MLGetRecordsRequest) Do(ctx context.Context, transport Transport) (*Resp req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -176,8 +198,20 @@ func (r MLGetRecordsRequest) Do(ctx context.Context, transport Transport) (*Resp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_records") + if reader := instrument.RecordRequestBody(ctx, "ml.get_records", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_records") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_trained_models.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_trained_models.go index c80de65ab..f58469220 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_trained_models.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_trained_models.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLGetTrainedModelsFunc(t Transport) MLGetTrainedModels { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -64,16 +69,27 @@ type MLGetTrainedModelsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLGetTrainedModelsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLGetTrainedModelsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_trained_models") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_ml") + 1 + len("trained_models") + 1 + len(r.ModelID)) @@ -85,6 +101,9 @@ func (r MLGetTrainedModelsRequest) Do(ctx context.Context, transport Transport) if r.ModelID != "" { path.WriteString("/") path.WriteString(r.ModelID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "model_id", r.ModelID) + } } params = make(map[string]string) @@ -139,6 +158,9 @@ func (r MLGetTrainedModelsRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -166,8 +188,17 @@ func (r MLGetTrainedModelsRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_trained_models") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_trained_models") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_trained_models_stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_trained_models_stats.go index c85217995..8c3de9267 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_trained_models_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.get_trained_models_stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLGetTrainedModelsStatsFunc(t Transport) MLGetTrainedModelsStats { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -59,16 +64,27 @@ type MLGetTrainedModelsStatsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLGetTrainedModelsStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLGetTrainedModelsStatsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_trained_models_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_ml") + 1 + len("trained_models") + 1 + len(r.ModelID) + 1 + len("_stats")) @@ -80,6 +96,9 @@ func (r MLGetTrainedModelsStatsRequest) Do(ctx context.Context, transport Transp if r.ModelID != "" { path.WriteString("/") path.WriteString(r.ModelID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "model_id", r.ModelID) + } } path.WriteString("/") path.WriteString("_stats") @@ -116,6 +135,9 @@ func (r MLGetTrainedModelsStatsRequest) Do(ctx context.Context, transport Transp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -143,8 +165,17 @@ func (r MLGetTrainedModelsStatsRequest) Do(ctx context.Context, transport Transp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_trained_models_stats") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_trained_models_stats") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.infer_trained_model.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.infer_trained_model.go index f2e386d56..e96b60d42 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.infer_trained_model.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.infer_trained_model.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newMLInferTrainedModelFunc(t Transport) MLInferTrainedModel { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -60,16 +65,27 @@ type MLInferTrainedModelRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLInferTrainedModelRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLInferTrainedModelRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.infer_trained_model") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ml") + 1 + len("trained_models") + 1 + len(r.ModelID) + 1 + len("deployment") + 1 + len("_infer")) @@ -80,6 +96,9 @@ func (r MLInferTrainedModelRequest) Do(ctx context.Context, transport Transport) path.WriteString("trained_models") path.WriteString("/") path.WriteString(r.ModelID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "model_id", r.ModelID) + } path.WriteString("/") path.WriteString("deployment") path.WriteString("/") @@ -109,6 +128,9 @@ func (r MLInferTrainedModelRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -140,8 +162,20 @@ func (r MLInferTrainedModelRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.infer_trained_model") + if reader := instrument.RecordRequestBody(ctx, "ml.infer_trained_model", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.infer_trained_model") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.info.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.info.go index b880c2aea..5da35baf2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.info.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.info.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newMLInfoFunc(t Transport) MLInfo { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type MLInfoRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLInfoRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLInfoRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.info") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_ml/info")) @@ -88,6 +104,9 @@ func (r MLInfoRequest) Do(ctx context.Context, transport Transport) (*Response, req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r MLInfoRequest) Do(ctx context.Context, transport Transport) (*Response, req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.info") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.info") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.open_job.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.open_job.go index b7e77607d..a7dfe2366 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.open_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.open_job.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLOpenJobFunc(t Transport) MLOpenJob { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type MLOpenJobRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLOpenJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLOpenJobRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.open_job") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("_open")) @@ -77,6 +93,9 @@ func (r MLOpenJobRequest) Do(ctx context.Context, transport Transport) (*Respons path.WriteString("anomaly_detectors") path.WriteString("/") path.WriteString(r.JobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "job_id", r.JobID) + } path.WriteString("/") path.WriteString("_open") @@ -100,6 +119,9 @@ func (r MLOpenJobRequest) Do(ctx context.Context, transport Transport) (*Respons req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -131,8 +153,20 @@ func (r MLOpenJobRequest) Do(ctx context.Context, transport Transport) (*Respons req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.open_job") + if reader := instrument.RecordRequestBody(ctx, "ml.open_job", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.open_job") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.post_calendar_events.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.post_calendar_events.go index b6e92dbf8..f78de1a61 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.post_calendar_events.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.post_calendar_events.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLPostCalendarEventsFunc(t Transport) MLPostCalendarEvents { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type MLPostCalendarEventsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLPostCalendarEventsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLPostCalendarEventsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.post_calendar_events") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ml") + 1 + len("calendars") + 1 + len(r.CalendarID) + 1 + len("events")) @@ -77,6 +93,9 @@ func (r MLPostCalendarEventsRequest) Do(ctx context.Context, transport Transport path.WriteString("calendars") path.WriteString("/") path.WriteString(r.CalendarID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "calendar_id", r.CalendarID) + } path.WriteString("/") path.WriteString("events") @@ -100,6 +119,9 @@ func (r MLPostCalendarEventsRequest) Do(ctx context.Context, transport Transport req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -131,8 +153,20 @@ func (r MLPostCalendarEventsRequest) Do(ctx context.Context, transport Transport req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.post_calendar_events") + if reader := instrument.RecordRequestBody(ctx, "ml.post_calendar_events", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.post_calendar_events") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.post_data.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.post_data.go index db5cf20e8..1ee00fe55 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.post_data.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.post_data.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLPostDataFunc(t Transport) MLPostData { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -60,16 +65,27 @@ type MLPostDataRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLPostDataRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLPostDataRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.post_data") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("_data")) @@ -80,6 +96,9 @@ func (r MLPostDataRequest) Do(ctx context.Context, transport Transport) (*Respon path.WriteString("anomaly_detectors") path.WriteString("/") path.WriteString(r.JobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "job_id", r.JobID) + } path.WriteString("/") path.WriteString("_data") @@ -111,6 +130,9 @@ func (r MLPostDataRequest) Do(ctx context.Context, transport Transport) (*Respon req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -142,8 +164,20 @@ func (r MLPostDataRequest) Do(ctx context.Context, transport Transport) (*Respon req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.post_data") + if reader := instrument.RecordRequestBody(ctx, "ml.post_data", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.post_data") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.preview_data_frame_analytics.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.preview_data_frame_analytics.go index 7f76fad7b..a1a5334cd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.preview_data_frame_analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.preview_data_frame_analytics.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLPreviewDataFrameAnalyticsFunc(t Transport) MLPreviewDataFrameAnalytics for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type MLPreviewDataFrameAnalyticsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLPreviewDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLPreviewDataFrameAnalyticsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.preview_data_frame_analytics") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ml") + 1 + len("data_frame") + 1 + len("analytics") + 1 + len(r.DocumentID) + 1 + len("_preview")) @@ -80,6 +96,9 @@ func (r MLPreviewDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tr if r.DocumentID != "" { path.WriteString("/") path.WriteString(r.DocumentID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.DocumentID) + } } path.WriteString("/") path.WriteString("_preview") @@ -104,6 +123,9 @@ func (r MLPreviewDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tr req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -135,8 +157,20 @@ func (r MLPreviewDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tr req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.preview_data_frame_analytics") + if reader := instrument.RecordRequestBody(ctx, "ml.preview_data_frame_analytics", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.preview_data_frame_analytics") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.preview_datafeed.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.preview_datafeed.go index e3aee6e51..9926ad4d8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.preview_datafeed.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.preview_datafeed.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLPreviewDatafeedFunc(t Transport) MLPreviewDatafeed { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -60,16 +65,27 @@ type MLPreviewDatafeedRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLPreviewDatafeedRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLPreviewDatafeedRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.preview_datafeed") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ml") + 1 + len("datafeeds") + 1 + len(r.DatafeedID) + 1 + len("_preview")) @@ -81,6 +97,9 @@ func (r MLPreviewDatafeedRequest) Do(ctx context.Context, transport Transport) ( if r.DatafeedID != "" { path.WriteString("/") path.WriteString(r.DatafeedID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "datafeed_id", r.DatafeedID) + } } path.WriteString("/") path.WriteString("_preview") @@ -113,6 +132,9 @@ func (r MLPreviewDatafeedRequest) Do(ctx context.Context, transport Transport) ( req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -144,8 +166,20 @@ func (r MLPreviewDatafeedRequest) Do(ctx context.Context, transport Transport) ( req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.preview_datafeed") + if reader := instrument.RecordRequestBody(ctx, "ml.preview_datafeed", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.preview_datafeed") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_calendar.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_calendar.go index 601a32d2b..5f74bff43 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_calendar.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_calendar.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLPutCalendarFunc(t Transport) MLPutCalendar { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type MLPutCalendarRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLPutCalendarRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLPutCalendarRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.put_calendar") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_ml") + 1 + len("calendars") + 1 + len(r.CalendarID)) @@ -77,6 +93,9 @@ func (r MLPutCalendarRequest) Do(ctx context.Context, transport Transport) (*Res path.WriteString("calendars") path.WriteString("/") path.WriteString(r.CalendarID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "calendar_id", r.CalendarID) + } params = make(map[string]string) @@ -98,6 +117,9 @@ func (r MLPutCalendarRequest) Do(ctx context.Context, transport Transport) (*Res req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -129,8 +151,20 @@ func (r MLPutCalendarRequest) Do(ctx context.Context, transport Transport) (*Res req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.put_calendar") + if reader := instrument.RecordRequestBody(ctx, "ml.put_calendar", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.put_calendar") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_calendar_job.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_calendar_job.go index f84737fad..8ea651648 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_calendar_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_calendar_job.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newMLPutCalendarJobFunc(t Transport) MLPutCalendarJob { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type MLPutCalendarJobRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLPutCalendarJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLPutCalendarJobRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.put_calendar_job") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_ml") + 1 + len("calendars") + 1 + len(r.CalendarID) + 1 + len("jobs") + 1 + len(r.JobID)) @@ -75,10 +91,16 @@ func (r MLPutCalendarJobRequest) Do(ctx context.Context, transport Transport) (* path.WriteString("calendars") path.WriteString("/") path.WriteString(r.CalendarID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "calendar_id", r.CalendarID) + } path.WriteString("/") path.WriteString("jobs") path.WriteString("/") path.WriteString(r.JobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "job_id", r.JobID) + } params = make(map[string]string) @@ -100,6 +122,9 @@ func (r MLPutCalendarJobRequest) Do(ctx context.Context, transport Transport) (* req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -127,8 +152,17 @@ func (r MLPutCalendarJobRequest) Do(ctx context.Context, transport Transport) (* req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.put_calendar_job") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.put_calendar_job") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_data_frame_analytics.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_data_frame_analytics.go index 91c0e6501..26c0e19c1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_data_frame_analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_data_frame_analytics.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLPutDataFrameAnalyticsFunc(t Transport) MLPutDataFrameAnalytics { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type MLPutDataFrameAnalyticsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLPutDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLPutDataFrameAnalyticsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.put_data_frame_analytics") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_ml") + 1 + len("data_frame") + 1 + len("analytics") + 1 + len(r.ID)) @@ -79,6 +95,9 @@ func (r MLPutDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transp path.WriteString("analytics") path.WriteString("/") path.WriteString(r.ID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.ID) + } params = make(map[string]string) @@ -100,6 +119,9 @@ func (r MLPutDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transp req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -131,8 +153,20 @@ func (r MLPutDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.put_data_frame_analytics") + if reader := instrument.RecordRequestBody(ctx, "ml.put_data_frame_analytics", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.put_data_frame_analytics") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_datafeed.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_datafeed.go index e6943675e..f130425d7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_datafeed.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_datafeed.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newMLPutDatafeedFunc(t Transport) MLPutDatafeed { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -63,16 +68,27 @@ type MLPutDatafeedRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLPutDatafeedRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLPutDatafeedRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.put_datafeed") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_ml") + 1 + len("datafeeds") + 1 + len(r.DatafeedID)) @@ -83,6 +99,9 @@ func (r MLPutDatafeedRequest) Do(ctx context.Context, transport Transport) (*Res path.WriteString("datafeeds") path.WriteString("/") path.WriteString(r.DatafeedID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "datafeed_id", r.DatafeedID) + } params = make(map[string]string) @@ -120,6 +139,9 @@ func (r MLPutDatafeedRequest) Do(ctx context.Context, transport Transport) (*Res req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -151,8 +173,20 @@ func (r MLPutDatafeedRequest) Do(ctx context.Context, transport Transport) (*Res req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.put_datafeed") + if reader := instrument.RecordRequestBody(ctx, "ml.put_datafeed", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.put_datafeed") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_filter.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_filter.go index 5e2598b1b..9e2b0e3ff 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_filter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_filter.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLPutFilterFunc(t Transport) MLPutFilter { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type MLPutFilterRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLPutFilterRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLPutFilterRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.put_filter") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_ml") + 1 + len("filters") + 1 + len(r.FilterID)) @@ -77,6 +93,9 @@ func (r MLPutFilterRequest) Do(ctx context.Context, transport Transport) (*Respo path.WriteString("filters") path.WriteString("/") path.WriteString(r.FilterID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "filter_id", r.FilterID) + } params = make(map[string]string) @@ -98,6 +117,9 @@ func (r MLPutFilterRequest) Do(ctx context.Context, transport Transport) (*Respo req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -129,8 +151,20 @@ func (r MLPutFilterRequest) Do(ctx context.Context, transport Transport) (*Respo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.put_filter") + if reader := instrument.RecordRequestBody(ctx, "ml.put_filter", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.put_filter") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_job.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_job.go index b6a82a714..ff3193dee 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_job.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newMLPutJobFunc(t Transport) MLPutJob { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -63,16 +68,27 @@ type MLPutJobRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLPutJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLPutJobRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.put_job") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID)) @@ -83,6 +99,9 @@ func (r MLPutJobRequest) Do(ctx context.Context, transport Transport) (*Response path.WriteString("anomaly_detectors") path.WriteString("/") path.WriteString(r.JobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "job_id", r.JobID) + } params = make(map[string]string) @@ -120,6 +139,9 @@ func (r MLPutJobRequest) Do(ctx context.Context, transport Transport) (*Response req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -151,8 +173,20 @@ func (r MLPutJobRequest) Do(ctx context.Context, transport Transport) (*Response req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.put_job") + if reader := instrument.RecordRequestBody(ctx, "ml.put_job", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.put_job") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_trained_model.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_trained_model.go index f19eb6cd5..b5c589094 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_trained_model.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_trained_model.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newMLPutTrainedModelFunc(t Transport) MLPutTrainedModel { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -61,16 +66,27 @@ type MLPutTrainedModelRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLPutTrainedModelRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLPutTrainedModelRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.put_trained_model") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_ml") + 1 + len("trained_models") + 1 + len(r.ModelID)) @@ -81,6 +97,9 @@ func (r MLPutTrainedModelRequest) Do(ctx context.Context, transport Transport) ( path.WriteString("trained_models") path.WriteString("/") path.WriteString(r.ModelID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "model_id", r.ModelID) + } params = make(map[string]string) @@ -110,6 +129,9 @@ func (r MLPutTrainedModelRequest) Do(ctx context.Context, transport Transport) ( req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -141,8 +163,20 @@ func (r MLPutTrainedModelRequest) Do(ctx context.Context, transport Transport) ( req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.put_trained_model") + if reader := instrument.RecordRequestBody(ctx, "ml.put_trained_model", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.put_trained_model") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_trained_model_alias.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_trained_model_alias.go index 245502df9..e3d2cd54d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_trained_model_alias.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_trained_model_alias.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLPutTrainedModelAliasFunc(t Transport) MLPutTrainedModelAlias { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -58,16 +63,27 @@ type MLPutTrainedModelAliasRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLPutTrainedModelAliasRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLPutTrainedModelAliasRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.put_trained_model_alias") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_ml") + 1 + len("trained_models") + 1 + len(r.ModelID) + 1 + len("model_aliases") + 1 + len(r.ModelAlias)) @@ -78,10 +94,16 @@ func (r MLPutTrainedModelAliasRequest) Do(ctx context.Context, transport Transpo path.WriteString("trained_models") path.WriteString("/") path.WriteString(r.ModelID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "model_id", r.ModelID) + } path.WriteString("/") path.WriteString("model_aliases") path.WriteString("/") path.WriteString(r.ModelAlias) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "model_alias", r.ModelAlias) + } params = make(map[string]string) @@ -107,6 +129,9 @@ func (r MLPutTrainedModelAliasRequest) Do(ctx context.Context, transport Transpo req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -134,8 +159,17 @@ func (r MLPutTrainedModelAliasRequest) Do(ctx context.Context, transport Transpo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.put_trained_model_alias") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.put_trained_model_alias") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_trained_model_definition_part.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_trained_model_definition_part.go index 4f3fe11f0..9a9901385 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_trained_model_definition_part.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_trained_model_definition_part.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newMLPutTrainedModelDefinitionPartFunc(t Transport) MLPutTrainedModelDefini for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -60,16 +65,27 @@ type MLPutTrainedModelDefinitionPartRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLPutTrainedModelDefinitionPartRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLPutTrainedModelDefinitionPartRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.put_trained_model_definition_part") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" if r.Part == nil { @@ -84,10 +100,16 @@ func (r MLPutTrainedModelDefinitionPartRequest) Do(ctx context.Context, transpor path.WriteString("trained_models") path.WriteString("/") path.WriteString(r.ModelID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "model_id", r.ModelID) + } path.WriteString("/") path.WriteString("definition") path.WriteString("/") path.WriteString(strconv.Itoa(*r.Part)) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "part", strconv.Itoa(*r.Part)) + } params = make(map[string]string) @@ -109,6 +131,9 @@ func (r MLPutTrainedModelDefinitionPartRequest) Do(ctx context.Context, transpor req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -140,8 +165,20 @@ func (r MLPutTrainedModelDefinitionPartRequest) Do(ctx context.Context, transpor req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.put_trained_model_definition_part") + if reader := instrument.RecordRequestBody(ctx, "ml.put_trained_model_definition_part", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.put_trained_model_definition_part") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_trained_model_vocabulary.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_trained_model_vocabulary.go index 6c5b4aa09..9cf69609b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_trained_model_vocabulary.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.put_trained_model_vocabulary.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLPutTrainedModelVocabularyFunc(t Transport) MLPutTrainedModelVocabulary for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type MLPutTrainedModelVocabularyRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLPutTrainedModelVocabularyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLPutTrainedModelVocabularyRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.put_trained_model_vocabulary") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_ml") + 1 + len("trained_models") + 1 + len(r.ModelID) + 1 + len("vocabulary")) @@ -77,6 +93,9 @@ func (r MLPutTrainedModelVocabularyRequest) Do(ctx context.Context, transport Tr path.WriteString("trained_models") path.WriteString("/") path.WriteString(r.ModelID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "model_id", r.ModelID) + } path.WriteString("/") path.WriteString("vocabulary") @@ -100,6 +119,9 @@ func (r MLPutTrainedModelVocabularyRequest) Do(ctx context.Context, transport Tr req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -131,8 +153,20 @@ func (r MLPutTrainedModelVocabularyRequest) Do(ctx context.Context, transport Tr req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.put_trained_model_vocabulary") + if reader := instrument.RecordRequestBody(ctx, "ml.put_trained_model_vocabulary", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.put_trained_model_vocabulary") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.reset_job.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.reset_job.go index 8d308c0e7..0ca13a6de 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.reset_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.reset_job.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLResetJobFunc(t Transport) MLResetJob { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -58,16 +63,27 @@ type MLResetJobRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLResetJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLResetJobRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.reset_job") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("_reset")) @@ -78,6 +94,9 @@ func (r MLResetJobRequest) Do(ctx context.Context, transport Transport) (*Respon path.WriteString("anomaly_detectors") path.WriteString("/") path.WriteString(r.JobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "job_id", r.JobID) + } path.WriteString("/") path.WriteString("_reset") @@ -109,6 +128,9 @@ func (r MLResetJobRequest) Do(ctx context.Context, transport Transport) (*Respon req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -136,8 +158,17 @@ func (r MLResetJobRequest) Do(ctx context.Context, transport Transport) (*Respon req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.reset_job") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.reset_job") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.revert_model_snapshot.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.revert_model_snapshot.go index 80a348a85..273565b34 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.revert_model_snapshot.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.revert_model_snapshot.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newMLRevertModelSnapshotFunc(t Transport) MLRevertModelSnapshot { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -61,16 +66,27 @@ type MLRevertModelSnapshotRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLRevertModelSnapshotRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLRevertModelSnapshotRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.revert_model_snapshot") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("model_snapshots") + 1 + len(r.SnapshotID) + 1 + len("_revert")) @@ -81,10 +97,16 @@ func (r MLRevertModelSnapshotRequest) Do(ctx context.Context, transport Transpor path.WriteString("anomaly_detectors") path.WriteString("/") path.WriteString(r.JobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "job_id", r.JobID) + } path.WriteString("/") path.WriteString("model_snapshots") path.WriteString("/") path.WriteString(r.SnapshotID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "snapshot_id", r.SnapshotID) + } path.WriteString("/") path.WriteString("_revert") @@ -112,6 +134,9 @@ func (r MLRevertModelSnapshotRequest) Do(ctx context.Context, transport Transpor req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -143,8 +168,20 @@ func (r MLRevertModelSnapshotRequest) Do(ctx context.Context, transport Transpor req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.revert_model_snapshot") + if reader := instrument.RecordRequestBody(ctx, "ml.revert_model_snapshot", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.revert_model_snapshot") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.set_upgrade_mode.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.set_upgrade_mode.go index 58564690b..feff58a26 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.set_upgrade_mode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.set_upgrade_mode.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newMLSetUpgradeModeFunc(t Transport) MLSetUpgradeMode { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type MLSetUpgradeModeRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLSetUpgradeModeRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLSetUpgradeModeRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.set_upgrade_mode") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_ml/set_upgrade_mode")) @@ -101,6 +117,9 @@ func (r MLSetUpgradeModeRequest) Do(ctx context.Context, transport Transport) (* req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -128,8 +147,17 @@ func (r MLSetUpgradeModeRequest) Do(ctx context.Context, transport Transport) (* req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.set_upgrade_mode") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.set_upgrade_mode") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.start_data_frame_analytics.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.start_data_frame_analytics.go index c17510d9b..a4b6458a5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.start_data_frame_analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.start_data_frame_analytics.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newMLStartDataFrameAnalyticsFunc(t Transport) MLStartDataFrameAnalytics { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -60,16 +65,27 @@ type MLStartDataFrameAnalyticsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLStartDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLStartDataFrameAnalyticsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.start_data_frame_analytics") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ml") + 1 + len("data_frame") + 1 + len("analytics") + 1 + len(r.ID) + 1 + len("_start")) @@ -82,6 +98,9 @@ func (r MLStartDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tran path.WriteString("analytics") path.WriteString("/") path.WriteString(r.ID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.ID) + } path.WriteString("/") path.WriteString("_start") @@ -109,6 +128,9 @@ func (r MLStartDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tran req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -140,8 +162,20 @@ func (r MLStartDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tran req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.start_data_frame_analytics") + if reader := instrument.RecordRequestBody(ctx, "ml.start_data_frame_analytics", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.start_data_frame_analytics") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.start_datafeed.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.start_datafeed.go index 5f751babb..9b62119ce 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.start_datafeed.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.start_datafeed.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newMLStartDatafeedFunc(t Transport) MLStartDatafeed { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -62,16 +67,27 @@ type MLStartDatafeedRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLStartDatafeedRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLStartDatafeedRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.start_datafeed") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ml") + 1 + len("datafeeds") + 1 + len(r.DatafeedID) + 1 + len("_start")) @@ -82,6 +98,9 @@ func (r MLStartDatafeedRequest) Do(ctx context.Context, transport Transport) (*R path.WriteString("datafeeds") path.WriteString("/") path.WriteString(r.DatafeedID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "datafeed_id", r.DatafeedID) + } path.WriteString("/") path.WriteString("_start") @@ -117,6 +136,9 @@ func (r MLStartDatafeedRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -148,8 +170,20 @@ func (r MLStartDatafeedRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.start_datafeed") + if reader := instrument.RecordRequestBody(ctx, "ml.start_datafeed", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.start_datafeed") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.start_trained_model_deployment.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.start_trained_model_deployment.go index 801285515..6ff663936 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.start_trained_model_deployment.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.start_trained_model_deployment.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newMLStartTrainedModelDeploymentFunc(t Transport) MLStartTrainedModelDeploy for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -65,16 +70,27 @@ type MLStartTrainedModelDeploymentRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLStartTrainedModelDeploymentRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLStartTrainedModelDeploymentRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.start_trained_model_deployment") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ml") + 1 + len("trained_models") + 1 + len(r.ModelID) + 1 + len("deployment") + 1 + len("_start")) @@ -85,6 +101,9 @@ func (r MLStartTrainedModelDeploymentRequest) Do(ctx context.Context, transport path.WriteString("trained_models") path.WriteString("/") path.WriteString(r.ModelID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "model_id", r.ModelID) + } path.WriteString("/") path.WriteString("deployment") path.WriteString("/") @@ -142,6 +161,9 @@ func (r MLStartTrainedModelDeploymentRequest) Do(ctx context.Context, transport req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -169,8 +191,17 @@ func (r MLStartTrainedModelDeploymentRequest) Do(ctx context.Context, transport req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.start_trained_model_deployment") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.start_trained_model_deployment") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.stop_data_frame_analytics.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.stop_data_frame_analytics.go index f77733010..b15042727 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.stop_data_frame_analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.stop_data_frame_analytics.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newMLStopDataFrameAnalyticsFunc(t Transport) MLStopDataFrameAnalytics { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -63,16 +68,27 @@ type MLStopDataFrameAnalyticsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLStopDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLStopDataFrameAnalyticsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.stop_data_frame_analytics") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ml") + 1 + len("data_frame") + 1 + len("analytics") + 1 + len(r.ID) + 1 + len("_stop")) @@ -85,6 +101,9 @@ func (r MLStopDataFrameAnalyticsRequest) Do(ctx context.Context, transport Trans path.WriteString("analytics") path.WriteString("/") path.WriteString(r.ID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.ID) + } path.WriteString("/") path.WriteString("_stop") @@ -120,6 +139,9 @@ func (r MLStopDataFrameAnalyticsRequest) Do(ctx context.Context, transport Trans req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -151,8 +173,20 @@ func (r MLStopDataFrameAnalyticsRequest) Do(ctx context.Context, transport Trans req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.stop_data_frame_analytics") + if reader := instrument.RecordRequestBody(ctx, "ml.stop_data_frame_analytics", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.stop_data_frame_analytics") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.stop_datafeed.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.stop_datafeed.go index d2f5d655a..f178a34c4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.stop_datafeed.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.stop_datafeed.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newMLStopDatafeedFunc(t Transport) MLStopDatafeed { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -64,16 +69,27 @@ type MLStopDatafeedRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLStopDatafeedRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLStopDatafeedRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.stop_datafeed") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ml") + 1 + len("datafeeds") + 1 + len(r.DatafeedID) + 1 + len("_stop")) @@ -84,6 +100,9 @@ func (r MLStopDatafeedRequest) Do(ctx context.Context, transport Transport) (*Re path.WriteString("datafeeds") path.WriteString("/") path.WriteString(r.DatafeedID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "datafeed_id", r.DatafeedID) + } path.WriteString("/") path.WriteString("_stop") @@ -123,6 +142,9 @@ func (r MLStopDatafeedRequest) Do(ctx context.Context, transport Transport) (*Re req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -154,8 +176,20 @@ func (r MLStopDatafeedRequest) Do(ctx context.Context, transport Transport) (*Re req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.stop_datafeed") + if reader := instrument.RecordRequestBody(ctx, "ml.stop_datafeed", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.stop_datafeed") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.stop_trained_model_deployment.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.stop_trained_model_deployment.go index 20fa2ad40..42a3808ef 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.stop_trained_model_deployment.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.stop_trained_model_deployment.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newMLStopTrainedModelDeploymentFunc(t Transport) MLStopTrainedModelDeployme for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -61,16 +66,27 @@ type MLStopTrainedModelDeploymentRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLStopTrainedModelDeploymentRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLStopTrainedModelDeploymentRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.stop_trained_model_deployment") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ml") + 1 + len("trained_models") + 1 + len(r.ModelID) + 1 + len("deployment") + 1 + len("_stop")) @@ -81,6 +97,9 @@ func (r MLStopTrainedModelDeploymentRequest) Do(ctx context.Context, transport T path.WriteString("trained_models") path.WriteString("/") path.WriteString(r.ModelID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "model_id", r.ModelID) + } path.WriteString("/") path.WriteString("deployment") path.WriteString("/") @@ -114,6 +133,9 @@ func (r MLStopTrainedModelDeploymentRequest) Do(ctx context.Context, transport T req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -145,8 +167,20 @@ func (r MLStopTrainedModelDeploymentRequest) Do(ctx context.Context, transport T req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.stop_trained_model_deployment") + if reader := instrument.RecordRequestBody(ctx, "ml.stop_trained_model_deployment", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.stop_trained_model_deployment") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.update_data_frame_analytics.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.update_data_frame_analytics.go index 1fcfb05eb..f5795c61e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.update_data_frame_analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.update_data_frame_analytics.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLUpdateDataFrameAnalyticsFunc(t Transport) MLUpdateDataFrameAnalytics { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type MLUpdateDataFrameAnalyticsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLUpdateDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLUpdateDataFrameAnalyticsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.update_data_frame_analytics") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ml") + 1 + len("data_frame") + 1 + len("analytics") + 1 + len(r.DocumentID) + 1 + len("_update")) @@ -79,6 +95,9 @@ func (r MLUpdateDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tra path.WriteString("analytics") path.WriteString("/") path.WriteString(r.DocumentID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.DocumentID) + } path.WriteString("/") path.WriteString("_update") @@ -102,6 +121,9 @@ func (r MLUpdateDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tra req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -133,8 +155,20 @@ func (r MLUpdateDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tra req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.update_data_frame_analytics") + if reader := instrument.RecordRequestBody(ctx, "ml.update_data_frame_analytics", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.update_data_frame_analytics") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.update_datafeed.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.update_datafeed.go index e70b2ac81..2f0efb557 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.update_datafeed.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.update_datafeed.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newMLUpdateDatafeedFunc(t Transport) MLUpdateDatafeed { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -63,16 +68,27 @@ type MLUpdateDatafeedRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLUpdateDatafeedRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLUpdateDatafeedRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.update_datafeed") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ml") + 1 + len("datafeeds") + 1 + len(r.DatafeedID) + 1 + len("_update")) @@ -83,6 +99,9 @@ func (r MLUpdateDatafeedRequest) Do(ctx context.Context, transport Transport) (* path.WriteString("datafeeds") path.WriteString("/") path.WriteString(r.DatafeedID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "datafeed_id", r.DatafeedID) + } path.WriteString("/") path.WriteString("_update") @@ -122,6 +141,9 @@ func (r MLUpdateDatafeedRequest) Do(ctx context.Context, transport Transport) (* req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -153,8 +175,20 @@ func (r MLUpdateDatafeedRequest) Do(ctx context.Context, transport Transport) (* req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.update_datafeed") + if reader := instrument.RecordRequestBody(ctx, "ml.update_datafeed", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.update_datafeed") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.update_filter.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.update_filter.go index 634aacdf6..e35fd196a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.update_filter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.update_filter.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLUpdateFilterFunc(t Transport) MLUpdateFilter { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type MLUpdateFilterRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLUpdateFilterRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLUpdateFilterRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.update_filter") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ml") + 1 + len("filters") + 1 + len(r.FilterID) + 1 + len("_update")) @@ -77,6 +93,9 @@ func (r MLUpdateFilterRequest) Do(ctx context.Context, transport Transport) (*Re path.WriteString("filters") path.WriteString("/") path.WriteString(r.FilterID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "filter_id", r.FilterID) + } path.WriteString("/") path.WriteString("_update") @@ -100,6 +119,9 @@ func (r MLUpdateFilterRequest) Do(ctx context.Context, transport Transport) (*Re req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -131,8 +153,20 @@ func (r MLUpdateFilterRequest) Do(ctx context.Context, transport Transport) (*Re req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.update_filter") + if reader := instrument.RecordRequestBody(ctx, "ml.update_filter", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.update_filter") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.update_job.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.update_job.go index f348f1961..fbd935b3e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.update_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.update_job.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLUpdateJobFunc(t Transport) MLUpdateJob { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type MLUpdateJobRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLUpdateJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLUpdateJobRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.update_job") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("_update")) @@ -77,6 +93,9 @@ func (r MLUpdateJobRequest) Do(ctx context.Context, transport Transport) (*Respo path.WriteString("anomaly_detectors") path.WriteString("/") path.WriteString(r.JobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "job_id", r.JobID) + } path.WriteString("/") path.WriteString("_update") @@ -100,6 +119,9 @@ func (r MLUpdateJobRequest) Do(ctx context.Context, transport Transport) (*Respo req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -131,8 +153,20 @@ func (r MLUpdateJobRequest) Do(ctx context.Context, transport Transport) (*Respo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.update_job") + if reader := instrument.RecordRequestBody(ctx, "ml.update_job", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.update_job") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.update_model_snapshot.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.update_model_snapshot.go index c3684783b..e428a7702 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.update_model_snapshot.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.update_model_snapshot.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLUpdateModelSnapshotFunc(t Transport) MLUpdateModelSnapshot { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -58,16 +63,27 @@ type MLUpdateModelSnapshotRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLUpdateModelSnapshotRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLUpdateModelSnapshotRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.update_model_snapshot") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("model_snapshots") + 1 + len(r.SnapshotID) + 1 + len("_update")) @@ -78,10 +94,16 @@ func (r MLUpdateModelSnapshotRequest) Do(ctx context.Context, transport Transpor path.WriteString("anomaly_detectors") path.WriteString("/") path.WriteString(r.JobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "job_id", r.JobID) + } path.WriteString("/") path.WriteString("model_snapshots") path.WriteString("/") path.WriteString(r.SnapshotID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "snapshot_id", r.SnapshotID) + } path.WriteString("/") path.WriteString("_update") @@ -105,6 +127,9 @@ func (r MLUpdateModelSnapshotRequest) Do(ctx context.Context, transport Transpor req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -136,8 +161,20 @@ func (r MLUpdateModelSnapshotRequest) Do(ctx context.Context, transport Transpor req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.update_model_snapshot") + if reader := instrument.RecordRequestBody(ctx, "ml.update_model_snapshot", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.update_model_snapshot") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.update_trained_model_deployment.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.update_trained_model_deployment.go index 33220332b..72d963fc3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.update_trained_model_deployment.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.update_trained_model_deployment.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLUpdateTrainedModelDeploymentFunc(t Transport) MLUpdateTrainedModelDepl for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -59,16 +64,27 @@ type MLUpdateTrainedModelDeploymentRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLUpdateTrainedModelDeploymentRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLUpdateTrainedModelDeploymentRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.update_trained_model_deployment") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ml") + 1 + len("trained_models") + 1 + len(r.ModelID) + 1 + len("deployment") + 1 + len("_update")) @@ -79,6 +95,9 @@ func (r MLUpdateTrainedModelDeploymentRequest) Do(ctx context.Context, transport path.WriteString("trained_models") path.WriteString("/") path.WriteString(r.ModelID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "model_id", r.ModelID) + } path.WriteString("/") path.WriteString("deployment") path.WriteString("/") @@ -104,6 +123,9 @@ func (r MLUpdateTrainedModelDeploymentRequest) Do(ctx context.Context, transport req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -135,8 +157,20 @@ func (r MLUpdateTrainedModelDeploymentRequest) Do(ctx context.Context, transport req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.update_trained_model_deployment") + if reader := instrument.RecordRequestBody(ctx, "ml.update_trained_model_deployment", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.update_trained_model_deployment") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.upgrade_job_snapshot.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.upgrade_job_snapshot.go index f838126a1..718eb1e3e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.upgrade_job_snapshot.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.upgrade_job_snapshot.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newMLUpgradeJobSnapshotFunc(t Transport) MLUpgradeJobSnapshot { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -60,16 +65,27 @@ type MLUpgradeJobSnapshotRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLUpgradeJobSnapshotRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLUpgradeJobSnapshotRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.upgrade_job_snapshot") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("model_snapshots") + 1 + len(r.SnapshotID) + 1 + len("_upgrade")) @@ -80,10 +96,16 @@ func (r MLUpgradeJobSnapshotRequest) Do(ctx context.Context, transport Transport path.WriteString("anomaly_detectors") path.WriteString("/") path.WriteString(r.JobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "job_id", r.JobID) + } path.WriteString("/") path.WriteString("model_snapshots") path.WriteString("/") path.WriteString(r.SnapshotID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "snapshot_id", r.SnapshotID) + } path.WriteString("/") path.WriteString("_upgrade") @@ -115,6 +137,9 @@ func (r MLUpgradeJobSnapshotRequest) Do(ctx context.Context, transport Transport req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -142,8 +167,17 @@ func (r MLUpgradeJobSnapshotRequest) Do(ctx context.Context, transport Transport req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.upgrade_job_snapshot") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.upgrade_job_snapshot") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.validate.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.validate.go index 061d0cd16..f4a4ec043 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.validate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.validate.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLValidateFunc(t Transport) MLValidate { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type MLValidateRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLValidateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLValidateRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.validate") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_ml/anomaly_detectors/_validate")) @@ -91,6 +107,9 @@ func (r MLValidateRequest) Do(ctx context.Context, transport Transport) (*Respon req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +141,20 @@ func (r MLValidateRequest) Do(ctx context.Context, transport Transport) (*Respon req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.validate") + if reader := instrument.RecordRequestBody(ctx, "ml.validate", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.validate") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.validate_detector.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.validate_detector.go index 385cfd44d..782084955 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.validate_detector.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ml.validate_detector.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMLValidateDetectorFunc(t Transport) MLValidateDetector { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type MLValidateDetectorRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MLValidateDetectorRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MLValidateDetectorRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.validate_detector") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_ml/anomaly_detectors/_validate/detector")) @@ -91,6 +107,9 @@ func (r MLValidateDetectorRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +141,20 @@ func (r MLValidateDetectorRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ml.validate_detector") + if reader := instrument.RecordRequestBody(ctx, "ml.validate_detector", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.validate_detector") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.monitoring.bulk.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.monitoring.bulk.go index b5865d6c7..3390ecf91 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.monitoring.bulk.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.monitoring.bulk.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newMonitoringBulkFunc(t Transport) MonitoringBulk { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -61,16 +66,27 @@ type MonitoringBulkRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r MonitoringBulkRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r MonitoringBulkRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "monitoring.bulk") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_monitoring") + 1 + len(r.DocumentType) + 1 + len("bulk")) @@ -80,6 +96,9 @@ func (r MonitoringBulkRequest) Do(ctx context.Context, transport Transport) (*Re if r.DocumentType != "" { path.WriteString("/") path.WriteString(r.DocumentType) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "type", r.DocumentType) + } } path.WriteString("/") path.WriteString("bulk") @@ -116,6 +135,9 @@ func (r MonitoringBulkRequest) Do(ctx context.Context, transport Transport) (*Re req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -147,8 +169,20 @@ func (r MonitoringBulkRequest) Do(ctx context.Context, transport Transport) (*Re req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "monitoring.bulk") + if reader := instrument.RecordRequestBody(ctx, "monitoring.bulk", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "monitoring.bulk") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.open_point_in_time.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.open_point_in_time.go index 6a1f89ee8..9913771cf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.open_point_in_time.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.open_point_in_time.go @@ -15,13 +15,14 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi import ( "context" "errors" + "io" "net/http" "strconv" "strings" @@ -33,6 +34,11 @@ func newOpenPointInTimeFunc(t Transport) OpenPointInTime { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -48,6 +54,8 @@ type OpenPointInTime func(index []string, keep_alive string, o ...func(*OpenPoin type OpenPointInTimeRequest struct { Index []string + Body io.Reader + ExpandWildcards string IgnoreUnavailable *bool KeepAlive string @@ -62,16 +70,27 @@ type OpenPointInTimeRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r OpenPointInTimeRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r OpenPointInTimeRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "open_point_in_time") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" if len(r.Index) == 0 { @@ -82,6 +101,9 @@ func (r OpenPointInTimeRequest) Do(ctx context.Context, transport Transport) (*R path.WriteString("http://") path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } path.WriteString("/") path.WriteString("_pit") @@ -123,8 +145,11 @@ func (r OpenPointInTimeRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, err := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -148,12 +173,28 @@ func (r OpenPointInTimeRequest) Do(ctx context.Context, transport Transport) (*R } } + if r.Body != nil && req.Header.Get(headerContentType) == "" { + req.Header[headerContentType] = headerContentTypeJSON + } + if ctx != nil { req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "open_point_in_time") + if reader := instrument.RecordRequestBody(ctx, "open_point_in_time", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "open_point_in_time") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -173,6 +214,13 @@ func (f OpenPointInTime) WithContext(v context.Context) func(*OpenPointInTimeReq } } +// WithBody - An index_filter specified with the Query DSL. +func (f OpenPointInTime) WithBody(v io.Reader) func(*OpenPointInTimeRequest) { + return func(r *OpenPointInTimeRequest) { + r.Body = v + } +} + // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. func (f OpenPointInTime) WithExpandWildcards(v string) func(*OpenPointInTimeRequest) { return func(r *OpenPointInTimeRequest) { diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.rollup.delete_job.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.rollup.delete_job.go index 9b3873edc..c265ac9a0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.rollup.delete_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.rollup.delete_job.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newRollupDeleteJobFunc(t Transport) RollupDeleteJob { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -56,16 +61,27 @@ type RollupDeleteJobRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r RollupDeleteJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r RollupDeleteJobRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "rollup.delete_job") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_rollup") + 1 + len("job") + 1 + len(r.JobID)) @@ -76,6 +92,9 @@ func (r RollupDeleteJobRequest) Do(ctx context.Context, transport Transport) (*R path.WriteString("job") path.WriteString("/") path.WriteString(r.JobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.JobID) + } params = make(map[string]string) @@ -97,6 +116,9 @@ func (r RollupDeleteJobRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -124,8 +146,17 @@ func (r RollupDeleteJobRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "rollup.delete_job") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "rollup.delete_job") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.rollup.get_jobs.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.rollup.get_jobs.go index f9ae24a6c..46baf8177 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.rollup.get_jobs.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.rollup.get_jobs.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newRollupGetJobsFunc(t Transport) RollupGetJobs { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -56,16 +61,27 @@ type RollupGetJobsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r RollupGetJobsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r RollupGetJobsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "rollup.get_jobs") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_rollup") + 1 + len("job") + 1 + len(r.JobID)) @@ -77,6 +93,9 @@ func (r RollupGetJobsRequest) Do(ctx context.Context, transport Transport) (*Res if r.JobID != "" { path.WriteString("/") path.WriteString(r.JobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.JobID) + } } params = make(map[string]string) @@ -99,6 +118,9 @@ func (r RollupGetJobsRequest) Do(ctx context.Context, transport Transport) (*Res req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -126,8 +148,17 @@ func (r RollupGetJobsRequest) Do(ctx context.Context, transport Transport) (*Res req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "rollup.get_jobs") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "rollup.get_jobs") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.rollup.get_rollup_caps.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.rollup.get_rollup_caps.go index 007da8648..5e3a01263 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.rollup.get_rollup_caps.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.rollup.get_rollup_caps.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newRollupGetRollupCapsFunc(t Transport) RollupGetRollupCaps { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -56,16 +61,27 @@ type RollupGetRollupCapsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r RollupGetRollupCapsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r RollupGetRollupCapsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "rollup.get_rollup_caps") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_rollup") + 1 + len("data") + 1 + len(r.Index)) @@ -77,6 +93,9 @@ func (r RollupGetRollupCapsRequest) Do(ctx context.Context, transport Transport) if r.Index != "" { path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.Index) + } } params = make(map[string]string) @@ -99,6 +118,9 @@ func (r RollupGetRollupCapsRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -126,8 +148,17 @@ func (r RollupGetRollupCapsRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "rollup.get_rollup_caps") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "rollup.get_rollup_caps") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.rollup.get_rollup_index_caps.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.rollup.get_rollup_index_caps.go index 0eecbd8ef..a0d7dd12e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.rollup.get_rollup_index_caps.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.rollup.get_rollup_index_caps.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newRollupGetRollupIndexCapsFunc(t Transport) RollupGetRollupIndexCaps { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -56,22 +61,36 @@ type RollupGetRollupIndexCapsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r RollupGetRollupIndexCapsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r RollupGetRollupIndexCapsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "rollup.get_rollup_index_caps") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len(r.Index) + 1 + len("_rollup") + 1 + len("data")) path.WriteString("http://") path.WriteString("/") path.WriteString(r.Index) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.Index) + } path.WriteString("/") path.WriteString("_rollup") path.WriteString("/") @@ -97,6 +116,9 @@ func (r RollupGetRollupIndexCapsRequest) Do(ctx context.Context, transport Trans req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -124,8 +146,17 @@ func (r RollupGetRollupIndexCapsRequest) Do(ctx context.Context, transport Trans req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "rollup.get_rollup_index_caps") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "rollup.get_rollup_index_caps") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.rollup.put_job.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.rollup.put_job.go index 44e530731..c1e7a2e25 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.rollup.put_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.rollup.put_job.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newRollupPutJobFunc(t Transport) RollupPutJob { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -59,16 +64,27 @@ type RollupPutJobRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r RollupPutJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r RollupPutJobRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "rollup.put_job") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_rollup") + 1 + len("job") + 1 + len(r.JobID)) @@ -79,6 +95,9 @@ func (r RollupPutJobRequest) Do(ctx context.Context, transport Transport) (*Resp path.WriteString("job") path.WriteString("/") path.WriteString(r.JobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.JobID) + } params = make(map[string]string) @@ -100,6 +119,9 @@ func (r RollupPutJobRequest) Do(ctx context.Context, transport Transport) (*Resp req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -131,8 +153,20 @@ func (r RollupPutJobRequest) Do(ctx context.Context, transport Transport) (*Resp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "rollup.put_job") + if reader := instrument.RecordRequestBody(ctx, "rollup.put_job", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "rollup.put_job") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.rollup.rollup_search.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.rollup.rollup_search.go index 846606720..6f2e8fec8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.rollup.rollup_search.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.rollup.rollup_search.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newRollupRollupSearchFunc(t Transport) RollupRollupSearch { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -64,16 +69,27 @@ type RollupRollupSearchRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r RollupRollupSearchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r RollupRollupSearchRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "rollup.rollup_search") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" if len(r.Index) == 0 { @@ -84,6 +100,9 @@ func (r RollupRollupSearchRequest) Do(ctx context.Context, transport Transport) path.WriteString("http://") path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } path.WriteString("/") path.WriteString("_rollup_search") @@ -115,6 +134,9 @@ func (r RollupRollupSearchRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -146,8 +168,20 @@ func (r RollupRollupSearchRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "rollup.rollup_search") + if reader := instrument.RecordRequestBody(ctx, "rollup.rollup_search", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "rollup.rollup_search") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.rollup.start_job.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.rollup.start_job.go index b259b4b7b..dadb87811 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.rollup.start_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.rollup.start_job.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newRollupStartJobFunc(t Transport) RollupStartJob { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -56,16 +61,27 @@ type RollupStartJobRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r RollupStartJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r RollupStartJobRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "rollup.start_job") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_rollup") + 1 + len("job") + 1 + len(r.JobID) + 1 + len("_start")) @@ -76,6 +92,9 @@ func (r RollupStartJobRequest) Do(ctx context.Context, transport Transport) (*Re path.WriteString("job") path.WriteString("/") path.WriteString(r.JobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.JobID) + } path.WriteString("/") path.WriteString("_start") @@ -99,6 +118,9 @@ func (r RollupStartJobRequest) Do(ctx context.Context, transport Transport) (*Re req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -126,8 +148,17 @@ func (r RollupStartJobRequest) Do(ctx context.Context, transport Transport) (*Re req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "rollup.start_job") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "rollup.start_job") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.rollup.stop_job.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.rollup.stop_job.go index b21421a80..2a06233cd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.rollup.stop_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.rollup.stop_job.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newRollupStopJobFunc(t Transport) RollupStopJob { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -61,16 +66,27 @@ type RollupStopJobRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r RollupStopJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r RollupStopJobRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "rollup.stop_job") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_rollup") + 1 + len("job") + 1 + len(r.JobID) + 1 + len("_stop")) @@ -81,6 +97,9 @@ func (r RollupStopJobRequest) Do(ctx context.Context, transport Transport) (*Res path.WriteString("job") path.WriteString("/") path.WriteString(r.JobID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.JobID) + } path.WriteString("/") path.WriteString("_stop") @@ -112,6 +131,9 @@ func (r RollupStopJobRequest) Do(ctx context.Context, transport Transport) (*Res req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -139,8 +161,17 @@ func (r RollupStopJobRequest) Do(ctx context.Context, transport Transport) (*Res req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "rollup.stop_job") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "rollup.stop_job") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.searchable_snapshots.cache_stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.searchable_snapshots.cache_stats.go index 67181cc6d..1660a2a05 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.searchable_snapshots.cache_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.searchable_snapshots.cache_stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSearchableSnapshotsCacheStatsFunc(t Transport) SearchableSnapshotsCacheS for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -56,16 +61,27 @@ type SearchableSnapshotsCacheStatsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SearchableSnapshotsCacheStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SearchableSnapshotsCacheStatsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "searchable_snapshots.cache_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_searchable_snapshots") + 1 + len(strings.Join(r.NodeID, ",")) + 1 + len("cache") + 1 + len("stats")) @@ -75,6 +91,9 @@ func (r SearchableSnapshotsCacheStatsRequest) Do(ctx context.Context, transport if len(r.NodeID) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.NodeID, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "node_id", strings.Join(r.NodeID, ",")) + } } path.WriteString("/") path.WriteString("cache") @@ -101,6 +120,9 @@ func (r SearchableSnapshotsCacheStatsRequest) Do(ctx context.Context, transport req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -128,8 +150,17 @@ func (r SearchableSnapshotsCacheStatsRequest) Do(ctx context.Context, transport req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "searchable_snapshots.cache_stats") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "searchable_snapshots.cache_stats") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.searchable_snapshots.clear_cache.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.searchable_snapshots.clear_cache.go index e29f55242..064472552 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.searchable_snapshots.clear_cache.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.searchable_snapshots.clear_cache.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSearchableSnapshotsClearCacheFunc(t Transport) SearchableSnapshotsClearC for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -61,16 +66,27 @@ type SearchableSnapshotsClearCacheRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SearchableSnapshotsClearCacheRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SearchableSnapshotsClearCacheRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "searchable_snapshots.clear_cache") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len(strings.Join(r.Index, ",")) + 1 + len("_searchable_snapshots") + 1 + len("cache") + 1 + len("clear")) @@ -78,6 +94,9 @@ func (r SearchableSnapshotsClearCacheRequest) Do(ctx context.Context, transport if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } } path.WriteString("/") path.WriteString("_searchable_snapshots") @@ -122,6 +141,9 @@ func (r SearchableSnapshotsClearCacheRequest) Do(ctx context.Context, transport req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -149,8 +171,17 @@ func (r SearchableSnapshotsClearCacheRequest) Do(ctx context.Context, transport req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "searchable_snapshots.clear_cache") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "searchable_snapshots.clear_cache") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.searchable_snapshots.mount.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.searchable_snapshots.mount.go index 6d479566b..28cff3e76 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.searchable_snapshots.mount.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.searchable_snapshots.mount.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newSearchableSnapshotsMountFunc(t Transport) SearchableSnapshotsMount { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -64,16 +69,27 @@ type SearchableSnapshotsMountRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SearchableSnapshotsMountRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SearchableSnapshotsMountRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "searchable_snapshots.mount") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_snapshot") + 1 + len(r.Repository) + 1 + len(r.Snapshot) + 1 + len("_mount")) @@ -82,8 +98,14 @@ func (r SearchableSnapshotsMountRequest) Do(ctx context.Context, transport Trans path.WriteString("_snapshot") path.WriteString("/") path.WriteString(r.Repository) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "repository", r.Repository) + } path.WriteString("/") path.WriteString(r.Snapshot) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "snapshot", r.Snapshot) + } path.WriteString("/") path.WriteString("_mount") @@ -119,6 +141,9 @@ func (r SearchableSnapshotsMountRequest) Do(ctx context.Context, transport Trans req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -150,8 +175,20 @@ func (r SearchableSnapshotsMountRequest) Do(ctx context.Context, transport Trans req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "searchable_snapshots.mount") + if reader := instrument.RecordRequestBody(ctx, "searchable_snapshots.mount", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "searchable_snapshots.mount") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.searchable_snapshots.stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.searchable_snapshots.stats.go index 4932f04df..944154ea0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.searchable_snapshots.stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.searchable_snapshots.stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSearchableSnapshotsStatsFunc(t Transport) SearchableSnapshotsStats { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -56,16 +61,27 @@ type SearchableSnapshotsStatsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SearchableSnapshotsStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SearchableSnapshotsStatsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "searchable_snapshots.stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len(strings.Join(r.Index, ",")) + 1 + len("_searchable_snapshots") + 1 + len("stats")) @@ -73,6 +89,9 @@ func (r SearchableSnapshotsStatsRequest) Do(ctx context.Context, transport Trans if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", strings.Join(r.Index, ",")) + } } path.WriteString("/") path.WriteString("_searchable_snapshots") @@ -103,6 +122,9 @@ func (r SearchableSnapshotsStatsRequest) Do(ctx context.Context, transport Trans req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -130,8 +152,17 @@ func (r SearchableSnapshotsStatsRequest) Do(ctx context.Context, transport Trans req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "searchable_snapshots.stats") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "searchable_snapshots.stats") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.activate_user_profile.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.activate_user_profile.go index d28656f0e..b4879481e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.activate_user_profile.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.activate_user_profile.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecurityActivateUserProfileFunc(t Transport) SecurityActivateUserProfile for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type SecurityActivateUserProfileRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityActivateUserProfileRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityActivateUserProfileRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.activate_user_profile") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_security/profile/_activate")) @@ -91,6 +107,9 @@ func (r SecurityActivateUserProfileRequest) Do(ctx context.Context, transport Tr req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +141,20 @@ func (r SecurityActivateUserProfileRequest) Do(ctx context.Context, transport Tr req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.activate_user_profile") + if reader := instrument.RecordRequestBody(ctx, "security.activate_user_profile", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.activate_user_profile") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.authenticate.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.authenticate.go index c5291d623..97cf419a0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.authenticate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.authenticate.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSecurityAuthenticateFunc(t Transport) SecurityAuthenticate { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type SecurityAuthenticateRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityAuthenticateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityAuthenticateRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.authenticate") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_security/_authenticate")) @@ -88,6 +104,9 @@ func (r SecurityAuthenticateRequest) Do(ctx context.Context, transport Transport req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r SecurityAuthenticateRequest) Do(ctx context.Context, transport Transport req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.authenticate") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.authenticate") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.bulk_update_api_keys.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.bulk_update_api_keys.go index f4b7053cf..ed03b9bbd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.bulk_update_api_keys.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.bulk_update_api_keys.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecurityBulkUpdateAPIKeysFunc(t Transport) SecurityBulkUpdateAPIKeys { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type SecurityBulkUpdateAPIKeysRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityBulkUpdateAPIKeysRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityBulkUpdateAPIKeysRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.bulk_update_api_keys") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_security/api_key/_bulk_update")) @@ -91,6 +107,9 @@ func (r SecurityBulkUpdateAPIKeysRequest) Do(ctx context.Context, transport Tran req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +141,20 @@ func (r SecurityBulkUpdateAPIKeysRequest) Do(ctx context.Context, transport Tran req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.bulk_update_api_keys") + if reader := instrument.RecordRequestBody(ctx, "security.bulk_update_api_keys", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.bulk_update_api_keys") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.change_password.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.change_password.go index e628edb48..827acda02 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.change_password.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.change_password.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecurityChangePasswordFunc(t Transport) SecurityChangePassword { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -59,16 +64,27 @@ type SecurityChangePasswordRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityChangePasswordRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityChangePasswordRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.change_password") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_security") + 1 + len("user") + 1 + len(r.Username) + 1 + len("_password")) @@ -80,6 +96,9 @@ func (r SecurityChangePasswordRequest) Do(ctx context.Context, transport Transpo if r.Username != "" { path.WriteString("/") path.WriteString(r.Username) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "username", r.Username) + } } path.WriteString("/") path.WriteString("_password") @@ -108,6 +127,9 @@ func (r SecurityChangePasswordRequest) Do(ctx context.Context, transport Transpo req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -139,8 +161,20 @@ func (r SecurityChangePasswordRequest) Do(ctx context.Context, transport Transpo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.change_password") + if reader := instrument.RecordRequestBody(ctx, "security.change_password", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.change_password") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.clear_api_key_cache.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.clear_api_key_cache.go index c27329233..e67dd9c5e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.clear_api_key_cache.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.clear_api_key_cache.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecurityClearAPIKeyCacheFunc(t Transport) SecurityClearAPIKeyCache { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type SecurityClearAPIKeyCacheRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityClearAPIKeyCacheRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityClearAPIKeyCacheRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.clear_api_key_cache") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" if len(r.Ids) == 0 { @@ -79,6 +95,9 @@ func (r SecurityClearAPIKeyCacheRequest) Do(ctx context.Context, transport Trans path.WriteString("api_key") path.WriteString("/") path.WriteString(strings.Join(r.Ids, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "ids", strings.Join(r.Ids, ",")) + } path.WriteString("/") path.WriteString("_clear_cache") @@ -102,6 +121,9 @@ func (r SecurityClearAPIKeyCacheRequest) Do(ctx context.Context, transport Trans req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -129,8 +151,17 @@ func (r SecurityClearAPIKeyCacheRequest) Do(ctx context.Context, transport Trans req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.clear_api_key_cache") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.clear_api_key_cache") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.clear_cached_privileges.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.clear_cached_privileges.go index b8d34a86a..0f86ff349 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.clear_cached_privileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.clear_cached_privileges.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecurityClearCachedPrivilegesFunc(t Transport) SecurityClearCachedPrivil for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type SecurityClearCachedPrivilegesRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityClearCachedPrivilegesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityClearCachedPrivilegesRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.clear_cached_privileges") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" if len(r.Application) == 0 { @@ -79,6 +95,9 @@ func (r SecurityClearCachedPrivilegesRequest) Do(ctx context.Context, transport path.WriteString("privilege") path.WriteString("/") path.WriteString(strings.Join(r.Application, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "application", strings.Join(r.Application, ",")) + } path.WriteString("/") path.WriteString("_clear_cache") @@ -102,6 +121,9 @@ func (r SecurityClearCachedPrivilegesRequest) Do(ctx context.Context, transport req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -129,8 +151,17 @@ func (r SecurityClearCachedPrivilegesRequest) Do(ctx context.Context, transport req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.clear_cached_privileges") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.clear_cached_privileges") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.clear_cached_realms.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.clear_cached_realms.go index ee665a0f5..a92a29606 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.clear_cached_realms.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.clear_cached_realms.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecurityClearCachedRealmsFunc(t Transport) SecurityClearCachedRealms { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type SecurityClearCachedRealmsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityClearCachedRealmsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityClearCachedRealmsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.clear_cached_realms") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" if len(r.Realms) == 0 { @@ -81,6 +97,9 @@ func (r SecurityClearCachedRealmsRequest) Do(ctx context.Context, transport Tran path.WriteString("realm") path.WriteString("/") path.WriteString(strings.Join(r.Realms, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "realms", strings.Join(r.Realms, ",")) + } path.WriteString("/") path.WriteString("_clear_cache") @@ -108,6 +127,9 @@ func (r SecurityClearCachedRealmsRequest) Do(ctx context.Context, transport Tran req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -135,8 +157,17 @@ func (r SecurityClearCachedRealmsRequest) Do(ctx context.Context, transport Tran req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.clear_cached_realms") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.clear_cached_realms") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.clear_cached_roles.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.clear_cached_roles.go index bef38b65a..4c236fdb8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.clear_cached_roles.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.clear_cached_roles.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecurityClearCachedRolesFunc(t Transport) SecurityClearCachedRoles { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type SecurityClearCachedRolesRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityClearCachedRolesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityClearCachedRolesRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.clear_cached_roles") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" if len(r.Name) == 0 { @@ -79,6 +95,9 @@ func (r SecurityClearCachedRolesRequest) Do(ctx context.Context, transport Trans path.WriteString("role") path.WriteString("/") path.WriteString(strings.Join(r.Name, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", strings.Join(r.Name, ",")) + } path.WriteString("/") path.WriteString("_clear_cache") @@ -102,6 +121,9 @@ func (r SecurityClearCachedRolesRequest) Do(ctx context.Context, transport Trans req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -129,8 +151,17 @@ func (r SecurityClearCachedRolesRequest) Do(ctx context.Context, transport Trans req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.clear_cached_roles") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.clear_cached_roles") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.clear_cached_service_tokens.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.clear_cached_service_tokens.go index 49cca223b..e32a0c1cd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.clear_cached_service_tokens.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.clear_cached_service_tokens.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecurityClearCachedServiceTokensFunc(t Transport) SecurityClearCachedSer for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type SecurityClearCachedServiceTokensRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityClearCachedServiceTokensRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityClearCachedServiceTokensRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.clear_cached_service_tokens") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" if len(r.Name) == 0 { @@ -81,14 +97,23 @@ func (r SecurityClearCachedServiceTokensRequest) Do(ctx context.Context, transpo path.WriteString("service") path.WriteString("/") path.WriteString(r.Namespace) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "namespace", r.Namespace) + } path.WriteString("/") path.WriteString(r.Service) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "service", r.Service) + } path.WriteString("/") path.WriteString("credential") path.WriteString("/") path.WriteString("token") path.WriteString("/") path.WriteString(strings.Join(r.Name, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", strings.Join(r.Name, ",")) + } path.WriteString("/") path.WriteString("_clear_cache") @@ -112,6 +137,9 @@ func (r SecurityClearCachedServiceTokensRequest) Do(ctx context.Context, transpo req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -139,8 +167,17 @@ func (r SecurityClearCachedServiceTokensRequest) Do(ctx context.Context, transpo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.clear_cached_service_tokens") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.clear_cached_service_tokens") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.create_api_key.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.create_api_key.go index f8226aac9..5d3b98be0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.create_api_key.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.create_api_key.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecurityCreateAPIKeyFunc(t Transport) SecurityCreateAPIKey { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type SecurityCreateAPIKeyRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityCreateAPIKeyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityCreateAPIKeyRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.create_api_key") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + len("/_security/api_key")) @@ -97,6 +113,9 @@ func (r SecurityCreateAPIKeyRequest) Do(ctx context.Context, transport Transport req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -128,8 +147,20 @@ func (r SecurityCreateAPIKeyRequest) Do(ctx context.Context, transport Transport req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.create_api_key") + if reader := instrument.RecordRequestBody(ctx, "security.create_api_key", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.create_api_key") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.create_cross_cluster_api_key.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.create_cross_cluster_api_key.go index 69a587a64..35cdb9e46 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.create_cross_cluster_api_key.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.create_cross_cluster_api_key.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecurityCreateCrossClusterAPIKeyFunc(t Transport) SecurityCreateCrossClu for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type SecurityCreateCrossClusterAPIKeyRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityCreateCrossClusterAPIKeyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityCreateCrossClusterAPIKeyRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.create_cross_cluster_api_key") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_security/cross_cluster/api_key")) @@ -93,6 +109,9 @@ func (r SecurityCreateCrossClusterAPIKeyRequest) Do(ctx context.Context, transpo req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -124,8 +143,20 @@ func (r SecurityCreateCrossClusterAPIKeyRequest) Do(ctx context.Context, transpo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.create_cross_cluster_api_key") + if reader := instrument.RecordRequestBody(ctx, "security.create_cross_cluster_api_key", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.create_cross_cluster_api_key") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.create_service_token.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.create_service_token.go index dccc0b8aa..5f5c87692 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.create_service_token.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.create_service_token.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSecurityCreateServiceTokenFunc(t Transport) SecurityCreateServiceToken { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -58,16 +63,27 @@ type SecurityCreateServiceTokenRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityCreateServiceTokenRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityCreateServiceTokenRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.create_service_token") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_security") + 1 + len("service") + 1 + len(r.Namespace) + 1 + len(r.Service) + 1 + len("credential") + 1 + len("token") + 1 + len(r.Name)) @@ -78,8 +94,14 @@ func (r SecurityCreateServiceTokenRequest) Do(ctx context.Context, transport Tra path.WriteString("service") path.WriteString("/") path.WriteString(r.Namespace) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "namespace", r.Namespace) + } path.WriteString("/") path.WriteString(r.Service) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "service", r.Service) + } path.WriteString("/") path.WriteString("credential") path.WriteString("/") @@ -87,6 +109,9 @@ func (r SecurityCreateServiceTokenRequest) Do(ctx context.Context, transport Tra if r.Name != "" { path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } } params = make(map[string]string) @@ -113,6 +138,9 @@ func (r SecurityCreateServiceTokenRequest) Do(ctx context.Context, transport Tra req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -140,8 +168,17 @@ func (r SecurityCreateServiceTokenRequest) Do(ctx context.Context, transport Tra req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.create_service_token") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.create_service_token") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.delete_privileges.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.delete_privileges.go index e0b26b2b3..a79452a12 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.delete_privileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.delete_privileges.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSecurityDeletePrivilegesFunc(t Transport) SecurityDeletePrivileges { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type SecurityDeletePrivilegesRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityDeletePrivilegesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityDeletePrivilegesRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.delete_privileges") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_security") + 1 + len("privilege") + 1 + len(r.Application) + 1 + len(r.Name)) @@ -77,8 +93,14 @@ func (r SecurityDeletePrivilegesRequest) Do(ctx context.Context, transport Trans path.WriteString("privilege") path.WriteString("/") path.WriteString(r.Application) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "application", r.Application) + } path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } params = make(map[string]string) @@ -104,6 +126,9 @@ func (r SecurityDeletePrivilegesRequest) Do(ctx context.Context, transport Trans req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -131,8 +156,17 @@ func (r SecurityDeletePrivilegesRequest) Do(ctx context.Context, transport Trans req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.delete_privileges") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.delete_privileges") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.delete_role.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.delete_role.go index 5438981ec..d91251d0f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.delete_role.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.delete_role.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSecurityDeleteRoleFunc(t Transport) SecurityDeleteRole { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -56,16 +61,27 @@ type SecurityDeleteRoleRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityDeleteRoleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityDeleteRoleRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.delete_role") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_security") + 1 + len("role") + 1 + len(r.Name)) @@ -76,6 +92,9 @@ func (r SecurityDeleteRoleRequest) Do(ctx context.Context, transport Transport) path.WriteString("role") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } params = make(map[string]string) @@ -101,6 +120,9 @@ func (r SecurityDeleteRoleRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -128,8 +150,17 @@ func (r SecurityDeleteRoleRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.delete_role") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.delete_role") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.delete_role_mapping.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.delete_role_mapping.go index 324a3bdd8..1c34caea0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.delete_role_mapping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.delete_role_mapping.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSecurityDeleteRoleMappingFunc(t Transport) SecurityDeleteRoleMapping { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -56,16 +61,27 @@ type SecurityDeleteRoleMappingRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityDeleteRoleMappingRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityDeleteRoleMappingRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.delete_role_mapping") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_security") + 1 + len("role_mapping") + 1 + len(r.Name)) @@ -76,6 +92,9 @@ func (r SecurityDeleteRoleMappingRequest) Do(ctx context.Context, transport Tran path.WriteString("role_mapping") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } params = make(map[string]string) @@ -101,6 +120,9 @@ func (r SecurityDeleteRoleMappingRequest) Do(ctx context.Context, transport Tran req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -128,8 +150,17 @@ func (r SecurityDeleteRoleMappingRequest) Do(ctx context.Context, transport Tran req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.delete_role_mapping") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.delete_role_mapping") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.delete_service_token.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.delete_service_token.go index fe0c3baf5..33ce1bc65 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.delete_service_token.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.delete_service_token.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSecurityDeleteServiceTokenFunc(t Transport) SecurityDeleteServiceToken { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -58,16 +63,27 @@ type SecurityDeleteServiceTokenRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityDeleteServiceTokenRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityDeleteServiceTokenRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.delete_service_token") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_security") + 1 + len("service") + 1 + len(r.Namespace) + 1 + len(r.Service) + 1 + len("credential") + 1 + len("token") + 1 + len(r.Name)) @@ -78,14 +94,23 @@ func (r SecurityDeleteServiceTokenRequest) Do(ctx context.Context, transport Tra path.WriteString("service") path.WriteString("/") path.WriteString(r.Namespace) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "namespace", r.Namespace) + } path.WriteString("/") path.WriteString(r.Service) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "service", r.Service) + } path.WriteString("/") path.WriteString("credential") path.WriteString("/") path.WriteString("token") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } params = make(map[string]string) @@ -111,6 +136,9 @@ func (r SecurityDeleteServiceTokenRequest) Do(ctx context.Context, transport Tra req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -138,8 +166,17 @@ func (r SecurityDeleteServiceTokenRequest) Do(ctx context.Context, transport Tra req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.delete_service_token") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.delete_service_token") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.delete_user.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.delete_user.go index 7ada7230b..02ebbdf8d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.delete_user.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.delete_user.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSecurityDeleteUserFunc(t Transport) SecurityDeleteUser { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -56,16 +61,27 @@ type SecurityDeleteUserRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityDeleteUserRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityDeleteUserRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.delete_user") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_security") + 1 + len("user") + 1 + len(r.Username)) @@ -76,6 +92,9 @@ func (r SecurityDeleteUserRequest) Do(ctx context.Context, transport Transport) path.WriteString("user") path.WriteString("/") path.WriteString(r.Username) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "username", r.Username) + } params = make(map[string]string) @@ -101,6 +120,9 @@ func (r SecurityDeleteUserRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -128,8 +150,17 @@ func (r SecurityDeleteUserRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.delete_user") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.delete_user") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.disable_user.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.disable_user.go index 8989aef02..43de78f59 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.disable_user.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.disable_user.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSecurityDisableUserFunc(t Transport) SecurityDisableUser { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -56,16 +61,27 @@ type SecurityDisableUserRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityDisableUserRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityDisableUserRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.disable_user") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_security") + 1 + len("user") + 1 + len(r.Username) + 1 + len("_disable")) @@ -76,6 +92,9 @@ func (r SecurityDisableUserRequest) Do(ctx context.Context, transport Transport) path.WriteString("user") path.WriteString("/") path.WriteString(r.Username) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "username", r.Username) + } path.WriteString("/") path.WriteString("_disable") @@ -103,6 +122,9 @@ func (r SecurityDisableUserRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -130,8 +152,17 @@ func (r SecurityDisableUserRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.disable_user") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.disable_user") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.disable_user_profile.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.disable_user_profile.go index 4fd124acc..00964416f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.disable_user_profile.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.disable_user_profile.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSecurityDisableUserProfileFunc(t Transport) SecurityDisableUserProfile { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -56,16 +61,27 @@ type SecurityDisableUserProfileRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityDisableUserProfileRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityDisableUserProfileRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.disable_user_profile") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_security") + 1 + len("profile") + 1 + len(r.UID) + 1 + len("_disable")) @@ -76,6 +92,9 @@ func (r SecurityDisableUserProfileRequest) Do(ctx context.Context, transport Tra path.WriteString("profile") path.WriteString("/") path.WriteString(r.UID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "uid", r.UID) + } path.WriteString("/") path.WriteString("_disable") @@ -103,6 +122,9 @@ func (r SecurityDisableUserProfileRequest) Do(ctx context.Context, transport Tra req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -130,8 +152,17 @@ func (r SecurityDisableUserProfileRequest) Do(ctx context.Context, transport Tra req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.disable_user_profile") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.disable_user_profile") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.enable_user.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.enable_user.go index f642caa1e..a6dd2c79a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.enable_user.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.enable_user.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSecurityEnableUserFunc(t Transport) SecurityEnableUser { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -56,16 +61,27 @@ type SecurityEnableUserRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityEnableUserRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityEnableUserRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.enable_user") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_security") + 1 + len("user") + 1 + len(r.Username) + 1 + len("_enable")) @@ -76,6 +92,9 @@ func (r SecurityEnableUserRequest) Do(ctx context.Context, transport Transport) path.WriteString("user") path.WriteString("/") path.WriteString(r.Username) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "username", r.Username) + } path.WriteString("/") path.WriteString("_enable") @@ -103,6 +122,9 @@ func (r SecurityEnableUserRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -130,8 +152,17 @@ func (r SecurityEnableUserRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.enable_user") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.enable_user") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.enable_user_profile.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.enable_user_profile.go index 31933071c..e7ec866aa 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.enable_user_profile.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.enable_user_profile.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSecurityEnableUserProfileFunc(t Transport) SecurityEnableUserProfile { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -56,16 +61,27 @@ type SecurityEnableUserProfileRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityEnableUserProfileRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityEnableUserProfileRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.enable_user_profile") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_security") + 1 + len("profile") + 1 + len(r.UID) + 1 + len("_enable")) @@ -76,6 +92,9 @@ func (r SecurityEnableUserProfileRequest) Do(ctx context.Context, transport Tran path.WriteString("profile") path.WriteString("/") path.WriteString(r.UID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "uid", r.UID) + } path.WriteString("/") path.WriteString("_enable") @@ -103,6 +122,9 @@ func (r SecurityEnableUserProfileRequest) Do(ctx context.Context, transport Tran req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -130,8 +152,17 @@ func (r SecurityEnableUserProfileRequest) Do(ctx context.Context, transport Tran req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.enable_user_profile") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.enable_user_profile") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.enroll_kibana.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.enroll_kibana.go index 3995e0ef2..136aac376 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.enroll_kibana.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.enroll_kibana.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSecurityEnrollKibanaFunc(t Transport) SecurityEnrollKibana { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type SecurityEnrollKibanaRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityEnrollKibanaRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityEnrollKibanaRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.enroll_kibana") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_security/enroll/kibana")) @@ -88,6 +104,9 @@ func (r SecurityEnrollKibanaRequest) Do(ctx context.Context, transport Transport req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r SecurityEnrollKibanaRequest) Do(ctx context.Context, transport Transport req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.enroll_kibana") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.enroll_kibana") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.enroll_node.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.enroll_node.go index 2e7345928..baae57aa0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.enroll_node.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.enroll_node.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSecurityEnrollNodeFunc(t Transport) SecurityEnrollNode { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type SecurityEnrollNodeRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityEnrollNodeRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityEnrollNodeRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.enroll_node") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_security/enroll/node")) @@ -88,6 +104,9 @@ func (r SecurityEnrollNodeRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r SecurityEnrollNodeRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.enroll_node") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.enroll_node") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_api_key.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_api_key.go index afd93807a..4822619e6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_api_key.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_api_key.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecurityGetAPIKeyFunc(t Transport) SecurityGetAPIKey { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -45,6 +50,7 @@ type SecurityGetAPIKey func(o ...func(*SecurityGetAPIKeyRequest)) (*Response, er // SecurityGetAPIKeyRequest configures the Security GetAPI Key API request. type SecurityGetAPIKeyRequest struct { + ActiveOnly *bool ID string Name string Owner *bool @@ -60,16 +66,27 @@ type SecurityGetAPIKeyRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityGetAPIKeyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityGetAPIKeyRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_api_key") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_security/api_key")) @@ -78,6 +95,10 @@ func (r SecurityGetAPIKeyRequest) Do(ctx context.Context, transport Transport) ( params = make(map[string]string) + if r.ActiveOnly != nil { + params["active_only"] = strconv.FormatBool(*r.ActiveOnly) + } + if r.ID != "" { params["id"] = r.ID } @@ -120,6 +141,9 @@ func (r SecurityGetAPIKeyRequest) Do(ctx context.Context, transport Transport) ( req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -147,8 +171,17 @@ func (r SecurityGetAPIKeyRequest) Do(ctx context.Context, transport Transport) ( req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.get_api_key") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.get_api_key") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -168,6 +201,13 @@ func (f SecurityGetAPIKey) WithContext(v context.Context) func(*SecurityGetAPIKe } } +// WithActiveOnly - flag to limit response to only active (not invalidated or expired) api keys. +func (f SecurityGetAPIKey) WithActiveOnly(v bool) func(*SecurityGetAPIKeyRequest) { + return func(r *SecurityGetAPIKeyRequest) { + r.ActiveOnly = &v + } +} + // WithID - api key ID of the api key to be retrieved. func (f SecurityGetAPIKey) WithID(v string) func(*SecurityGetAPIKeyRequest) { return func(r *SecurityGetAPIKeyRequest) { diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_builtin_privileges.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_builtin_privileges.go index 5b03cbea6..e50c0094b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_builtin_privileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_builtin_privileges.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSecurityGetBuiltinPrivilegesFunc(t Transport) SecurityGetBuiltinPrivileg for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type SecurityGetBuiltinPrivilegesRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityGetBuiltinPrivilegesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityGetBuiltinPrivilegesRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_builtin_privileges") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_security/privilege/_builtin")) @@ -88,6 +104,9 @@ func (r SecurityGetBuiltinPrivilegesRequest) Do(ctx context.Context, transport T req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r SecurityGetBuiltinPrivilegesRequest) Do(ctx context.Context, transport T req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.get_builtin_privileges") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.get_builtin_privileges") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_privileges.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_privileges.go index 5e3d78963..fe963f03a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_privileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_privileges.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSecurityGetPrivilegesFunc(t Transport) SecurityGetPrivileges { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type SecurityGetPrivilegesRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityGetPrivilegesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityGetPrivilegesRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_privileges") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_security") + 1 + len("privilege") + 1 + len(r.Application) + 1 + len(r.Name)) @@ -76,10 +92,16 @@ func (r SecurityGetPrivilegesRequest) Do(ctx context.Context, transport Transpor if r.Application != "" { path.WriteString("/") path.WriteString(r.Application) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "application", r.Application) + } } if r.Name != "" { path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } } params = make(map[string]string) @@ -102,6 +124,9 @@ func (r SecurityGetPrivilegesRequest) Do(ctx context.Context, transport Transpor req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -129,8 +154,17 @@ func (r SecurityGetPrivilegesRequest) Do(ctx context.Context, transport Transpor req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.get_privileges") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.get_privileges") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_role.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_role.go index fbf53b7da..ee55fce0b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_role.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_role.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSecurityGetRoleFunc(t Transport) SecurityGetRole { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type SecurityGetRoleRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityGetRoleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityGetRoleRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_role") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_security") + 1 + len("role") + 1 + len(strings.Join(r.Name, ","))) @@ -75,6 +91,9 @@ func (r SecurityGetRoleRequest) Do(ctx context.Context, transport Transport) (*R if len(r.Name) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Name, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", strings.Join(r.Name, ",")) + } } params = make(map[string]string) @@ -97,6 +116,9 @@ func (r SecurityGetRoleRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -124,8 +146,17 @@ func (r SecurityGetRoleRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.get_role") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.get_role") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_role_mapping.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_role_mapping.go index aa2b3d7d7..c41e722fb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_role_mapping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_role_mapping.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSecurityGetRoleMappingFunc(t Transport) SecurityGetRoleMapping { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type SecurityGetRoleMappingRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityGetRoleMappingRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityGetRoleMappingRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_role_mapping") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_security") + 1 + len("role_mapping") + 1 + len(strings.Join(r.Name, ","))) @@ -75,6 +91,9 @@ func (r SecurityGetRoleMappingRequest) Do(ctx context.Context, transport Transpo if len(r.Name) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Name, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", strings.Join(r.Name, ",")) + } } params = make(map[string]string) @@ -97,6 +116,9 @@ func (r SecurityGetRoleMappingRequest) Do(ctx context.Context, transport Transpo req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -124,8 +146,17 @@ func (r SecurityGetRoleMappingRequest) Do(ctx context.Context, transport Transpo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.get_role_mapping") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.get_role_mapping") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_service_accounts.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_service_accounts.go index a687a1864..c3b29eb94 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_service_accounts.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_service_accounts.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSecurityGetServiceAccountsFunc(t Transport) SecurityGetServiceAccounts { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type SecurityGetServiceAccountsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityGetServiceAccountsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityGetServiceAccountsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_service_accounts") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_security") + 1 + len("service") + 1 + len(r.Namespace) + 1 + len(r.Service)) @@ -76,10 +92,16 @@ func (r SecurityGetServiceAccountsRequest) Do(ctx context.Context, transport Tra if r.Namespace != "" { path.WriteString("/") path.WriteString(r.Namespace) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "namespace", r.Namespace) + } } if r.Service != "" { path.WriteString("/") path.WriteString(r.Service) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "service", r.Service) + } } params = make(map[string]string) @@ -102,6 +124,9 @@ func (r SecurityGetServiceAccountsRequest) Do(ctx context.Context, transport Tra req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -129,8 +154,17 @@ func (r SecurityGetServiceAccountsRequest) Do(ctx context.Context, transport Tra req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.get_service_accounts") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.get_service_accounts") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_service_credentials.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_service_credentials.go index bee63161d..67bd6e288 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_service_credentials.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_service_credentials.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSecurityGetServiceCredentialsFunc(t Transport) SecurityGetServiceCredent for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type SecurityGetServiceCredentialsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityGetServiceCredentialsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityGetServiceCredentialsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_service_credentials") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_security") + 1 + len("service") + 1 + len(r.Namespace) + 1 + len(r.Service) + 1 + len("credential")) @@ -75,8 +91,14 @@ func (r SecurityGetServiceCredentialsRequest) Do(ctx context.Context, transport path.WriteString("service") path.WriteString("/") path.WriteString(r.Namespace) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "namespace", r.Namespace) + } path.WriteString("/") path.WriteString(r.Service) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "service", r.Service) + } path.WriteString("/") path.WriteString("credential") @@ -100,6 +122,9 @@ func (r SecurityGetServiceCredentialsRequest) Do(ctx context.Context, transport req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -127,8 +152,17 @@ func (r SecurityGetServiceCredentialsRequest) Do(ctx context.Context, transport req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.get_service_credentials") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.get_service_credentials") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_settings.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_settings.go index ef68022fe..36ade7bcd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_settings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_settings.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSecurityGetSettingsFunc(t Transport) SecurityGetSettings { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type SecurityGetSettingsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityGetSettingsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityGetSettingsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_settings") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_security/settings")) @@ -88,6 +104,9 @@ func (r SecurityGetSettingsRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r SecurityGetSettingsRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.get_settings") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.get_settings") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_token.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_token.go index 496296880..1fdbf2dd4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_token.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_token.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecurityGetTokenFunc(t Transport) SecurityGetToken { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type SecurityGetTokenRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityGetTokenRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityGetTokenRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_token") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_security/oauth2/token")) @@ -91,6 +107,9 @@ func (r SecurityGetTokenRequest) Do(ctx context.Context, transport Transport) (* req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +141,20 @@ func (r SecurityGetTokenRequest) Do(ctx context.Context, transport Transport) (* req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.get_token") + if reader := instrument.RecordRequestBody(ctx, "security.get_token", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.get_token") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_user.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_user.go index c406baa7b..719215435 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_user.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_user.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecurityGetUserFunc(t Transport) SecurityGetUser { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type SecurityGetUserRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityGetUserRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityGetUserRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_user") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_security") + 1 + len("user") + 1 + len(strings.Join(r.Username, ","))) @@ -78,6 +94,9 @@ func (r SecurityGetUserRequest) Do(ctx context.Context, transport Transport) (*R if len(r.Username) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Username, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "username", strings.Join(r.Username, ",")) + } } params = make(map[string]string) @@ -104,6 +123,9 @@ func (r SecurityGetUserRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -131,8 +153,17 @@ func (r SecurityGetUserRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.get_user") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.get_user") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_user_privileges.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_user_privileges.go index aa4a32652..5511de0f3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_user_privileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_user_privileges.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSecurityGetUserPrivilegesFunc(t Transport) SecurityGetUserPrivileges { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type SecurityGetUserPrivilegesRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityGetUserPrivilegesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityGetUserPrivilegesRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_user_privileges") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_security/user/_privileges")) @@ -88,6 +104,9 @@ func (r SecurityGetUserPrivilegesRequest) Do(ctx context.Context, transport Tran req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r SecurityGetUserPrivilegesRequest) Do(ctx context.Context, transport Tran req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.get_user_privileges") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.get_user_privileges") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_user_profile.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_user_profile.go index a586016f2..38e017ee6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_user_profile.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.get_user_profile.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecurityGetUserProfileFunc(t Transport) SecurityGetUserProfile { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type SecurityGetUserProfileRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityGetUserProfileRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityGetUserProfileRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_user_profile") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" if len(r.UID) == 0 { @@ -81,6 +97,9 @@ func (r SecurityGetUserProfileRequest) Do(ctx context.Context, transport Transpo path.WriteString("profile") path.WriteString("/") path.WriteString(strings.Join(r.UID, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "uid", strings.Join(r.UID, ",")) + } params = make(map[string]string) @@ -106,6 +125,9 @@ func (r SecurityGetUserProfileRequest) Do(ctx context.Context, transport Transpo req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -133,8 +155,17 @@ func (r SecurityGetUserProfileRequest) Do(ctx context.Context, transport Transpo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.get_user_profile") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.get_user_profile") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.grant_api_key.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.grant_api_key.go index bb1d76597..e8ca7bb0e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.grant_api_key.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.grant_api_key.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecurityGrantAPIKeyFunc(t Transport) SecurityGrantAPIKey { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type SecurityGrantAPIKeyRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityGrantAPIKeyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityGrantAPIKeyRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.grant_api_key") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_security/api_key/grant")) @@ -97,6 +113,9 @@ func (r SecurityGrantAPIKeyRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -128,8 +147,20 @@ func (r SecurityGrantAPIKeyRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.grant_api_key") + if reader := instrument.RecordRequestBody(ctx, "security.grant_api_key", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.grant_api_key") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.has_privileges.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.has_privileges.go index 33086da4b..ecb697781 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.has_privileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.has_privileges.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecurityHasPrivilegesFunc(t Transport) SecurityHasPrivileges { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type SecurityHasPrivilegesRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityHasPrivilegesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityHasPrivilegesRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.has_privileges") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_security") + 1 + len("user") + 1 + len(r.User) + 1 + len("_has_privileges")) @@ -78,6 +94,9 @@ func (r SecurityHasPrivilegesRequest) Do(ctx context.Context, transport Transpor if r.User != "" { path.WriteString("/") path.WriteString(r.User) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "user", r.User) + } } path.WriteString("/") path.WriteString("_has_privileges") @@ -102,6 +121,9 @@ func (r SecurityHasPrivilegesRequest) Do(ctx context.Context, transport Transpor req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -133,8 +155,20 @@ func (r SecurityHasPrivilegesRequest) Do(ctx context.Context, transport Transpor req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.has_privileges") + if reader := instrument.RecordRequestBody(ctx, "security.has_privileges", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.has_privileges") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.has_privileges_user_profile.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.has_privileges_user_profile.go index 6b8dbf6fc..04614156e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.has_privileges_user_profile.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.has_privileges_user_profile.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecurityHasPrivilegesUserProfileFunc(t Transport) SecurityHasPrivilegesU for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type SecurityHasPrivilegesUserProfileRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityHasPrivilegesUserProfileRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityHasPrivilegesUserProfileRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.has_privileges_user_profile") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_security/profile/_has_privileges")) @@ -91,6 +107,9 @@ func (r SecurityHasPrivilegesUserProfileRequest) Do(ctx context.Context, transpo req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +141,20 @@ func (r SecurityHasPrivilegesUserProfileRequest) Do(ctx context.Context, transpo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.has_privileges_user_profile") + if reader := instrument.RecordRequestBody(ctx, "security.has_privileges_user_profile", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.has_privileges_user_profile") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.invalidate_api_key.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.invalidate_api_key.go index 93b6234aa..6a790fdb0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.invalidate_api_key.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.invalidate_api_key.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecurityInvalidateAPIKeyFunc(t Transport) SecurityInvalidateAPIKey { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type SecurityInvalidateAPIKeyRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityInvalidateAPIKeyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityInvalidateAPIKeyRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.invalidate_api_key") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + len("/_security/api_key")) @@ -91,6 +107,9 @@ func (r SecurityInvalidateAPIKeyRequest) Do(ctx context.Context, transport Trans req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +141,20 @@ func (r SecurityInvalidateAPIKeyRequest) Do(ctx context.Context, transport Trans req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.invalidate_api_key") + if reader := instrument.RecordRequestBody(ctx, "security.invalidate_api_key", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.invalidate_api_key") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.invalidate_token.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.invalidate_token.go index 5875db9d8..c0369ed9f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.invalidate_token.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.invalidate_token.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecurityInvalidateTokenFunc(t Transport) SecurityInvalidateToken { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type SecurityInvalidateTokenRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityInvalidateTokenRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityInvalidateTokenRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.invalidate_token") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + len("/_security/oauth2/token")) @@ -91,6 +107,9 @@ func (r SecurityInvalidateTokenRequest) Do(ctx context.Context, transport Transp req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +141,20 @@ func (r SecurityInvalidateTokenRequest) Do(ctx context.Context, transport Transp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.invalidate_token") + if reader := instrument.RecordRequestBody(ctx, "security.invalidate_token", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.invalidate_token") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.oidc_authenticate.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.oidc_authenticate.go index 1ad0845e3..7e91ceb8e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.oidc_authenticate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.oidc_authenticate.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecurityOidcAuthenticateFunc(t Transport) SecurityOidcAuthenticate { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type SecurityOidcAuthenticateRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityOidcAuthenticateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityOidcAuthenticateRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.oidc_authenticate") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_security/oidc/authenticate")) @@ -91,6 +107,9 @@ func (r SecurityOidcAuthenticateRequest) Do(ctx context.Context, transport Trans req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +141,20 @@ func (r SecurityOidcAuthenticateRequest) Do(ctx context.Context, transport Trans req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.oidc_authenticate") + if reader := instrument.RecordRequestBody(ctx, "security.oidc_authenticate", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.oidc_authenticate") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.oidc_logout.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.oidc_logout.go index a10b338bb..15fe0e565 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.oidc_logout.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.oidc_logout.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecurityOidcLogoutFunc(t Transport) SecurityOidcLogout { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type SecurityOidcLogoutRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityOidcLogoutRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityOidcLogoutRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.oidc_logout") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_security/oidc/logout")) @@ -91,6 +107,9 @@ func (r SecurityOidcLogoutRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +141,20 @@ func (r SecurityOidcLogoutRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.oidc_logout") + if reader := instrument.RecordRequestBody(ctx, "security.oidc_logout", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.oidc_logout") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.oidc_prepare_authentication.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.oidc_prepare_authentication.go index ea75d8608..f5f4ac2a5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.oidc_prepare_authentication.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.oidc_prepare_authentication.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecurityOidcPrepareAuthenticationFunc(t Transport) SecurityOidcPrepareAu for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type SecurityOidcPrepareAuthenticationRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityOidcPrepareAuthenticationRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityOidcPrepareAuthenticationRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.oidc_prepare_authentication") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_security/oidc/prepare")) @@ -91,6 +107,9 @@ func (r SecurityOidcPrepareAuthenticationRequest) Do(ctx context.Context, transp req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +141,20 @@ func (r SecurityOidcPrepareAuthenticationRequest) Do(ctx context.Context, transp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.oidc_prepare_authentication") + if reader := instrument.RecordRequestBody(ctx, "security.oidc_prepare_authentication", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.oidc_prepare_authentication") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.put_privileges.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.put_privileges.go index 31bd6f183..1ccea1950 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.put_privileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.put_privileges.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecurityPutPrivilegesFunc(t Transport) SecurityPutPrivileges { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type SecurityPutPrivilegesRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityPutPrivilegesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityPutPrivilegesRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.put_privileges") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + len("/_security/privilege/")) @@ -97,6 +113,9 @@ func (r SecurityPutPrivilegesRequest) Do(ctx context.Context, transport Transpor req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -128,8 +147,20 @@ func (r SecurityPutPrivilegesRequest) Do(ctx context.Context, transport Transpor req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.put_privileges") + if reader := instrument.RecordRequestBody(ctx, "security.put_privileges", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.put_privileges") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.put_role.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.put_role.go index 012ad04e0..5d4e51690 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.put_role.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.put_role.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecurityPutRoleFunc(t Transport) SecurityPutRole { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -59,16 +64,27 @@ type SecurityPutRoleRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityPutRoleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityPutRoleRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.put_role") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_security") + 1 + len("role") + 1 + len(r.Name)) @@ -79,6 +95,9 @@ func (r SecurityPutRoleRequest) Do(ctx context.Context, transport Transport) (*R path.WriteString("role") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } params = make(map[string]string) @@ -104,6 +123,9 @@ func (r SecurityPutRoleRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -135,8 +157,20 @@ func (r SecurityPutRoleRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.put_role") + if reader := instrument.RecordRequestBody(ctx, "security.put_role", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.put_role") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.put_role_mapping.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.put_role_mapping.go index 464048b3c..0e8378bfc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.put_role_mapping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.put_role_mapping.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecurityPutRoleMappingFunc(t Transport) SecurityPutRoleMapping { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -59,16 +64,27 @@ type SecurityPutRoleMappingRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityPutRoleMappingRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityPutRoleMappingRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.put_role_mapping") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_security") + 1 + len("role_mapping") + 1 + len(r.Name)) @@ -79,6 +95,9 @@ func (r SecurityPutRoleMappingRequest) Do(ctx context.Context, transport Transpo path.WriteString("role_mapping") path.WriteString("/") path.WriteString(r.Name) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.Name) + } params = make(map[string]string) @@ -104,6 +123,9 @@ func (r SecurityPutRoleMappingRequest) Do(ctx context.Context, transport Transpo req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -135,8 +157,20 @@ func (r SecurityPutRoleMappingRequest) Do(ctx context.Context, transport Transpo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.put_role_mapping") + if reader := instrument.RecordRequestBody(ctx, "security.put_role_mapping", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.put_role_mapping") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.put_user.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.put_user.go index 0e1c86b78..6b21ce4a6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.put_user.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.put_user.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecurityPutUserFunc(t Transport) SecurityPutUser { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -59,16 +64,27 @@ type SecurityPutUserRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityPutUserRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityPutUserRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.put_user") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_security") + 1 + len("user") + 1 + len(r.Username)) @@ -79,6 +95,9 @@ func (r SecurityPutUserRequest) Do(ctx context.Context, transport Transport) (*R path.WriteString("user") path.WriteString("/") path.WriteString(r.Username) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "username", r.Username) + } params = make(map[string]string) @@ -104,6 +123,9 @@ func (r SecurityPutUserRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -135,8 +157,20 @@ func (r SecurityPutUserRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.put_user") + if reader := instrument.RecordRequestBody(ctx, "security.put_user", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.put_user") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.query_api_keys.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.query_api_keys.go index edddfb065..026c178be 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.query_api_keys.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.query_api_keys.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newSecurityQueryAPIKeysFunc(t Transport) SecurityQueryAPIKeys { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -58,16 +63,27 @@ type SecurityQueryAPIKeysRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityQueryAPIKeysRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityQueryAPIKeysRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.query_api_keys") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_security/_query/api_key")) @@ -98,6 +114,9 @@ func (r SecurityQueryAPIKeysRequest) Do(ctx context.Context, transport Transport req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -129,8 +148,20 @@ func (r SecurityQueryAPIKeysRequest) Do(ctx context.Context, transport Transport req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.query_api_keys") + if reader := instrument.RecordRequestBody(ctx, "security.query_api_keys", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.query_api_keys") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.saml_authenticate.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.saml_authenticate.go index f8cf51515..7a42cf908 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.saml_authenticate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.saml_authenticate.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecuritySamlAuthenticateFunc(t Transport) SecuritySamlAuthenticate { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type SecuritySamlAuthenticateRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecuritySamlAuthenticateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecuritySamlAuthenticateRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.saml_authenticate") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_security/saml/authenticate")) @@ -91,6 +107,9 @@ func (r SecuritySamlAuthenticateRequest) Do(ctx context.Context, transport Trans req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +141,20 @@ func (r SecuritySamlAuthenticateRequest) Do(ctx context.Context, transport Trans req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.saml_authenticate") + if reader := instrument.RecordRequestBody(ctx, "security.saml_authenticate", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.saml_authenticate") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.saml_complete_logout.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.saml_complete_logout.go index df5f0cbd4..085dd2209 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.saml_complete_logout.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.saml_complete_logout.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecuritySamlCompleteLogoutFunc(t Transport) SecuritySamlCompleteLogout { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type SecuritySamlCompleteLogoutRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecuritySamlCompleteLogoutRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecuritySamlCompleteLogoutRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.saml_complete_logout") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_security/saml/complete_logout")) @@ -91,6 +107,9 @@ func (r SecuritySamlCompleteLogoutRequest) Do(ctx context.Context, transport Tra req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +141,20 @@ func (r SecuritySamlCompleteLogoutRequest) Do(ctx context.Context, transport Tra req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.saml_complete_logout") + if reader := instrument.RecordRequestBody(ctx, "security.saml_complete_logout", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.saml_complete_logout") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.saml_invalidate.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.saml_invalidate.go index b0836845b..02c9ac803 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.saml_invalidate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.saml_invalidate.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecuritySamlInvalidateFunc(t Transport) SecuritySamlInvalidate { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type SecuritySamlInvalidateRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecuritySamlInvalidateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecuritySamlInvalidateRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.saml_invalidate") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_security/saml/invalidate")) @@ -91,6 +107,9 @@ func (r SecuritySamlInvalidateRequest) Do(ctx context.Context, transport Transpo req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +141,20 @@ func (r SecuritySamlInvalidateRequest) Do(ctx context.Context, transport Transpo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.saml_invalidate") + if reader := instrument.RecordRequestBody(ctx, "security.saml_invalidate", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.saml_invalidate") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.saml_logout.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.saml_logout.go index c94e4eb6f..2a301c5a6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.saml_logout.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.saml_logout.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecuritySamlLogoutFunc(t Transport) SecuritySamlLogout { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type SecuritySamlLogoutRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecuritySamlLogoutRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecuritySamlLogoutRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.saml_logout") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_security/saml/logout")) @@ -91,6 +107,9 @@ func (r SecuritySamlLogoutRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +141,20 @@ func (r SecuritySamlLogoutRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.saml_logout") + if reader := instrument.RecordRequestBody(ctx, "security.saml_logout", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.saml_logout") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.saml_prepare_authentication.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.saml_prepare_authentication.go index f9f7d001e..afe82c9e1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.saml_prepare_authentication.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.saml_prepare_authentication.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecuritySamlPrepareAuthenticationFunc(t Transport) SecuritySamlPrepareAu for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type SecuritySamlPrepareAuthenticationRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecuritySamlPrepareAuthenticationRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecuritySamlPrepareAuthenticationRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.saml_prepare_authentication") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_security/saml/prepare")) @@ -91,6 +107,9 @@ func (r SecuritySamlPrepareAuthenticationRequest) Do(ctx context.Context, transp req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +141,20 @@ func (r SecuritySamlPrepareAuthenticationRequest) Do(ctx context.Context, transp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.saml_prepare_authentication") + if reader := instrument.RecordRequestBody(ctx, "security.saml_prepare_authentication", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.saml_prepare_authentication") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.saml_service_provider_metadata.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.saml_service_provider_metadata.go index e2f8f3eba..7165e0800 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.saml_service_provider_metadata.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.saml_service_provider_metadata.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSecuritySamlServiceProviderMetadataFunc(t Transport) SecuritySamlService for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type SecuritySamlServiceProviderMetadataRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecuritySamlServiceProviderMetadataRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecuritySamlServiceProviderMetadataRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.saml_service_provider_metadata") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_security") + 1 + len("saml") + 1 + len("metadata") + 1 + len(r.RealmName)) @@ -76,6 +92,9 @@ func (r SecuritySamlServiceProviderMetadataRequest) Do(ctx context.Context, tran path.WriteString("metadata") path.WriteString("/") path.WriteString(r.RealmName) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "realm_name", r.RealmName) + } params = make(map[string]string) @@ -97,6 +116,9 @@ func (r SecuritySamlServiceProviderMetadataRequest) Do(ctx context.Context, tran req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -124,8 +146,17 @@ func (r SecuritySamlServiceProviderMetadataRequest) Do(ctx context.Context, tran req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.saml_service_provider_metadata") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.saml_service_provider_metadata") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.suggest_user_profiles.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.suggest_user_profiles.go index 421286d23..d6a36212d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.suggest_user_profiles.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.suggest_user_profiles.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecuritySuggestUserProfilesFunc(t Transport) SecuritySuggestUserProfiles for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type SecuritySuggestUserProfilesRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecuritySuggestUserProfilesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecuritySuggestUserProfilesRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.suggest_user_profiles") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_security/profile/_suggest")) @@ -97,6 +113,9 @@ func (r SecuritySuggestUserProfilesRequest) Do(ctx context.Context, transport Tr req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -128,8 +147,20 @@ func (r SecuritySuggestUserProfilesRequest) Do(ctx context.Context, transport Tr req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.suggest_user_profiles") + if reader := instrument.RecordRequestBody(ctx, "security.suggest_user_profiles", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.suggest_user_profiles") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.update_api_key.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.update_api_key.go index cfa35049c..2a97dc5c0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.update_api_key.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.update_api_key.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecurityUpdateAPIKeyFunc(t Transport) SecurityUpdateAPIKey { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type SecurityUpdateAPIKeyRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityUpdateAPIKeyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityUpdateAPIKeyRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.update_api_key") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_security") + 1 + len("api_key") + 1 + len(r.DocumentID)) @@ -77,6 +93,9 @@ func (r SecurityUpdateAPIKeyRequest) Do(ctx context.Context, transport Transport path.WriteString("api_key") path.WriteString("/") path.WriteString(r.DocumentID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.DocumentID) + } params = make(map[string]string) @@ -98,6 +117,9 @@ func (r SecurityUpdateAPIKeyRequest) Do(ctx context.Context, transport Transport req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -129,8 +151,20 @@ func (r SecurityUpdateAPIKeyRequest) Do(ctx context.Context, transport Transport req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.update_api_key") + if reader := instrument.RecordRequestBody(ctx, "security.update_api_key", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.update_api_key") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.update_cross_cluster_api_key.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.update_cross_cluster_api_key.go index a7f52a2bc..83ce6b7c6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.update_cross_cluster_api_key.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.update_cross_cluster_api_key.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecurityUpdateCrossClusterAPIKeyFunc(t Transport) SecurityUpdateCrossClu for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -59,16 +64,27 @@ type SecurityUpdateCrossClusterAPIKeyRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityUpdateCrossClusterAPIKeyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityUpdateCrossClusterAPIKeyRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.update_cross_cluster_api_key") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_security") + 1 + len("cross_cluster") + 1 + len("api_key") + 1 + len(r.DocumentID)) @@ -81,6 +97,9 @@ func (r SecurityUpdateCrossClusterAPIKeyRequest) Do(ctx context.Context, transpo path.WriteString("api_key") path.WriteString("/") path.WriteString(r.DocumentID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.DocumentID) + } params = make(map[string]string) @@ -102,6 +121,9 @@ func (r SecurityUpdateCrossClusterAPIKeyRequest) Do(ctx context.Context, transpo req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -133,8 +155,20 @@ func (r SecurityUpdateCrossClusterAPIKeyRequest) Do(ctx context.Context, transpo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.update_cross_cluster_api_key") + if reader := instrument.RecordRequestBody(ctx, "security.update_cross_cluster_api_key", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.update_cross_cluster_api_key") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.update_settings.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.update_settings.go index 11bfdbe9a..799ac690c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.update_settings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.update_settings.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSecurityUpdateSettingsFunc(t Transport) SecurityUpdateSettings { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type SecurityUpdateSettingsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityUpdateSettingsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityUpdateSettingsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.update_settings") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + len("/_security/settings")) @@ -91,6 +107,9 @@ func (r SecurityUpdateSettingsRequest) Do(ctx context.Context, transport Transpo req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +141,20 @@ func (r SecurityUpdateSettingsRequest) Do(ctx context.Context, transport Transpo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.update_settings") + if reader := instrument.RecordRequestBody(ctx, "security.update_settings", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.update_settings") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.update_user_profile_data.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.update_user_profile_data.go index 7888bab3c..46eab4e6a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.update_user_profile_data.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.security.update_user_profile_data.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newSecurityUpdateUserProfileDataFunc(t Transport) SecurityUpdateUserProfile for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -62,16 +67,27 @@ type SecurityUpdateUserProfileDataRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SecurityUpdateUserProfileDataRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SecurityUpdateUserProfileDataRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.update_user_profile_data") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_security") + 1 + len("profile") + 1 + len(r.UID) + 1 + len("_data")) @@ -82,6 +98,9 @@ func (r SecurityUpdateUserProfileDataRequest) Do(ctx context.Context, transport path.WriteString("profile") path.WriteString("/") path.WriteString(r.UID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "uid", r.UID) + } path.WriteString("/") path.WriteString("_data") @@ -117,6 +136,9 @@ func (r SecurityUpdateUserProfileDataRequest) Do(ctx context.Context, transport req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -148,8 +170,20 @@ func (r SecurityUpdateUserProfileDataRequest) Do(ctx context.Context, transport req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "security.update_user_profile_data") + if reader := instrument.RecordRequestBody(ctx, "security.update_user_profile_data", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.update_user_profile_data") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.delete_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.delete_lifecycle.go index 94cb47834..f9290829f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.delete_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.delete_lifecycle.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSlmDeleteLifecycleFunc(t Transport) SlmDeleteLifecycle { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type SlmDeleteLifecycleRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SlmDeleteLifecycleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SlmDeleteLifecycleRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "slm.delete_lifecycle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_slm") + 1 + len("policy") + 1 + len(r.PolicyID)) @@ -74,6 +90,9 @@ func (r SlmDeleteLifecycleRequest) Do(ctx context.Context, transport Transport) path.WriteString("policy") path.WriteString("/") path.WriteString(r.PolicyID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "policy_id", r.PolicyID) + } params = make(map[string]string) @@ -95,6 +114,9 @@ func (r SlmDeleteLifecycleRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +144,17 @@ func (r SlmDeleteLifecycleRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "slm.delete_lifecycle") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "slm.delete_lifecycle") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.execute_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.execute_lifecycle.go index 92e3a62ab..7c4a1aa5a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.execute_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.execute_lifecycle.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSlmExecuteLifecycleFunc(t Transport) SlmExecuteLifecycle { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type SlmExecuteLifecycleRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SlmExecuteLifecycleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SlmExecuteLifecycleRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "slm.execute_lifecycle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_slm") + 1 + len("policy") + 1 + len(r.PolicyID) + 1 + len("_execute")) @@ -74,6 +90,9 @@ func (r SlmExecuteLifecycleRequest) Do(ctx context.Context, transport Transport) path.WriteString("policy") path.WriteString("/") path.WriteString(r.PolicyID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "policy_id", r.PolicyID) + } path.WriteString("/") path.WriteString("_execute") @@ -97,6 +116,9 @@ func (r SlmExecuteLifecycleRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -124,8 +146,17 @@ func (r SlmExecuteLifecycleRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "slm.execute_lifecycle") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "slm.execute_lifecycle") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.execute_retention.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.execute_retention.go index c5d0f090c..b6fb31f3e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.execute_retention.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.execute_retention.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSlmExecuteRetentionFunc(t Transport) SlmExecuteRetention { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type SlmExecuteRetentionRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SlmExecuteRetentionRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SlmExecuteRetentionRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "slm.execute_retention") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_slm/_execute_retention")) @@ -88,6 +104,9 @@ func (r SlmExecuteRetentionRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r SlmExecuteRetentionRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "slm.execute_retention") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "slm.execute_retention") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.get_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.get_lifecycle.go index 0a0e4353b..8cae902bf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.get_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.get_lifecycle.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSlmGetLifecycleFunc(t Transport) SlmGetLifecycle { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type SlmGetLifecycleRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SlmGetLifecycleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SlmGetLifecycleRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "slm.get_lifecycle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_slm") + 1 + len("policy") + 1 + len(strings.Join(r.PolicyID, ","))) @@ -75,6 +91,9 @@ func (r SlmGetLifecycleRequest) Do(ctx context.Context, transport Transport) (*R if len(r.PolicyID) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.PolicyID, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "policy_id", strings.Join(r.PolicyID, ",")) + } } params = make(map[string]string) @@ -97,6 +116,9 @@ func (r SlmGetLifecycleRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -124,8 +146,17 @@ func (r SlmGetLifecycleRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "slm.get_lifecycle") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "slm.get_lifecycle") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.get_stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.get_stats.go index ec2a592c0..8a327584f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.get_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.get_stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSlmGetStatsFunc(t Transport) SlmGetStats { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type SlmGetStatsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SlmGetStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SlmGetStatsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "slm.get_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_slm/stats")) @@ -88,6 +104,9 @@ func (r SlmGetStatsRequest) Do(ctx context.Context, transport Transport) (*Respo req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r SlmGetStatsRequest) Do(ctx context.Context, transport Transport) (*Respo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "slm.get_stats") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "slm.get_stats") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.get_status.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.get_status.go index 333ed714d..f341e228e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.get_status.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.get_status.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSlmGetStatusFunc(t Transport) SlmGetStatus { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type SlmGetStatusRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SlmGetStatusRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SlmGetStatusRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "slm.get_status") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_slm/status")) @@ -88,6 +104,9 @@ func (r SlmGetStatusRequest) Do(ctx context.Context, transport Transport) (*Resp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r SlmGetStatusRequest) Do(ctx context.Context, transport Transport) (*Resp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "slm.get_status") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "slm.get_status") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.put_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.put_lifecycle.go index d35b4c3fa..ba58a7ab0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.put_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.put_lifecycle.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSlmPutLifecycleFunc(t Transport) SlmPutLifecycle { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type SlmPutLifecycleRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SlmPutLifecycleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SlmPutLifecycleRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "slm.put_lifecycle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_slm") + 1 + len("policy") + 1 + len(r.PolicyID)) @@ -77,6 +93,9 @@ func (r SlmPutLifecycleRequest) Do(ctx context.Context, transport Transport) (*R path.WriteString("policy") path.WriteString("/") path.WriteString(r.PolicyID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "policy_id", r.PolicyID) + } params = make(map[string]string) @@ -98,6 +117,9 @@ func (r SlmPutLifecycleRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -129,8 +151,20 @@ func (r SlmPutLifecycleRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "slm.put_lifecycle") + if reader := instrument.RecordRequestBody(ctx, "slm.put_lifecycle", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "slm.put_lifecycle") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.start.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.start.go index 37d8923cc..c5b9f3e46 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.start.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.start.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSlmStartFunc(t Transport) SlmStart { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type SlmStartRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SlmStartRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SlmStartRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "slm.start") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_slm/start")) @@ -88,6 +104,9 @@ func (r SlmStartRequest) Do(ctx context.Context, transport Transport) (*Response req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r SlmStartRequest) Do(ctx context.Context, transport Transport) (*Response req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "slm.start") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "slm.start") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.stop.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.stop.go index 33d898b9d..ef43f8ea4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.stop.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.slm.stop.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSlmStopFunc(t Transport) SlmStop { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type SlmStopRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SlmStopRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SlmStopRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "slm.stop") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_slm/stop")) @@ -88,6 +104,9 @@ func (r SlmStopRequest) Do(ctx context.Context, transport Transport) (*Response, req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r SlmStopRequest) Do(ctx context.Context, transport Transport) (*Response, req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "slm.stop") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "slm.stop") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.sql.clear_cursor.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.sql.clear_cursor.go index 93553d2fc..3c048e7a0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.sql.clear_cursor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.sql.clear_cursor.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSQLClearCursorFunc(t Transport) SQLClearCursor { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type SQLClearCursorRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SQLClearCursorRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SQLClearCursorRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "sql.clear_cursor") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_sql/close")) @@ -91,6 +107,9 @@ func (r SQLClearCursorRequest) Do(ctx context.Context, transport Transport) (*Re req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +141,20 @@ func (r SQLClearCursorRequest) Do(ctx context.Context, transport Transport) (*Re req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "sql.clear_cursor") + if reader := instrument.RecordRequestBody(ctx, "sql.clear_cursor", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "sql.clear_cursor") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.sql.delete_async.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.sql.delete_async.go index c8cff7a2d..9cfccd888 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.sql.delete_async.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.sql.delete_async.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSQLDeleteAsyncFunc(t Transport) SQLDeleteAsync { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type SQLDeleteAsyncRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SQLDeleteAsyncRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SQLDeleteAsyncRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "sql.delete_async") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_sql") + 1 + len("async") + 1 + len("delete") + 1 + len(r.DocumentID)) @@ -76,6 +92,9 @@ func (r SQLDeleteAsyncRequest) Do(ctx context.Context, transport Transport) (*Re path.WriteString("delete") path.WriteString("/") path.WriteString(r.DocumentID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.DocumentID) + } params = make(map[string]string) @@ -97,6 +116,9 @@ func (r SQLDeleteAsyncRequest) Do(ctx context.Context, transport Transport) (*Re req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -124,8 +146,17 @@ func (r SQLDeleteAsyncRequest) Do(ctx context.Context, transport Transport) (*Re req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "sql.delete_async") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "sql.delete_async") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.sql.get_async.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.sql.get_async.go index 88b3f659e..d7a501379 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.sql.get_async.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.sql.get_async.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSQLGetAsyncFunc(t Transport) SQLGetAsync { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -60,16 +65,27 @@ type SQLGetAsyncRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SQLGetAsyncRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SQLGetAsyncRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "sql.get_async") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_sql") + 1 + len("async") + 1 + len(r.DocumentID)) @@ -80,6 +96,9 @@ func (r SQLGetAsyncRequest) Do(ctx context.Context, transport Transport) (*Respo path.WriteString("async") path.WriteString("/") path.WriteString(r.DocumentID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.DocumentID) + } params = make(map[string]string) @@ -117,6 +136,9 @@ func (r SQLGetAsyncRequest) Do(ctx context.Context, transport Transport) (*Respo req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -144,8 +166,17 @@ func (r SQLGetAsyncRequest) Do(ctx context.Context, transport Transport) (*Respo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "sql.get_async") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "sql.get_async") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.sql.get_async_status.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.sql.get_async_status.go index 3f96b0bfc..81dafd984 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.sql.get_async_status.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.sql.get_async_status.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSQLGetAsyncStatusFunc(t Transport) SQLGetAsyncStatus { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type SQLGetAsyncStatusRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SQLGetAsyncStatusRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SQLGetAsyncStatusRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "sql.get_async_status") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_sql") + 1 + len("async") + 1 + len("status") + 1 + len(r.DocumentID)) @@ -76,6 +92,9 @@ func (r SQLGetAsyncStatusRequest) Do(ctx context.Context, transport Transport) ( path.WriteString("status") path.WriteString("/") path.WriteString(r.DocumentID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.DocumentID) + } params = make(map[string]string) @@ -97,6 +116,9 @@ func (r SQLGetAsyncStatusRequest) Do(ctx context.Context, transport Transport) ( req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -124,8 +146,17 @@ func (r SQLGetAsyncStatusRequest) Do(ctx context.Context, transport Transport) ( req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "sql.get_async_status") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "sql.get_async_status") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.sql.query.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.sql.query.go index e9a4a3e51..cb4c34e2f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.sql.query.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.sql.query.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSQLQueryFunc(t Transport) SQLQuery { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type SQLQueryRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SQLQueryRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SQLQueryRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "sql.query") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_sql")) @@ -97,6 +113,9 @@ func (r SQLQueryRequest) Do(ctx context.Context, transport Transport) (*Response req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -128,8 +147,20 @@ func (r SQLQueryRequest) Do(ctx context.Context, transport Transport) (*Response req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "sql.query") + if reader := instrument.RecordRequestBody(ctx, "sql.query", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "sql.query") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.sql.translate.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.sql.translate.go index bb775f812..290f9c8af 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.sql.translate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.sql.translate.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newSQLTranslateFunc(t Transport) SQLTranslate { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type SQLTranslateRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SQLTranslateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SQLTranslateRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "sql.translate") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_sql/translate")) @@ -91,6 +107,9 @@ func (r SQLTranslateRequest) Do(ctx context.Context, transport Transport) (*Resp req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +141,20 @@ func (r SQLTranslateRequest) Do(ctx context.Context, transport Transport) (*Resp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "sql.translate") + if reader := instrument.RecordRequestBody(ctx, "sql.translate", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "sql.translate") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ssl.certificates.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ssl.certificates.go index fae22f625..ccb543a3e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ssl.certificates.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.ssl.certificates.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newSSLCertificatesFunc(t Transport) SSLCertificates { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type SSLCertificatesRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r SSLCertificatesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r SSLCertificatesRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ssl.certificates") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_ssl/certificates")) @@ -88,6 +104,9 @@ func (r SSLCertificatesRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r SSLCertificatesRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "ssl.certificates") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ssl.certificates") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.text_structure.find_structure.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.text_structure.find_structure.go index 952ba07d8..1b06f989c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.text_structure.find_structure.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.text_structure.find_structure.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newTextStructureFindStructureFunc(t Transport) TextStructureFindStructure { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -73,16 +78,27 @@ type TextStructureFindStructureRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r TextStructureFindStructureRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r TextStructureFindStructureRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "text_structure.find_structure") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_text_structure/find_structure")) @@ -169,6 +185,9 @@ func (r TextStructureFindStructureRequest) Do(ctx context.Context, transport Tra req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -200,8 +219,20 @@ func (r TextStructureFindStructureRequest) Do(ctx context.Context, transport Tra req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "text_structure.find_structure") + if reader := instrument.RecordRequestBody(ctx, "text_structure.find_structure", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "text_structure.find_structure") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.delete_transform.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.delete_transform.go index 07c23f707..91d73651e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.delete_transform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.delete_transform.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newTransformDeleteTransformFunc(t Transport) TransformDeleteTransform { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -60,16 +65,27 @@ type TransformDeleteTransformRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r TransformDeleteTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r TransformDeleteTransformRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "transform.delete_transform") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_transform") + 1 + len(r.TransformID)) @@ -78,6 +94,9 @@ func (r TransformDeleteTransformRequest) Do(ctx context.Context, transport Trans path.WriteString("_transform") path.WriteString("/") path.WriteString(r.TransformID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "transform_id", r.TransformID) + } params = make(map[string]string) @@ -111,6 +130,9 @@ func (r TransformDeleteTransformRequest) Do(ctx context.Context, transport Trans req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -138,8 +160,17 @@ func (r TransformDeleteTransformRequest) Do(ctx context.Context, transport Trans req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "transform.delete_transform") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "transform.delete_transform") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.get_transform.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.get_transform.go index bc5fcf363..28f89d5b6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.get_transform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.get_transform.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newTransformGetTransformFunc(t Transport) TransformGetTransform { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -60,16 +65,27 @@ type TransformGetTransformRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r TransformGetTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r TransformGetTransformRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "transform.get_transform") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_transform") + 1 + len(r.TransformID)) @@ -79,6 +95,9 @@ func (r TransformGetTransformRequest) Do(ctx context.Context, transport Transpor if r.TransformID != "" { path.WriteString("/") path.WriteString(r.TransformID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "transform_id", r.TransformID) + } } params = make(map[string]string) @@ -117,6 +136,9 @@ func (r TransformGetTransformRequest) Do(ctx context.Context, transport Transpor req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -144,8 +166,17 @@ func (r TransformGetTransformRequest) Do(ctx context.Context, transport Transpor req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "transform.get_transform") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "transform.get_transform") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.get_transform_stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.get_transform_stats.go index c16142f10..1ba3a4968 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.get_transform_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.get_transform_stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newTransformGetTransformStatsFunc(t Transport) TransformGetTransformStats { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -61,16 +66,27 @@ type TransformGetTransformStatsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r TransformGetTransformStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r TransformGetTransformStatsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "transform.get_transform_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_transform") + 1 + len(r.TransformID) + 1 + len("_stats")) @@ -79,6 +95,9 @@ func (r TransformGetTransformStatsRequest) Do(ctx context.Context, transport Tra path.WriteString("_transform") path.WriteString("/") path.WriteString(r.TransformID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "transform_id", r.TransformID) + } path.WriteString("/") path.WriteString("_stats") @@ -118,6 +137,9 @@ func (r TransformGetTransformStatsRequest) Do(ctx context.Context, transport Tra req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -145,8 +167,17 @@ func (r TransformGetTransformStatsRequest) Do(ctx context.Context, transport Tra req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "transform.get_transform_stats") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "transform.get_transform_stats") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.preview_transform.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.preview_transform.go index e1520f500..2a6a11cd8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.preview_transform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.preview_transform.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newTransformPreviewTransformFunc(t Transport) TransformPreviewTransform { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -60,16 +65,27 @@ type TransformPreviewTransformRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r TransformPreviewTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r TransformPreviewTransformRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "transform.preview_transform") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_transform") + 1 + len(r.TransformID) + 1 + len("_preview")) @@ -79,6 +95,9 @@ func (r TransformPreviewTransformRequest) Do(ctx context.Context, transport Tran if r.TransformID != "" { path.WriteString("/") path.WriteString(r.TransformID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "transform_id", r.TransformID) + } } path.WriteString("/") path.WriteString("_preview") @@ -107,6 +126,9 @@ func (r TransformPreviewTransformRequest) Do(ctx context.Context, transport Tran req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -138,8 +160,20 @@ func (r TransformPreviewTransformRequest) Do(ctx context.Context, transport Tran req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "transform.preview_transform") + if reader := instrument.RecordRequestBody(ctx, "transform.preview_transform", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "transform.preview_transform") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.put_transform.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.put_transform.go index aefa41169..dd51b142e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.put_transform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.put_transform.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newTransformPutTransformFunc(t Transport) TransformPutTransform { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -62,16 +67,27 @@ type TransformPutTransformRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r TransformPutTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r TransformPutTransformRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "transform.put_transform") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_transform") + 1 + len(r.TransformID)) @@ -80,6 +96,9 @@ func (r TransformPutTransformRequest) Do(ctx context.Context, transport Transpor path.WriteString("_transform") path.WriteString("/") path.WriteString(r.TransformID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "transform_id", r.TransformID) + } params = make(map[string]string) @@ -109,6 +128,9 @@ func (r TransformPutTransformRequest) Do(ctx context.Context, transport Transpor req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -140,8 +162,20 @@ func (r TransformPutTransformRequest) Do(ctx context.Context, transport Transpor req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "transform.put_transform") + if reader := instrument.RecordRequestBody(ctx, "transform.put_transform", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "transform.put_transform") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.reset_transform.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.reset_transform.go index 16700b549..d97eb1ea3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.reset_transform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.reset_transform.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newTransformResetTransformFunc(t Transport) TransformResetTransform { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -59,16 +64,27 @@ type TransformResetTransformRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r TransformResetTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r TransformResetTransformRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "transform.reset_transform") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_transform") + 1 + len(r.TransformID) + 1 + len("_reset")) @@ -77,6 +93,9 @@ func (r TransformResetTransformRequest) Do(ctx context.Context, transport Transp path.WriteString("_transform") path.WriteString("/") path.WriteString(r.TransformID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "transform_id", r.TransformID) + } path.WriteString("/") path.WriteString("_reset") @@ -108,6 +127,9 @@ func (r TransformResetTransformRequest) Do(ctx context.Context, transport Transp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -135,8 +157,17 @@ func (r TransformResetTransformRequest) Do(ctx context.Context, transport Transp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "transform.reset_transform") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "transform.reset_transform") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.schedule_now_transform.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.schedule_now_transform.go index 7ed9961fe..3c3679edf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.schedule_now_transform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.schedule_now_transform.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newTransformScheduleNowTransformFunc(t Transport) TransformScheduleNowTrans for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type TransformScheduleNowTransformRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r TransformScheduleNowTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r TransformScheduleNowTransformRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "transform.schedule_now_transform") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_transform") + 1 + len(r.TransformID) + 1 + len("_schedule_now")) @@ -75,6 +91,9 @@ func (r TransformScheduleNowTransformRequest) Do(ctx context.Context, transport path.WriteString("_transform") path.WriteString("/") path.WriteString(r.TransformID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "transform_id", r.TransformID) + } path.WriteString("/") path.WriteString("_schedule_now") @@ -102,6 +121,9 @@ func (r TransformScheduleNowTransformRequest) Do(ctx context.Context, transport req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -129,8 +151,17 @@ func (r TransformScheduleNowTransformRequest) Do(ctx context.Context, transport req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "transform.schedule_now_transform") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "transform.schedule_now_transform") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.start_transform.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.start_transform.go index dfca04e28..68ce78a35 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.start_transform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.start_transform.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newTransformStartTransformFunc(t Transport) TransformStartTransform { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -58,16 +63,27 @@ type TransformStartTransformRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r TransformStartTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r TransformStartTransformRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "transform.start_transform") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_transform") + 1 + len(r.TransformID) + 1 + len("_start")) @@ -76,6 +92,9 @@ func (r TransformStartTransformRequest) Do(ctx context.Context, transport Transp path.WriteString("_transform") path.WriteString("/") path.WriteString(r.TransformID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "transform_id", r.TransformID) + } path.WriteString("/") path.WriteString("_start") @@ -107,6 +126,9 @@ func (r TransformStartTransformRequest) Do(ctx context.Context, transport Transp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -134,8 +156,17 @@ func (r TransformStartTransformRequest) Do(ctx context.Context, transport Transp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "transform.start_transform") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "transform.start_transform") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.stop_transform.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.stop_transform.go index 29e3342f1..26a77ae77 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.stop_transform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.stop_transform.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newTransformStopTransformFunc(t Transport) TransformStopTransform { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -62,16 +67,27 @@ type TransformStopTransformRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r TransformStopTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r TransformStopTransformRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "transform.stop_transform") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_transform") + 1 + len(r.TransformID) + 1 + len("_stop")) @@ -80,6 +96,9 @@ func (r TransformStopTransformRequest) Do(ctx context.Context, transport Transpo path.WriteString("_transform") path.WriteString("/") path.WriteString(r.TransformID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "transform_id", r.TransformID) + } path.WriteString("/") path.WriteString("_stop") @@ -123,6 +142,9 @@ func (r TransformStopTransformRequest) Do(ctx context.Context, transport Transpo req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -150,8 +172,17 @@ func (r TransformStopTransformRequest) Do(ctx context.Context, transport Transpo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "transform.stop_transform") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "transform.stop_transform") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.update_transform.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.update_transform.go index e7f0844d2..c6a1a4c49 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.update_transform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.update_transform.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -34,6 +34,11 @@ func newTransformUpdateTransformFunc(t Transport) TransformUpdateTransform { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -62,16 +67,27 @@ type TransformUpdateTransformRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r TransformUpdateTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r TransformUpdateTransformRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "transform.update_transform") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + 1 + len("_transform") + 1 + len(r.TransformID) + 1 + len("_update")) @@ -80,6 +96,9 @@ func (r TransformUpdateTransformRequest) Do(ctx context.Context, transport Trans path.WriteString("_transform") path.WriteString("/") path.WriteString(r.TransformID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "transform_id", r.TransformID) + } path.WriteString("/") path.WriteString("_update") @@ -111,6 +130,9 @@ func (r TransformUpdateTransformRequest) Do(ctx context.Context, transport Trans req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -142,8 +164,20 @@ func (r TransformUpdateTransformRequest) Do(ctx context.Context, transport Trans req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "transform.update_transform") + if reader := instrument.RecordRequestBody(ctx, "transform.update_transform", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "transform.update_transform") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.upgrade_transforms.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.upgrade_transforms.go index d45dbca73..7d10c0dbe 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.upgrade_transforms.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.transform.upgrade_transforms.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newTransformUpgradeTransformsFunc(t Transport) TransformUpgradeTransforms { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type TransformUpgradeTransformsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r TransformUpgradeTransformsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r TransformUpgradeTransformsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "transform.upgrade_transforms") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_transform/_upgrade")) @@ -101,6 +117,9 @@ func (r TransformUpgradeTransformsRequest) Do(ctx context.Context, transport Tra req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -128,8 +147,17 @@ func (r TransformUpgradeTransformsRequest) Do(ctx context.Context, transport Tra req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "transform.upgrade_transforms") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "transform.upgrade_transforms") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.ack_watch.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.ack_watch.go index 015b1cd5a..7ba9d9d23 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.ack_watch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.ack_watch.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newWatcherAckWatchFunc(t Transport) WatcherAckWatch { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type WatcherAckWatchRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r WatcherAckWatchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r WatcherAckWatchRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.ack_watch") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_watcher") + 1 + len("watch") + 1 + len(r.WatchID) + 1 + len("_ack") + 1 + len(strings.Join(r.ActionID, ","))) @@ -75,11 +91,17 @@ func (r WatcherAckWatchRequest) Do(ctx context.Context, transport Transport) (*R path.WriteString("watch") path.WriteString("/") path.WriteString(r.WatchID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "watch_id", r.WatchID) + } path.WriteString("/") path.WriteString("_ack") if len(r.ActionID) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.ActionID, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "action_id", strings.Join(r.ActionID, ",")) + } } params = make(map[string]string) @@ -102,6 +124,9 @@ func (r WatcherAckWatchRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -129,8 +154,17 @@ func (r WatcherAckWatchRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "watcher.ack_watch") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "watcher.ack_watch") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.activate_watch.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.activate_watch.go index 26694d6f6..668baa389 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.activate_watch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.activate_watch.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newWatcherActivateWatchFunc(t Transport) WatcherActivateWatch { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type WatcherActivateWatchRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r WatcherActivateWatchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r WatcherActivateWatchRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.activate_watch") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_watcher") + 1 + len("watch") + 1 + len(r.WatchID) + 1 + len("_activate")) @@ -74,6 +90,9 @@ func (r WatcherActivateWatchRequest) Do(ctx context.Context, transport Transport path.WriteString("watch") path.WriteString("/") path.WriteString(r.WatchID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "watch_id", r.WatchID) + } path.WriteString("/") path.WriteString("_activate") @@ -97,6 +116,9 @@ func (r WatcherActivateWatchRequest) Do(ctx context.Context, transport Transport req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -124,8 +146,17 @@ func (r WatcherActivateWatchRequest) Do(ctx context.Context, transport Transport req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "watcher.activate_watch") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "watcher.activate_watch") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.deactivate_watch.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.deactivate_watch.go index fd34a24b6..1584ebdd5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.deactivate_watch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.deactivate_watch.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newWatcherDeactivateWatchFunc(t Transport) WatcherDeactivateWatch { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type WatcherDeactivateWatchRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r WatcherDeactivateWatchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r WatcherDeactivateWatchRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.deactivate_watch") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_watcher") + 1 + len("watch") + 1 + len(r.WatchID) + 1 + len("_deactivate")) @@ -74,6 +90,9 @@ func (r WatcherDeactivateWatchRequest) Do(ctx context.Context, transport Transpo path.WriteString("watch") path.WriteString("/") path.WriteString(r.WatchID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "watch_id", r.WatchID) + } path.WriteString("/") path.WriteString("_deactivate") @@ -97,6 +116,9 @@ func (r WatcherDeactivateWatchRequest) Do(ctx context.Context, transport Transpo req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -124,8 +146,17 @@ func (r WatcherDeactivateWatchRequest) Do(ctx context.Context, transport Transpo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "watcher.deactivate_watch") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "watcher.deactivate_watch") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.delete_watch.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.delete_watch.go index 36dcc37c2..d60782cff 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.delete_watch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.delete_watch.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newWatcherDeleteWatchFunc(t Transport) WatcherDeleteWatch { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type WatcherDeleteWatchRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r WatcherDeleteWatchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r WatcherDeleteWatchRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.delete_watch") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "DELETE" path.Grow(7 + 1 + len("_watcher") + 1 + len("watch") + 1 + len(r.WatchID)) @@ -74,6 +90,9 @@ func (r WatcherDeleteWatchRequest) Do(ctx context.Context, transport Transport) path.WriteString("watch") path.WriteString("/") path.WriteString(r.WatchID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.WatchID) + } params = make(map[string]string) @@ -95,6 +114,9 @@ func (r WatcherDeleteWatchRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +144,17 @@ func (r WatcherDeleteWatchRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "watcher.delete_watch") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "watcher.delete_watch") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.execute_watch.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.execute_watch.go index 43138c00f..7bf90ed55 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.execute_watch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.execute_watch.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newWatcherExecuteWatchFunc(t Transport) WatcherExecuteWatch { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -60,16 +65,27 @@ type WatcherExecuteWatchRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r WatcherExecuteWatchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r WatcherExecuteWatchRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.execute_watch") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_watcher") + 1 + len("watch") + 1 + len(r.WatchID) + 1 + len("_execute")) @@ -81,6 +97,9 @@ func (r WatcherExecuteWatchRequest) Do(ctx context.Context, transport Transport) if r.WatchID != "" { path.WriteString("/") path.WriteString(r.WatchID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.WatchID) + } } path.WriteString("/") path.WriteString("_execute") @@ -109,6 +128,9 @@ func (r WatcherExecuteWatchRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -140,8 +162,20 @@ func (r WatcherExecuteWatchRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "watcher.execute_watch") + if reader := instrument.RecordRequestBody(ctx, "watcher.execute_watch", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "watcher.execute_watch") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.get_settings.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.get_settings.go index 8844a7f68..1f9891521 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.get_settings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.get_settings.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newWatcherGetSettingsFunc(t Transport) WatcherGetSettings { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type WatcherGetSettingsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r WatcherGetSettingsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r WatcherGetSettingsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.get_settings") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_watcher/settings")) @@ -88,6 +104,9 @@ func (r WatcherGetSettingsRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r WatcherGetSettingsRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "watcher.get_settings") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "watcher.get_settings") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.get_watch.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.get_watch.go index 3592723ae..86d27a25b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.get_watch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.get_watch.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newWatcherGetWatchFunc(t Transport) WatcherGetWatch { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -54,16 +59,27 @@ type WatcherGetWatchRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r WatcherGetWatchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r WatcherGetWatchRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.get_watch") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_watcher") + 1 + len("watch") + 1 + len(r.WatchID)) @@ -74,6 +90,9 @@ func (r WatcherGetWatchRequest) Do(ctx context.Context, transport Transport) (*R path.WriteString("watch") path.WriteString("/") path.WriteString(r.WatchID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.WatchID) + } params = make(map[string]string) @@ -95,6 +114,9 @@ func (r WatcherGetWatchRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +144,17 @@ func (r WatcherGetWatchRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "watcher.get_watch") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "watcher.get_watch") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.put_watch.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.put_watch.go index ae6520eba..44200a723 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.put_watch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.put_watch.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -33,6 +33,11 @@ func newWatcherPutWatchFunc(t Transport) WatcherPutWatch { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -63,16 +68,27 @@ type WatcherPutWatchRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r WatcherPutWatchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r WatcherPutWatchRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.put_watch") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + 1 + len("_watcher") + 1 + len("watch") + 1 + len(r.WatchID)) @@ -83,6 +99,9 @@ func (r WatcherPutWatchRequest) Do(ctx context.Context, transport Transport) (*R path.WriteString("watch") path.WriteString("/") path.WriteString(r.WatchID) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.WatchID) + } params = make(map[string]string) @@ -120,6 +139,9 @@ func (r WatcherPutWatchRequest) Do(ctx context.Context, transport Transport) (*R req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -151,8 +173,20 @@ func (r WatcherPutWatchRequest) Do(ctx context.Context, transport Transport) (*R req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "watcher.put_watch") + if reader := instrument.RecordRequestBody(ctx, "watcher.put_watch", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "watcher.put_watch") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.query_watches.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.query_watches.go index c976dcb59..32cd3e954 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.query_watches.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.query_watches.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newWatcherQueryWatchesFunc(t Transport) WatcherQueryWatches { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type WatcherQueryWatchesRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r WatcherQueryWatchesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r WatcherQueryWatchesRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.query_watches") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_watcher/_query/watches")) @@ -91,6 +107,9 @@ func (r WatcherQueryWatchesRequest) Do(ctx context.Context, transport Transport) req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +141,20 @@ func (r WatcherQueryWatchesRequest) Do(ctx context.Context, transport Transport) req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "watcher.query_watches") + if reader := instrument.RecordRequestBody(ctx, "watcher.query_watches", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "watcher.query_watches") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.start.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.start.go index f68786e9b..fc3becf59 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.start.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.start.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newWatcherStartFunc(t Transport) WatcherStart { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type WatcherStartRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r WatcherStartRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r WatcherStartRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.start") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_watcher/_start")) @@ -88,6 +104,9 @@ func (r WatcherStartRequest) Do(ctx context.Context, transport Transport) (*Resp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r WatcherStartRequest) Do(ctx context.Context, transport Transport) (*Resp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "watcher.start") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "watcher.start") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.stats.go index 9c17b89c1..f17e4f77d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.stats.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newWatcherStatsFunc(t Transport) WatcherStats { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -57,16 +62,27 @@ type WatcherStatsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r WatcherStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r WatcherStatsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + 1 + len("_watcher") + 1 + len("stats") + 1 + len(strings.Join(r.Metric, ","))) @@ -78,6 +94,9 @@ func (r WatcherStatsRequest) Do(ctx context.Context, transport Transport) (*Resp if len(r.Metric) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Metric, ",")) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordPathPart(ctx, "metric", strings.Join(r.Metric, ",")) + } } params = make(map[string]string) @@ -108,6 +127,9 @@ func (r WatcherStatsRequest) Do(ctx context.Context, transport Transport) (*Resp req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -135,8 +157,17 @@ func (r WatcherStatsRequest) Do(ctx context.Context, transport Transport) (*Resp req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "watcher.stats") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "watcher.stats") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.stop.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.stop.go index 4a8859fb3..10c878e7c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.stop.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.stop.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -31,6 +31,11 @@ func newWatcherStopFunc(t Transport) WatcherStop { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -52,16 +57,27 @@ type WatcherStopRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r WatcherStopRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r WatcherStopRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.stop") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "POST" path.Grow(7 + len("/_watcher/_stop")) @@ -88,6 +104,9 @@ func (r WatcherStopRequest) Do(ctx context.Context, transport Transport) (*Respo req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -115,8 +134,17 @@ func (r WatcherStopRequest) Do(ctx context.Context, transport Transport) (*Respo req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "watcher.stop") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "watcher.stop") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.update_settings.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.update_settings.go index 829b46489..ee48817ed 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.update_settings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.watcher.update_settings.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newWatcherUpdateSettingsFunc(t Transport) WatcherUpdateSettings { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type WatcherUpdateSettingsRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r WatcherUpdateSettingsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r WatcherUpdateSettingsRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.update_settings") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "PUT" path.Grow(7 + len("/_watcher/settings")) @@ -91,6 +107,9 @@ func (r WatcherUpdateSettingsRequest) Do(ctx context.Context, transport Transpor req, err := newRequest(method, path.String(), r.Body) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +141,20 @@ func (r WatcherUpdateSettingsRequest) Do(ctx context.Context, transport Transpor req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "watcher.update_settings") + if reader := instrument.RecordRequestBody(ctx, "watcher.update_settings", r.Body); reader != nil { + req.Body = reader + } + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "watcher.update_settings") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.xpack.info.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.xpack.info.go index b6f8b7411..489bec474 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.xpack.info.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.xpack.info.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newXPackInfoFunc(t Transport) XPackInfo { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -56,16 +61,27 @@ type XPackInfoRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r XPackInfoRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r XPackInfoRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "xpack.info") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_xpack")) @@ -100,6 +116,9 @@ func (r XPackInfoRequest) Do(ctx context.Context, transport Transport) (*Respons req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -127,8 +146,17 @@ func (r XPackInfoRequest) Do(ctx context.Context, transport Transport) (*Respons req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "xpack.info") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "xpack.info") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.xpack.usage.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.xpack.usage.go index bd3d8b74d..da299c36a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.xpack.usage.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/api.xpack.xpack.usage.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 8.11.0: DO NOT EDIT +// Code generated from specification version 8.12.0: DO NOT EDIT package esapi @@ -32,6 +32,11 @@ func newXPackUsageFunc(t Transport) XPackUsage { for _, f := range o { f(&r) } + + if transport, ok := t.(Instrumented); ok { + r.instrument = transport.InstrumentationEnabled() + } + return r.Do(r.ctx, t) } } @@ -55,16 +60,27 @@ type XPackUsageRequest struct { Header http.Header ctx context.Context + + instrument Instrumentation } // Do executes the request and returns response or error. -func (r XPackUsageRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r XPackUsageRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder params map[string]string + ctx context.Context ) + if instrument, ok := r.instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "xpack.usage") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + method = "GET" path.Grow(7 + len("/_xpack/usage")) @@ -95,6 +111,9 @@ func (r XPackUsageRequest) Do(ctx context.Context, transport Transport) (*Respon req, err := newRequest(method, path.String(), nil) if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -122,8 +141,17 @@ func (r XPackUsageRequest) Do(ctx context.Context, transport Transport) (*Respon req = req.WithContext(ctx) } + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "xpack.usage") + } res, err := transport.Perform(req) + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "xpack.usage") + } if err != nil { + if instrument, ok := r.instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/esapi.go b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/esapi.go index 0f33040ad..12e39bb36 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/esapi/esapi.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/esapi/esapi.go @@ -22,25 +22,29 @@ import ( "strconv" "time" + "github.com/elastic/elastic-transport-go/v8/elastictransport" "github.com/elastic/go-elasticsearch/v8/internal/version" ) // Version returns the package version as a string. -// const Version = version.Client // Transport defines the interface for an API client. -// type Transport interface { Perform(*http.Request) (*http.Response, error) } +// Instrumented allows to retrieve the current transport Instrumentation +type Instrumented elastictransport.Instrumented + +// Instrumentation defines the interface for the instrumentation API. +type Instrumentation elastictransport.Instrumentation + // BoolPtr returns a pointer to v. // // It is used as a convenience function for converting a bool value // into a pointer when passing the value to a function or struct field // which expects a pointer. -// func BoolPtr(v bool) *bool { return &v } // IntPtr returns a pointer to v. @@ -48,12 +52,10 @@ func BoolPtr(v bool) *bool { return &v } // It is used as a convenience function for converting an int value // into a pointer when passing the value to a function or struct field // which expects a pointer. -// func IntPtr(v int) *int { return &v } // formatDuration converts duration to a string in the format // accepted by Elasticsearch. -// func formatDuration(d time.Duration) string { if d < time.Millisecond { return strconv.FormatInt(int64(d), 10) + "nanos" diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/internal/version/version.go b/vendor/github.com/elastic/go-elasticsearch/v8/internal/version/version.go index 9c200393e..c50f24b88 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/internal/version/version.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/internal/version/version.go @@ -18,4 +18,4 @@ package version // Client returns the client version as a string. -const Client = "8.11.1" +const Client = "8.12.0" diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/api._.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/api._.go index a0acf5c58..201267890 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/api._.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/api._.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package typedapi @@ -141,10 +141,12 @@ import ( eql_get "github.com/elastic/go-elasticsearch/v8/typedapi/eql/get" eql_get_status "github.com/elastic/go-elasticsearch/v8/typedapi/eql/getstatus" eql_search "github.com/elastic/go-elasticsearch/v8/typedapi/eql/search" + esql_query "github.com/elastic/go-elasticsearch/v8/typedapi/esql/query" features_get_features "github.com/elastic/go-elasticsearch/v8/typedapi/features/getfeatures" features_reset_features "github.com/elastic/go-elasticsearch/v8/typedapi/features/resetfeatures" fleet_global_checkpoints "github.com/elastic/go-elasticsearch/v8/typedapi/fleet/globalcheckpoints" fleet_msearch "github.com/elastic/go-elasticsearch/v8/typedapi/fleet/msearch" + fleet_post_secret "github.com/elastic/go-elasticsearch/v8/typedapi/fleet/postsecret" fleet_search "github.com/elastic/go-elasticsearch/v8/typedapi/fleet/search" graph_explore "github.com/elastic/go-elasticsearch/v8/typedapi/graph/explore" ilm_delete_lifecycle "github.com/elastic/go-elasticsearch/v8/typedapi/ilm/deletelifecycle" @@ -216,6 +218,10 @@ import ( indices_unfreeze "github.com/elastic/go-elasticsearch/v8/typedapi/indices/unfreeze" indices_update_aliases "github.com/elastic/go-elasticsearch/v8/typedapi/indices/updatealiases" indices_validate_query "github.com/elastic/go-elasticsearch/v8/typedapi/indices/validatequery" + inference_delete_model "github.com/elastic/go-elasticsearch/v8/typedapi/inference/deletemodel" + inference_get_model "github.com/elastic/go-elasticsearch/v8/typedapi/inference/getmodel" + inference_inference "github.com/elastic/go-elasticsearch/v8/typedapi/inference/inference" + inference_put_model "github.com/elastic/go-elasticsearch/v8/typedapi/inference/putmodel" ingest_delete_pipeline "github.com/elastic/go-elasticsearch/v8/typedapi/ingest/deletepipeline" ingest_geo_ip_stats "github.com/elastic/go-elasticsearch/v8/typedapi/ingest/geoipstats" ingest_get_pipeline "github.com/elastic/go-elasticsearch/v8/typedapi/ingest/getpipeline" @@ -369,6 +375,7 @@ import ( security_get_role_mapping "github.com/elastic/go-elasticsearch/v8/typedapi/security/getrolemapping" security_get_service_accounts "github.com/elastic/go-elasticsearch/v8/typedapi/security/getserviceaccounts" security_get_service_credentials "github.com/elastic/go-elasticsearch/v8/typedapi/security/getservicecredentials" + security_get_settings "github.com/elastic/go-elasticsearch/v8/typedapi/security/getsettings" security_get_token "github.com/elastic/go-elasticsearch/v8/typedapi/security/gettoken" security_get_user "github.com/elastic/go-elasticsearch/v8/typedapi/security/getuser" security_get_user_privileges "github.com/elastic/go-elasticsearch/v8/typedapi/security/getuserprivileges" @@ -394,6 +401,7 @@ import ( security_saml_service_provider_metadata "github.com/elastic/go-elasticsearch/v8/typedapi/security/samlserviceprovidermetadata" security_suggest_user_profiles "github.com/elastic/go-elasticsearch/v8/typedapi/security/suggestuserprofiles" security_update_api_key "github.com/elastic/go-elasticsearch/v8/typedapi/security/updateapikey" + security_update_settings "github.com/elastic/go-elasticsearch/v8/typedapi/security/updatesettings" security_update_user_profile_data "github.com/elastic/go-elasticsearch/v8/typedapi/security/updateuserprofiledata" shutdown_delete_node "github.com/elastic/go-elasticsearch/v8/typedapi/shutdown/deletenode" shutdown_get_node "github.com/elastic/go-elasticsearch/v8/typedapi/shutdown/getnode" @@ -897,6 +905,12 @@ type Eql struct { Search eql_search.NewSearch } +type Esql struct { + // Executes an ESQL request + // https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-rest.html + Query esql_query.NewQuery +} + type Features struct { // Gets a list of features which can be included in snapshots using the // feature_states field when creating a snapshot @@ -917,6 +931,9 @@ type Fleet struct { // use by the fleet server project. // Msearch fleet_msearch.NewMsearch + // Creates a secret stored by Fleet. + // + PostSecret fleet_post_secret.NewPostSecret // Search API where the search will only be executed after specified checkpoints // are available due to a refresh. This API is designed for internal use by the // fleet server project. @@ -1011,10 +1028,10 @@ type Indices struct { // https://www.elastic.co/guide/en/elasticsearch/reference/current/data-streams.html DeleteDataStream indices_delete_data_stream.NewDeleteDataStream // Deletes an index template. - // https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html + // https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-template.html DeleteIndexTemplate indices_delete_index_template.NewDeleteIndexTemplate // Deletes an index template. - // https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html + // https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-template-v1.html DeleteTemplate indices_delete_template.NewDeleteTemplate // Analyzes the disk usage of each field of an index or data stream // https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-disk-usage.html @@ -1029,10 +1046,10 @@ type Indices struct { // https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html ExistsAlias indices_exists_alias.NewExistsAlias // Returns information about whether a particular index template exists. - // https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html + // https://www.elastic.co/guide/en/elasticsearch/reference/current/index-templates.html ExistsIndexTemplate indices_exists_index_template.NewExistsIndexTemplate // Returns information about whether a particular index template exists. - // https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html + // https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-template-exists-v1.html ExistsTemplate indices_exists_template.NewExistsTemplate // Retrieves information about the index's current data stream lifecycle, such // as any potential encountered error, time since creation etc. @@ -1063,7 +1080,7 @@ type Indices struct { // https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-field-mapping.html GetFieldMapping indices_get_field_mapping.NewGetFieldMapping // Returns an index template. - // https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html + // https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-template.html GetIndexTemplate indices_get_index_template.NewGetIndexTemplate // Returns mappings for one or more indices. // https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-mapping.html @@ -1072,7 +1089,7 @@ type Indices struct { // https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-settings.html GetSettings indices_get_settings.NewGetSettings // Returns an index template. - // https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html + // https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-template-v1.html GetTemplate indices_get_template.NewGetTemplate // Migrates an alias to a data stream // https://www.elastic.co/guide/en/elasticsearch/reference/current/data-streams.html @@ -1094,7 +1111,7 @@ type Indices struct { // https://www.elastic.co/guide/en/elasticsearch/reference/current/data-streams-put-lifecycle.html PutDataLifecycle indices_put_data_lifecycle.NewPutDataLifecycle // Creates or updates an index template. - // https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html + // https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-template.html PutIndexTemplate indices_put_index_template.NewPutIndexTemplate // Updates the index mappings. // https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html @@ -1103,7 +1120,7 @@ type Indices struct { // https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-update-settings.html PutSettings indices_put_settings.NewPutSettings // Creates or updates an index template. - // https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html + // https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates-v1.html PutTemplate indices_put_template.NewPutTemplate // Returns information about ongoing index shard recoveries. // https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-recovery.html @@ -1132,10 +1149,10 @@ type Indices struct { Shrink indices_shrink.NewShrink // Simulate matching the given index name against the index templates in the // system - // https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html + // https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-simulate-index.html SimulateIndexTemplate indices_simulate_index_template.NewSimulateIndexTemplate // Simulate resolving the given template name or body - // https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html + // https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-simulate-template.html SimulateTemplate indices_simulate_template.NewSimulateTemplate // Allows you to split an existing index into a new index with more primary // shards. @@ -1156,6 +1173,21 @@ type Indices struct { ValidateQuery indices_validate_query.NewValidateQuery } +type Inference struct { + // Delete model in the Inference API + // https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-inference-api.html + DeleteModel inference_delete_model.NewDeleteModel + // Get a model in the Inference API + // https://www.elastic.co/guide/en/elasticsearch/reference/current/get-inference-api.html + GetModel inference_get_model.NewGetModel + // Perform inference on a model + // https://www.elastic.co/guide/en/elasticsearch/reference/current/post-inference-api.html + Inference inference_inference.NewInference + // Configure a model for use in the Inference API + // https://www.elastic.co/guide/en/elasticsearch/reference/current/put-inference-api.html + PutModel inference_put_model.NewPutModel +} + type Ingest struct { // Deletes a pipeline. // https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-pipeline-api.html @@ -1530,7 +1562,7 @@ type Rollup struct { type SearchApplication struct { // Deletes a search application. - // https://www.elastic.co/guide/en/elasticsearch/reference/current/put-search-application.html + // https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-search-application.html Delete search_application_delete.NewDelete // Delete a behavioral analytics collection. // https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-analytics-collection.html @@ -1666,6 +1698,9 @@ type Security struct { // Retrieves information of all service credentials for a service account. // https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-service-credentials.html GetServiceCredentials security_get_service_credentials.NewGetServiceCredentials + // Retrieve settings for the security system indices + // https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-settings.html + GetSettings security_get_settings.NewGetSettings // Creates a bearer token for access without requiring basic authentication. // https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html GetToken security_get_token.NewGetToken @@ -1747,6 +1782,9 @@ type Security struct { // Updates attributes of an existing API key. // https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-api-key.html UpdateApiKey security_update_api_key.NewUpdateApiKey + // Update settings for the security system index + // https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-settings.html + UpdateSettings security_update_settings.NewUpdateSettings // Update application specific data for the user profile of the given unique ID. // https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-user-profile-data.html UpdateUserProfileData security_update_user_profile_data.NewUpdateUserProfileData @@ -2011,11 +2049,13 @@ type API struct { DanglingIndices DanglingIndices Enrich Enrich Eql Eql + Esql Esql Features Features Fleet Fleet Graph Graph Ilm Ilm Indices Indices + Inference Inference Ingest Ingest License License Logstash Logstash @@ -2350,6 +2390,11 @@ func New(tp elastictransport.Interface) *API { Search: eql_search.NewSearchFunc(tp), }, + // Esql + Esql: Esql{ + Query: esql_query.NewQueryFunc(tp), + }, + // Features Features: Features{ GetFeatures: features_get_features.NewGetFeaturesFunc(tp), @@ -2360,6 +2405,7 @@ func New(tp elastictransport.Interface) *API { Fleet: Fleet{ GlobalCheckpoints: fleet_global_checkpoints.NewGlobalCheckpointsFunc(tp), Msearch: fleet_msearch.NewMsearchFunc(tp), + PostSecret: fleet_post_secret.NewPostSecretFunc(tp), Search: fleet_search.NewSearchFunc(tp), }, @@ -2445,6 +2491,14 @@ func New(tp elastictransport.Interface) *API { ValidateQuery: indices_validate_query.NewValidateQueryFunc(tp), }, + // Inference + Inference: Inference{ + DeleteModel: inference_delete_model.NewDeleteModelFunc(tp), + GetModel: inference_get_model.NewGetModelFunc(tp), + Inference: inference_inference.NewInferenceFunc(tp), + PutModel: inference_put_model.NewPutModelFunc(tp), + }, + // Ingest Ingest: Ingest{ DeletePipeline: ingest_delete_pipeline.NewDeletePipelineFunc(tp), @@ -2644,6 +2698,7 @@ func New(tp elastictransport.Interface) *API { GetRoleMapping: security_get_role_mapping.NewGetRoleMappingFunc(tp), GetServiceAccounts: security_get_service_accounts.NewGetServiceAccountsFunc(tp), GetServiceCredentials: security_get_service_credentials.NewGetServiceCredentialsFunc(tp), + GetSettings: security_get_settings.NewGetSettingsFunc(tp), GetToken: security_get_token.NewGetTokenFunc(tp), GetUser: security_get_user.NewGetUserFunc(tp), GetUserPrivileges: security_get_user_privileges.NewGetUserPrivilegesFunc(tp), @@ -2669,6 +2724,7 @@ func New(tp elastictransport.Interface) *API { SamlServiceProviderMetadata: security_saml_service_provider_metadata.NewSamlServiceProviderMetadataFunc(tp), SuggestUserProfiles: security_suggest_user_profiles.NewSuggestUserProfilesFunc(tp), UpdateApiKey: security_update_api_key.NewUpdateApiKeyFunc(tp), + UpdateSettings: security_update_settings.NewUpdateSettingsFunc(tp), UpdateUserProfileData: security_update_user_profile_data.NewUpdateUserProfileDataFunc(tp), }, diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/delete/delete.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/delete/delete.go index 6872d05d6..2c965cc59 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/delete/delete.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/delete/delete.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes an async search by ID. If the search is still running, the search // request will be cancelled. Otherwise, the saved search results are deleted. package delete import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type Delete struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDelete type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *Delete { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *Delete) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_async_search") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodDelete @@ -119,9 +130,9 @@ func (r *Delete) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -138,27 +149,66 @@ func (r *Delete) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Delete) Perform(ctx context.Context) (*http.Response, error) { +func (r Delete) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "async_search.delete") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "async_search.delete") + if reader := instrument.RecordRequestBody(ctx, "async_search.delete", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "async_search.delete") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Delete query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Delete query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a delete.Response -func (r Delete) Do(ctx context.Context) (*Response, error) { +func (r Delete) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "async_search.delete") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -166,6 +216,9 @@ func (r Delete) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,6 +228,9 @@ func (r Delete) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,12 +238,25 @@ func (r Delete) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Delete) IsSuccess(ctx context.Context) (bool, error) { +func (r Delete) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "async_search.delete") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -203,6 +272,14 @@ func (r Delete) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Delete query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/delete/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/delete/response.go index dc4c35d47..f8522efb5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/delete/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/delete/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package delete // Response holds the response body struct for the package delete // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/async_search/delete/AsyncSearchDeleteResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/async_search/delete/AsyncSearchDeleteResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/get/get.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/get/get.go index dc426816d..c6f508542 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/get/get.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/get/get.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves the results of a previously submitted async search request given // its ID. package get import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,11 +52,15 @@ type Get struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGet type alias for index. @@ -84,7 +87,12 @@ func New(tp elastictransport.Interface) *Get { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -107,6 +115,9 @@ func (r *Get) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_async_search") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodGet @@ -120,9 +131,9 @@ func (r *Get) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -139,22 +150,58 @@ func (r *Get) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Get) Perform(ctx context.Context) (*http.Response, error) { +func (r Get) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "async_search.get") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "async_search.get") + if reader := instrument.RecordRequestBody(ctx, "async_search.get", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "async_search.get") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Get query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Get query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a get.Response -func (r Get) Do(ctx context.Context) (*Response, error) { +func (r Get) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "async_search.get") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() @@ -162,6 +209,9 @@ func (r Get) Do(ctx context.Context) (*Response, error) { res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -169,6 +219,9 @@ func (r Get) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -178,6 +231,9 @@ func (r Get) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -185,12 +241,25 @@ func (r Get) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Get) IsSuccess(ctx context.Context) (bool, error) { +func (r Get) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "async_search.get") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -206,6 +275,14 @@ func (r Get) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Get query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/get/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/get/response.go index 19023961d..642404427 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/get/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/get/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package get @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package get // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/async_search/get/AsyncSearchGetResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/async_search/get/AsyncSearchGetResponse.ts#L22-L24 type Response struct { // CompletionTime Indicates when the async search completed. Only present diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/status/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/status/response.go index b48ac9a42..8cb4778dd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/status/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/status/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package status @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package status // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/async_search/status/AsyncSearchStatusResponse.ts#L39-L41 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/async_search/status/AsyncSearchStatusResponse.ts#L39-L41 type Response struct { // Clusters_ Metadata about clusters involved in the cross-cluster search. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/status/status.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/status/status.go index de0055eca..de1620140 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/status/status.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/status/status.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves the status of a previously submitted async search request given its // ID. package status import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type Status struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewStatus type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *Status { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,6 +116,9 @@ func (r *Status) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("status") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodGet @@ -121,9 +132,9 @@ func (r *Status) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -140,27 +151,66 @@ func (r *Status) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Status) Perform(ctx context.Context) (*http.Response, error) { +func (r Status) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "async_search.status") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "async_search.status") + if reader := instrument.RecordRequestBody(ctx, "async_search.status", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "async_search.status") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Status query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Status query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a status.Response -func (r Status) Do(ctx context.Context) (*Response, error) { +func (r Status) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "async_search.status") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -168,6 +218,9 @@ func (r Status) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -177,6 +230,9 @@ func (r Status) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,12 +240,25 @@ func (r Status) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Status) IsSuccess(ctx context.Context) (bool, error) { +func (r Status) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "async_search.status") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -205,6 +274,14 @@ func (r Status) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Status query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/submit/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/submit/request.go index b825b7b5d..adb32b4b2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/submit/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/submit/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package submit @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package submit // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/async_search/submit/AsyncSearchSubmitRequest.ts#L55-L286 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/async_search/submit/AsyncSearchSubmitRequest.ts#L55-L286 type Request struct { Aggregations map[string]types.Aggregations `json:"aggregations,omitempty"` Collapse *types.FieldCollapse `json:"collapse,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/submit/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/submit/response.go index 6c010bb72..d5538b80c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/submit/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/submit/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package submit @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package submit // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/async_search/submit/AsyncSearchSubmitResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/async_search/submit/AsyncSearchSubmitResponse.ts#L22-L24 type Response struct { // CompletionTime Indicates when the async search completed. Only present diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/submit/submit.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/submit/submit.go index 7e7d873da..2c4ca4c4a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/submit/submit.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/asyncsearch/submit/submit.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Executes a search request asynchronously. package submit @@ -55,15 +55,19 @@ type Submit struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewSubmit type alias for index. @@ -87,11 +91,18 @@ func New(tp elastictransport.Interface) *Submit { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -128,9 +139,7 @@ func (r *Submit) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -142,6 +151,10 @@ func (r *Submit) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -153,6 +166,9 @@ func (r *Submit) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_async_search") @@ -168,15 +184,15 @@ func (r *Submit) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -193,22 +209,58 @@ func (r *Submit) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Submit) Perform(ctx context.Context) (*http.Response, error) { +func (r Submit) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "async_search.submit") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "async_search.submit") + if reader := instrument.RecordRequestBody(ctx, "async_search.submit", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "async_search.submit") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Submit query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Submit query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a submit.Response -func (r Submit) Do(ctx context.Context) (*Response, error) { +func (r Submit) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "async_search.submit") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() @@ -216,6 +268,9 @@ func (r Submit) Do(ctx context.Context) (*Response, error) { res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -223,6 +278,9 @@ func (r Submit) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -232,6 +290,9 @@ func (r Submit) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -239,6 +300,9 @@ func (r Submit) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/deleteautoscalingpolicy/delete_autoscaling_policy.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/deleteautoscalingpolicy/delete_autoscaling_policy.go index 6a2b9bab8..90b0b2af5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/deleteautoscalingpolicy/delete_autoscaling_policy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/deleteautoscalingpolicy/delete_autoscaling_policy.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. // Direct use is not supported. package deleteautoscalingpolicy import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type DeleteAutoscalingPolicy struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteAutoscalingPolicy type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *DeleteAutoscalingPolicy { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,6 +116,9 @@ func (r *DeleteAutoscalingPolicy) HttpRequest(ctx context.Context) (*http.Reques path.WriteString("policy") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodDelete @@ -121,9 +132,9 @@ func (r *DeleteAutoscalingPolicy) HttpRequest(ctx context.Context) (*http.Reques } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -140,27 +151,66 @@ func (r *DeleteAutoscalingPolicy) HttpRequest(ctx context.Context) (*http.Reques } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteAutoscalingPolicy) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteAutoscalingPolicy) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "autoscaling.delete_autoscaling_policy") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "autoscaling.delete_autoscaling_policy") + if reader := instrument.RecordRequestBody(ctx, "autoscaling.delete_autoscaling_policy", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "autoscaling.delete_autoscaling_policy") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteAutoscalingPolicy query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteAutoscalingPolicy query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deleteautoscalingpolicy.Response -func (r DeleteAutoscalingPolicy) Do(ctx context.Context) (*Response, error) { +func (r DeleteAutoscalingPolicy) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "autoscaling.delete_autoscaling_policy") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -168,6 +218,9 @@ func (r DeleteAutoscalingPolicy) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -177,6 +230,9 @@ func (r DeleteAutoscalingPolicy) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,12 +240,25 @@ func (r DeleteAutoscalingPolicy) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteAutoscalingPolicy) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteAutoscalingPolicy) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "autoscaling.delete_autoscaling_policy") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -205,6 +274,14 @@ func (r DeleteAutoscalingPolicy) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteAutoscalingPolicy query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/deleteautoscalingpolicy/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/deleteautoscalingpolicy/response.go index 212797e50..e9a22924f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/deleteautoscalingpolicy/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/deleteautoscalingpolicy/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deleteautoscalingpolicy // Response holds the response body struct for the package deleteautoscalingpolicy // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/autoscaling/delete_autoscaling_policy/DeleteAutoscalingPolicyResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/autoscaling/delete_autoscaling_policy/DeleteAutoscalingPolicyResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/getautoscalingcapacity/get_autoscaling_capacity.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/getautoscalingcapacity/get_autoscaling_capacity.go index 7d8213899..265e2816d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/getautoscalingcapacity/get_autoscaling_capacity.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/getautoscalingcapacity/get_autoscaling_capacity.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Gets the current autoscaling capacity based on the configured autoscaling // policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not @@ -24,7 +24,6 @@ package getautoscalingcapacity import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -49,9 +48,13 @@ type GetAutoscalingCapacity struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetAutoscalingCapacity type alias for index. @@ -77,7 +80,12 @@ func New(tp elastictransport.Interface) *GetAutoscalingCapacity { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -112,9 +120,9 @@ func (r *GetAutoscalingCapacity) HttpRequest(ctx context.Context) (*http.Request } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -131,27 +139,66 @@ func (r *GetAutoscalingCapacity) HttpRequest(ctx context.Context) (*http.Request } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetAutoscalingCapacity) Perform(ctx context.Context) (*http.Response, error) { +func (r GetAutoscalingCapacity) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "autoscaling.get_autoscaling_capacity") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "autoscaling.get_autoscaling_capacity") + if reader := instrument.RecordRequestBody(ctx, "autoscaling.get_autoscaling_capacity", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "autoscaling.get_autoscaling_capacity") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetAutoscalingCapacity query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetAutoscalingCapacity query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getautoscalingcapacity.Response -func (r GetAutoscalingCapacity) Do(ctx context.Context) (*Response, error) { +func (r GetAutoscalingCapacity) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "autoscaling.get_autoscaling_capacity") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -159,6 +206,9 @@ func (r GetAutoscalingCapacity) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -168,6 +218,9 @@ func (r GetAutoscalingCapacity) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,12 +228,25 @@ func (r GetAutoscalingCapacity) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetAutoscalingCapacity) IsSuccess(ctx context.Context) (bool, error) { +func (r GetAutoscalingCapacity) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "autoscaling.get_autoscaling_capacity") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -196,6 +262,14 @@ func (r GetAutoscalingCapacity) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetAutoscalingCapacity query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/getautoscalingcapacity/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/getautoscalingcapacity/response.go index e55697ca6..d8e9dc4d0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/getautoscalingcapacity/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/getautoscalingcapacity/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getautoscalingcapacity @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getautoscalingcapacity // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/autoscaling/get_autoscaling_capacity/GetAutoscalingCapacityResponse.ts#L25-L29 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/autoscaling/get_autoscaling_capacity/GetAutoscalingCapacityResponse.ts#L25-L29 type Response struct { Policies map[string]types.AutoscalingDeciders `json:"policies"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/getautoscalingpolicy/get_autoscaling_policy.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/getautoscalingpolicy/get_autoscaling_policy.go index db66d0af0..2b847defd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/getautoscalingpolicy/get_autoscaling_policy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/getautoscalingpolicy/get_autoscaling_policy.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves an autoscaling policy. Designed for indirect use by ECE/ESS and // ECK. Direct use is not supported. package getautoscalingpolicy import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type GetAutoscalingPolicy struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetAutoscalingPolicy type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *GetAutoscalingPolicy { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,6 +116,9 @@ func (r *GetAutoscalingPolicy) HttpRequest(ctx context.Context) (*http.Request, path.WriteString("policy") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodGet @@ -121,9 +132,9 @@ func (r *GetAutoscalingPolicy) HttpRequest(ctx context.Context) (*http.Request, } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -140,27 +151,66 @@ func (r *GetAutoscalingPolicy) HttpRequest(ctx context.Context) (*http.Request, } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetAutoscalingPolicy) Perform(ctx context.Context) (*http.Response, error) { +func (r GetAutoscalingPolicy) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "autoscaling.get_autoscaling_policy") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "autoscaling.get_autoscaling_policy") + if reader := instrument.RecordRequestBody(ctx, "autoscaling.get_autoscaling_policy", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "autoscaling.get_autoscaling_policy") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetAutoscalingPolicy query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetAutoscalingPolicy query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getautoscalingpolicy.Response -func (r GetAutoscalingPolicy) Do(ctx context.Context) (*Response, error) { +func (r GetAutoscalingPolicy) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "autoscaling.get_autoscaling_policy") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -168,6 +218,9 @@ func (r GetAutoscalingPolicy) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -177,6 +230,9 @@ func (r GetAutoscalingPolicy) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,12 +240,25 @@ func (r GetAutoscalingPolicy) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetAutoscalingPolicy) IsSuccess(ctx context.Context) (bool, error) { +func (r GetAutoscalingPolicy) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "autoscaling.get_autoscaling_policy") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -205,6 +274,14 @@ func (r GetAutoscalingPolicy) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetAutoscalingPolicy query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/getautoscalingpolicy/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/getautoscalingpolicy/response.go index fdc861c13..90d53ec7c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/getautoscalingpolicy/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/getautoscalingpolicy/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getautoscalingpolicy @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getautoscalingpolicy // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/autoscaling/get_autoscaling_policy/GetAutoscalingPolicyResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/autoscaling/get_autoscaling_policy/GetAutoscalingPolicyResponse.ts#L22-L24 type Response struct { // Deciders Decider settings diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/putautoscalingpolicy/put_autoscaling_policy.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/putautoscalingpolicy/put_autoscaling_policy.go index b1452e21e..04cac978f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/putautoscalingpolicy/put_autoscaling_policy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/putautoscalingpolicy/put_autoscaling_policy.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates a new autoscaling policy. Designed for indirect use by ECE/ESS and // ECK. Direct use is not supported. @@ -51,15 +51,19 @@ type PutAutoscalingPolicy struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutAutoscalingPolicy type alias for index. @@ -86,7 +90,14 @@ func New(tp elastictransport.Interface) *PutAutoscalingPolicy { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -125,9 +136,7 @@ func (r *PutAutoscalingPolicy) HttpRequest(ctx context.Context) (*http.Request, } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -139,6 +148,10 @@ func (r *PutAutoscalingPolicy) HttpRequest(ctx context.Context) (*http.Request, } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -149,6 +162,9 @@ func (r *PutAutoscalingPolicy) HttpRequest(ctx context.Context) (*http.Request, path.WriteString("policy") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodPut @@ -162,15 +178,15 @@ func (r *PutAutoscalingPolicy) HttpRequest(ctx context.Context) (*http.Request, } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -187,27 +203,66 @@ func (r *PutAutoscalingPolicy) HttpRequest(ctx context.Context) (*http.Request, } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutAutoscalingPolicy) Perform(ctx context.Context) (*http.Response, error) { +func (r PutAutoscalingPolicy) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "autoscaling.put_autoscaling_policy") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "autoscaling.put_autoscaling_policy") + if reader := instrument.RecordRequestBody(ctx, "autoscaling.put_autoscaling_policy", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "autoscaling.put_autoscaling_policy") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutAutoscalingPolicy query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutAutoscalingPolicy query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a putautoscalingpolicy.Response -func (r PutAutoscalingPolicy) Do(ctx context.Context) (*Response, error) { +func (r PutAutoscalingPolicy) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "autoscaling.put_autoscaling_policy") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -215,6 +270,9 @@ func (r PutAutoscalingPolicy) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -224,6 +282,9 @@ func (r PutAutoscalingPolicy) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -231,6 +292,9 @@ func (r PutAutoscalingPolicy) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/putautoscalingpolicy/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/putautoscalingpolicy/request.go index 3863599da..921e53730 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/putautoscalingpolicy/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/putautoscalingpolicy/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putautoscalingpolicy @@ -26,5 +26,5 @@ import ( // Request holds the request body struct for the package putautoscalingpolicy // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/autoscaling/put_autoscaling_policy/PutAutoscalingPolicyRequest.ts#L24-L35 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/autoscaling/put_autoscaling_policy/PutAutoscalingPolicyRequest.ts#L24-L35 type Request = types.AutoscalingPolicy diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/putautoscalingpolicy/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/putautoscalingpolicy/response.go index 2eb485ef0..a7dea211b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/putautoscalingpolicy/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/autoscaling/putautoscalingpolicy/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putautoscalingpolicy // Response holds the response body struct for the package putautoscalingpolicy // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/autoscaling/put_autoscaling_policy/PutAutoscalingPolicyResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/autoscaling/put_autoscaling_policy/PutAutoscalingPolicyResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/aliases/aliases.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/aliases/aliases.go index 82b1f5170..bc30d5eb3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/aliases/aliases.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/aliases/aliases.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Shows information about currently configured aliases to indices including // filter and routing infos. package aliases import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,11 +52,15 @@ type Aliases struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewAliases type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *Aliases { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -114,6 +122,9 @@ func (r *Aliases) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("aliases") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodGet @@ -127,9 +138,9 @@ func (r *Aliases) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -146,27 +157,66 @@ func (r *Aliases) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Aliases) Perform(ctx context.Context) (*http.Response, error) { +func (r Aliases) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cat.aliases") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cat.aliases") + if reader := instrument.RecordRequestBody(ctx, "cat.aliases", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.aliases") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Aliases query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Aliases query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a aliases.Response -func (r Aliases) Do(ctx context.Context) (Response, error) { +func (r Aliases) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.aliases") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -174,6 +224,9 @@ func (r Aliases) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -183,6 +236,9 @@ func (r Aliases) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -190,12 +246,25 @@ func (r Aliases) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Aliases) IsSuccess(ctx context.Context) (bool, error) { +func (r Aliases) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.aliases") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -211,6 +280,14 @@ func (r Aliases) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Aliases query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/aliases/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/aliases/response.go index 39b5e85ce..b274bdfe3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/aliases/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/aliases/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package aliases @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package aliases // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/aliases/CatAliasesResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/aliases/CatAliasesResponse.ts#L22-L24 type Response []types.AliasesRecord diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/allocation/allocation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/allocation/allocation.go index d4ba993fc..335b358ef 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/allocation/allocation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/allocation/allocation.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Provides a snapshot of how many shards are allocated to each data node and // how much disk space they are using. package allocation import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,11 +52,15 @@ type Allocation struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int nodeid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewAllocation type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *Allocation { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -114,6 +122,9 @@ func (r *Allocation) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("allocation") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "nodeid", r.nodeid) + } path.WriteString(r.nodeid) method = http.MethodGet @@ -127,9 +138,9 @@ func (r *Allocation) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -146,27 +157,66 @@ func (r *Allocation) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Allocation) Perform(ctx context.Context) (*http.Response, error) { +func (r Allocation) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cat.allocation") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cat.allocation") + if reader := instrument.RecordRequestBody(ctx, "cat.allocation", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.allocation") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Allocation query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Allocation query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a allocation.Response -func (r Allocation) Do(ctx context.Context) (Response, error) { +func (r Allocation) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.allocation") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -174,6 +224,9 @@ func (r Allocation) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -183,6 +236,9 @@ func (r Allocation) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -190,12 +246,25 @@ func (r Allocation) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Allocation) IsSuccess(ctx context.Context) (bool, error) { +func (r Allocation) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.allocation") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -211,6 +280,14 @@ func (r Allocation) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Allocation query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/allocation/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/allocation/response.go index da0dd8787..bbedcac5a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/allocation/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/allocation/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package allocation @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package allocation // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/allocation/CatAllocationResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/allocation/CatAllocationResponse.ts#L22-L24 type Response []types.AllocationRecord diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/componenttemplates/component_templates.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/componenttemplates/component_templates.go index 8077cd100..dce9d6e55 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/componenttemplates/component_templates.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/componenttemplates/component_templates.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns information about existing component_templates templates. package componenttemplates import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type ComponentTemplates struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewComponentTemplates type alias for index. @@ -79,7 +82,12 @@ func New(tp elastictransport.Interface) *ComponentTemplates { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -111,6 +119,9 @@ func (r *ComponentTemplates) HttpRequest(ctx context.Context) (*http.Request, er path.WriteString("component_templates") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodGet @@ -124,9 +135,9 @@ func (r *ComponentTemplates) HttpRequest(ctx context.Context) (*http.Request, er } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -143,27 +154,66 @@ func (r *ComponentTemplates) HttpRequest(ctx context.Context) (*http.Request, er } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ComponentTemplates) Perform(ctx context.Context) (*http.Response, error) { +func (r ComponentTemplates) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cat.component_templates") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cat.component_templates") + if reader := instrument.RecordRequestBody(ctx, "cat.component_templates", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.component_templates") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ComponentTemplates query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ComponentTemplates query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a componenttemplates.Response -func (r ComponentTemplates) Do(ctx context.Context) (Response, error) { +func (r ComponentTemplates) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.component_templates") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -171,6 +221,9 @@ func (r ComponentTemplates) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -180,6 +233,9 @@ func (r ComponentTemplates) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -187,12 +243,25 @@ func (r ComponentTemplates) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ComponentTemplates) IsSuccess(ctx context.Context) (bool, error) { +func (r ComponentTemplates) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.component_templates") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -208,6 +277,14 @@ func (r ComponentTemplates) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ComponentTemplates query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/componenttemplates/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/componenttemplates/response.go index db26510e4..751fa3d52 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/componenttemplates/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/componenttemplates/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package componenttemplates @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package componenttemplates // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/component_templates/CatComponentTemplatesResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/component_templates/CatComponentTemplatesResponse.ts#L22-L24 type Response []types.CatComponentTemplate diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/count/count.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/count/count.go index e167b5ccf..16b6119fa 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/count/count.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/count/count.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Provides quick access to the document count of the entire cluster, or // individual indices. package count import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type Count struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewCount type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *Count { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -113,6 +121,9 @@ func (r *Count) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("count") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) method = http.MethodGet @@ -126,9 +137,9 @@ func (r *Count) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -145,27 +156,66 @@ func (r *Count) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Count) Perform(ctx context.Context) (*http.Response, error) { +func (r Count) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cat.count") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cat.count") + if reader := instrument.RecordRequestBody(ctx, "cat.count", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.count") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Count query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Count query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a count.Response -func (r Count) Do(ctx context.Context) (Response, error) { +func (r Count) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.count") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -173,6 +223,9 @@ func (r Count) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,6 +235,9 @@ func (r Count) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -189,12 +245,25 @@ func (r Count) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Count) IsSuccess(ctx context.Context) (bool, error) { +func (r Count) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.count") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -210,6 +279,14 @@ func (r Count) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Count query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/count/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/count/response.go index 6f44270db..0b95d0597 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/count/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/count/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package count @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package count // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/count/CatCountResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/count/CatCountResponse.ts#L22-L24 type Response []types.CountRecord diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/fielddata/fielddata.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/fielddata/fielddata.go index 51903b331..fa4fcef67 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/fielddata/fielddata.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/fielddata/fielddata.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Shows how much heap memory is currently being used by fielddata on every data // node in the cluster. package fielddata import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,11 +52,15 @@ type Fielddata struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int fields string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewFielddata type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *Fielddata { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -114,6 +122,9 @@ func (r *Fielddata) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("fielddata") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "fields", r.fields) + } path.WriteString(r.fields) method = http.MethodGet @@ -127,9 +138,9 @@ func (r *Fielddata) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -146,27 +157,66 @@ func (r *Fielddata) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Fielddata) Perform(ctx context.Context) (*http.Response, error) { +func (r Fielddata) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cat.fielddata") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cat.fielddata") + if reader := instrument.RecordRequestBody(ctx, "cat.fielddata", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.fielddata") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Fielddata query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Fielddata query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a fielddata.Response -func (r Fielddata) Do(ctx context.Context) (Response, error) { +func (r Fielddata) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.fielddata") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -174,6 +224,9 @@ func (r Fielddata) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -183,6 +236,9 @@ func (r Fielddata) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -190,12 +246,25 @@ func (r Fielddata) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Fielddata) IsSuccess(ctx context.Context) (bool, error) { +func (r Fielddata) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.fielddata") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -211,6 +280,14 @@ func (r Fielddata) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Fielddata query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/fielddata/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/fielddata/response.go index a362e7d43..36bf30c45 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/fielddata/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/fielddata/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package fielddata @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package fielddata // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/fielddata/CatFielddataResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/fielddata/CatFielddataResponse.ts#L22-L24 type Response []types.FielddataRecord diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/health/health.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/health/health.go index f115baed5..7b8fc0633 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/health/health.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/health/health.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns a concise representation of the cluster health. package health import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -49,9 +48,13 @@ type Health struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewHealth type alias for index. @@ -75,7 +78,12 @@ func New(tp elastictransport.Interface) *Health { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -110,9 +118,9 @@ func (r *Health) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -129,27 +137,66 @@ func (r *Health) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Health) Perform(ctx context.Context) (*http.Response, error) { +func (r Health) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cat.health") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cat.health") + if reader := instrument.RecordRequestBody(ctx, "cat.health", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.health") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Health query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Health query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a health.Response -func (r Health) Do(ctx context.Context) (Response, error) { +func (r Health) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.health") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -157,6 +204,9 @@ func (r Health) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -166,6 +216,9 @@ func (r Health) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -173,12 +226,25 @@ func (r Health) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Health) IsSuccess(ctx context.Context) (bool, error) { +func (r Health) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.health") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -194,6 +260,14 @@ func (r Health) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Health query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/health/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/health/response.go index 4a1ba3023..8793bf10d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/health/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/health/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package health @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package health // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/health/CatHealthResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/health/CatHealthResponse.ts#L22-L24 type Response []types.HealthRecord diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/help/help.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/help/help.go index ba5fd0a6c..331cc6e4f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/help/help.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/help/help.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns help for the Cat APIs. package help import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -47,9 +46,13 @@ type Help struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewHelp type alias for index. @@ -73,7 +76,12 @@ func New(tp elastictransport.Interface) *Help { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,9 +114,9 @@ func (r *Help) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -125,27 +133,66 @@ func (r *Help) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Help) Perform(ctx context.Context) (*http.Response, error) { +func (r Help) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cat.help") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cat.help") + if reader := instrument.RecordRequestBody(ctx, "cat.help", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.help") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Help query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Help query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a help.Response -func (r Help) Do(ctx context.Context) (Response, error) { +func (r Help) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.help") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -153,6 +200,9 @@ func (r Help) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -162,6 +212,9 @@ func (r Help) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -169,12 +222,25 @@ func (r Help) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Help) IsSuccess(ctx context.Context) (bool, error) { +func (r Help) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.help") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -190,6 +256,14 @@ func (r Help) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Help query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/help/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/help/response.go index 46cf2f507..109fa8a4d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/help/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/help/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package help @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package help // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/help/CatHelpResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/help/CatHelpResponse.ts#L22-L24 type Response []types.HelpRecord diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/indices/indices.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/indices/indices.go index df1cdc29a..868ce32b5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/indices/indices.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/indices/indices.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns information about indices: number of primaries and replicas, document // counts, disk size, ... package indices import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -57,11 +56,15 @@ type Indices struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewIndices type alias for index. @@ -86,7 +89,12 @@ func New(tp elastictransport.Interface) *Indices { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -118,6 +126,9 @@ func (r *Indices) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("indices") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) method = http.MethodGet @@ -131,9 +142,9 @@ func (r *Indices) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -150,27 +161,66 @@ func (r *Indices) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Indices) Perform(ctx context.Context) (*http.Response, error) { +func (r Indices) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cat.indices") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cat.indices") + if reader := instrument.RecordRequestBody(ctx, "cat.indices", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.indices") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Indices query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Indices query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a indices.Response -func (r Indices) Do(ctx context.Context) (Response, error) { +func (r Indices) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.indices") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -178,6 +228,9 @@ func (r Indices) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -187,6 +240,9 @@ func (r Indices) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -194,12 +250,25 @@ func (r Indices) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Indices) IsSuccess(ctx context.Context) (bool, error) { +func (r Indices) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.indices") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -215,6 +284,14 @@ func (r Indices) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Indices query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/indices/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/indices/response.go index 7bf9eada0..0c242dc64 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/indices/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/indices/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package indices @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package indices // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/indices/CatIndicesResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/indices/CatIndicesResponse.ts#L22-L24 type Response []types.IndicesRecord diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/master/master.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/master/master.go index 4fd1cb3fe..6e650ea98 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/master/master.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/master/master.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns information about the master node. package master import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -47,9 +46,13 @@ type Master struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewMaster type alias for index. @@ -73,7 +76,12 @@ func New(tp elastictransport.Interface) *Master { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,9 +116,9 @@ func (r *Master) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -127,27 +135,66 @@ func (r *Master) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Master) Perform(ctx context.Context) (*http.Response, error) { +func (r Master) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cat.master") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cat.master") + if reader := instrument.RecordRequestBody(ctx, "cat.master", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.master") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Master query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Master query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a master.Response -func (r Master) Do(ctx context.Context) (Response, error) { +func (r Master) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.master") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -155,6 +202,9 @@ func (r Master) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -164,6 +214,9 @@ func (r Master) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -171,12 +224,25 @@ func (r Master) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Master) IsSuccess(ctx context.Context) (bool, error) { +func (r Master) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.master") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -192,6 +258,14 @@ func (r Master) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Master query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/master/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/master/response.go index 66b5c7da9..7a912219f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/master/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/master/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package master @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package master // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/master/CatMasterResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/master/CatMasterResponse.ts#L22-L24 type Response []types.MasterRecord diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/mldatafeeds/ml_datafeeds.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/mldatafeeds/ml_datafeeds.go index 70dbdf3ee..c92503121 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/mldatafeeds/ml_datafeeds.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/mldatafeeds/ml_datafeeds.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Gets configuration and usage information about datafeeds. package mldatafeeds import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -54,11 +53,15 @@ type MlDatafeeds struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int datafeedid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewMlDatafeeds type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *MlDatafeeds { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -118,6 +126,9 @@ func (r *MlDatafeeds) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("datafeeds") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "datafeedid", r.datafeedid) + } path.WriteString(r.datafeedid) method = http.MethodGet @@ -131,9 +142,9 @@ func (r *MlDatafeeds) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -150,27 +161,66 @@ func (r *MlDatafeeds) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r MlDatafeeds) Perform(ctx context.Context) (*http.Response, error) { +func (r MlDatafeeds) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cat.ml_datafeeds") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cat.ml_datafeeds") + if reader := instrument.RecordRequestBody(ctx, "cat.ml_datafeeds", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.ml_datafeeds") + } if err != nil { - return nil, fmt.Errorf("an error happened during the MlDatafeeds query execution: %w", err) + localErr := fmt.Errorf("an error happened during the MlDatafeeds query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a mldatafeeds.Response -func (r MlDatafeeds) Do(ctx context.Context) (Response, error) { +func (r MlDatafeeds) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.ml_datafeeds") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -178,6 +228,9 @@ func (r MlDatafeeds) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -187,6 +240,9 @@ func (r MlDatafeeds) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -194,12 +250,25 @@ func (r MlDatafeeds) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r MlDatafeeds) IsSuccess(ctx context.Context) (bool, error) { +func (r MlDatafeeds) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.ml_datafeeds") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -215,6 +284,14 @@ func (r MlDatafeeds) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the MlDatafeeds query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/mldatafeeds/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/mldatafeeds/response.go index 62313ffce..4e5e2073a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/mldatafeeds/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/mldatafeeds/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package mldatafeeds @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package mldatafeeds // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/ml_datafeeds/CatDatafeedsResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/ml_datafeeds/CatDatafeedsResponse.ts#L22-L24 type Response []types.DatafeedsRecord diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/mldataframeanalytics/ml_data_frame_analytics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/mldataframeanalytics/ml_data_frame_analytics.go index 9b2a80d39..3729e04ee 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/mldataframeanalytics/ml_data_frame_analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/mldataframeanalytics/ml_data_frame_analytics.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Gets configuration and usage information about data frame analytics jobs. package mldataframeanalytics import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -54,11 +53,15 @@ type MlDataFrameAnalytics struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewMlDataFrameAnalytics type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *MlDataFrameAnalytics { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -122,6 +130,9 @@ func (r *MlDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Request, path.WriteString("analytics") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodGet @@ -135,9 +146,9 @@ func (r *MlDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Request, } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -154,27 +165,66 @@ func (r *MlDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Request, } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r MlDataFrameAnalytics) Perform(ctx context.Context) (*http.Response, error) { +func (r MlDataFrameAnalytics) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cat.ml_data_frame_analytics") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cat.ml_data_frame_analytics") + if reader := instrument.RecordRequestBody(ctx, "cat.ml_data_frame_analytics", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.ml_data_frame_analytics") + } if err != nil { - return nil, fmt.Errorf("an error happened during the MlDataFrameAnalytics query execution: %w", err) + localErr := fmt.Errorf("an error happened during the MlDataFrameAnalytics query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a mldataframeanalytics.Response -func (r MlDataFrameAnalytics) Do(ctx context.Context) (Response, error) { +func (r MlDataFrameAnalytics) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.ml_data_frame_analytics") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -182,6 +232,9 @@ func (r MlDataFrameAnalytics) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -191,6 +244,9 @@ func (r MlDataFrameAnalytics) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -198,12 +254,25 @@ func (r MlDataFrameAnalytics) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r MlDataFrameAnalytics) IsSuccess(ctx context.Context) (bool, error) { +func (r MlDataFrameAnalytics) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.ml_data_frame_analytics") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -219,6 +288,14 @@ func (r MlDataFrameAnalytics) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the MlDataFrameAnalytics query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/mldataframeanalytics/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/mldataframeanalytics/response.go index 72327e149..8eb5cb565 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/mldataframeanalytics/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/mldataframeanalytics/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package mldataframeanalytics @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package mldataframeanalytics // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/ml_data_frame_analytics/CatDataFrameAnalyticsResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/ml_data_frame_analytics/CatDataFrameAnalyticsResponse.ts#L22-L24 type Response []types.DataFrameAnalyticsRecord diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/mljobs/ml_jobs.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/mljobs/ml_jobs.go index 449ca3a8f..79a5bd0d5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/mljobs/ml_jobs.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/mljobs/ml_jobs.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Gets configuration and usage information about anomaly detection jobs. package mljobs import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -55,11 +54,15 @@ type MlJobs struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int jobid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewMlJobs type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *MlJobs { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -119,6 +127,9 @@ func (r *MlJobs) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("anomaly_detectors") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "jobid", r.jobid) + } path.WriteString(r.jobid) method = http.MethodGet @@ -132,9 +143,9 @@ func (r *MlJobs) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -151,27 +162,66 @@ func (r *MlJobs) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r MlJobs) Perform(ctx context.Context) (*http.Response, error) { +func (r MlJobs) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cat.ml_jobs") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cat.ml_jobs") + if reader := instrument.RecordRequestBody(ctx, "cat.ml_jobs", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.ml_jobs") + } if err != nil { - return nil, fmt.Errorf("an error happened during the MlJobs query execution: %w", err) + localErr := fmt.Errorf("an error happened during the MlJobs query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a mljobs.Response -func (r MlJobs) Do(ctx context.Context) (Response, error) { +func (r MlJobs) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.ml_jobs") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -179,6 +229,9 @@ func (r MlJobs) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -188,6 +241,9 @@ func (r MlJobs) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -195,12 +251,25 @@ func (r MlJobs) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r MlJobs) IsSuccess(ctx context.Context) (bool, error) { +func (r MlJobs) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.ml_jobs") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -216,6 +285,14 @@ func (r MlJobs) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the MlJobs query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/mljobs/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/mljobs/response.go index dcd219dfe..410c5cec2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/mljobs/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/mljobs/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package mljobs @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package mljobs // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/ml_jobs/CatJobsResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/ml_jobs/CatJobsResponse.ts#L22-L24 type Response []types.JobsRecord diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/mltrainedmodels/ml_trained_models.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/mltrainedmodels/ml_trained_models.go index 25aac14cb..487464b46 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/mltrainedmodels/ml_trained_models.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/mltrainedmodels/ml_trained_models.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Gets configuration and usage information about inference trained models. package mltrainedmodels import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -54,11 +53,15 @@ type MlTrainedModels struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int modelid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewMlTrainedModels type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *MlTrainedModels { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -118,6 +126,9 @@ func (r *MlTrainedModels) HttpRequest(ctx context.Context) (*http.Request, error path.WriteString("trained_models") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "modelid", r.modelid) + } path.WriteString(r.modelid) method = http.MethodGet @@ -131,9 +142,9 @@ func (r *MlTrainedModels) HttpRequest(ctx context.Context) (*http.Request, error } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -150,27 +161,66 @@ func (r *MlTrainedModels) HttpRequest(ctx context.Context) (*http.Request, error } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r MlTrainedModels) Perform(ctx context.Context) (*http.Response, error) { +func (r MlTrainedModels) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cat.ml_trained_models") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cat.ml_trained_models") + if reader := instrument.RecordRequestBody(ctx, "cat.ml_trained_models", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.ml_trained_models") + } if err != nil { - return nil, fmt.Errorf("an error happened during the MlTrainedModels query execution: %w", err) + localErr := fmt.Errorf("an error happened during the MlTrainedModels query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a mltrainedmodels.Response -func (r MlTrainedModels) Do(ctx context.Context) (Response, error) { +func (r MlTrainedModels) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.ml_trained_models") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -178,6 +228,9 @@ func (r MlTrainedModels) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -187,6 +240,9 @@ func (r MlTrainedModels) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -194,12 +250,25 @@ func (r MlTrainedModels) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r MlTrainedModels) IsSuccess(ctx context.Context) (bool, error) { +func (r MlTrainedModels) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.ml_trained_models") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -215,6 +284,14 @@ func (r MlTrainedModels) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the MlTrainedModels query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/mltrainedmodels/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/mltrainedmodels/response.go index 7df0ff592..97fbdcf69 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/mltrainedmodels/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/mltrainedmodels/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package mltrainedmodels @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package mltrainedmodels // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/ml_trained_models/CatTrainedModelsResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/ml_trained_models/CatTrainedModelsResponse.ts#L22-L24 type Response []types.TrainedModelsRecord diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/nodeattrs/nodeattrs.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/nodeattrs/nodeattrs.go index 42b29c66c..fd7e64a4f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/nodeattrs/nodeattrs.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/nodeattrs/nodeattrs.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns information about custom node attributes. package nodeattrs import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -47,9 +46,13 @@ type Nodeattrs struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewNodeattrs type alias for index. @@ -73,7 +76,12 @@ func New(tp elastictransport.Interface) *Nodeattrs { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,9 +116,9 @@ func (r *Nodeattrs) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -127,27 +135,66 @@ func (r *Nodeattrs) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Nodeattrs) Perform(ctx context.Context) (*http.Response, error) { +func (r Nodeattrs) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cat.nodeattrs") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cat.nodeattrs") + if reader := instrument.RecordRequestBody(ctx, "cat.nodeattrs", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.nodeattrs") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Nodeattrs query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Nodeattrs query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a nodeattrs.Response -func (r Nodeattrs) Do(ctx context.Context) (Response, error) { +func (r Nodeattrs) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.nodeattrs") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -155,6 +202,9 @@ func (r Nodeattrs) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -164,6 +214,9 @@ func (r Nodeattrs) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -171,12 +224,25 @@ func (r Nodeattrs) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Nodeattrs) IsSuccess(ctx context.Context) (bool, error) { +func (r Nodeattrs) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.nodeattrs") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -192,6 +258,14 @@ func (r Nodeattrs) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Nodeattrs query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/nodeattrs/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/nodeattrs/response.go index 1b3e53493..64ab142b2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/nodeattrs/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/nodeattrs/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package nodeattrs @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package nodeattrs // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/nodeattrs/CatNodeAttributesResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/nodeattrs/CatNodeAttributesResponse.ts#L22-L24 type Response []types.NodeAttributesRecord diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/nodes/nodes.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/nodes/nodes.go index 28fdae3b3..c42ce2776 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/nodes/nodes.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/nodes/nodes.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns basic statistics about performance of cluster nodes. package nodes import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -49,9 +48,13 @@ type Nodes struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewNodes type alias for index. @@ -75,7 +78,12 @@ func New(tp elastictransport.Interface) *Nodes { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -110,9 +118,9 @@ func (r *Nodes) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -129,27 +137,66 @@ func (r *Nodes) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Nodes) Perform(ctx context.Context) (*http.Response, error) { +func (r Nodes) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cat.nodes") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cat.nodes") + if reader := instrument.RecordRequestBody(ctx, "cat.nodes", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.nodes") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Nodes query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Nodes query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a nodes.Response -func (r Nodes) Do(ctx context.Context) (Response, error) { +func (r Nodes) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.nodes") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -157,6 +204,9 @@ func (r Nodes) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -166,6 +216,9 @@ func (r Nodes) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -173,12 +226,25 @@ func (r Nodes) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Nodes) IsSuccess(ctx context.Context) (bool, error) { +func (r Nodes) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.nodes") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -194,6 +260,14 @@ func (r Nodes) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Nodes query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/nodes/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/nodes/response.go index a33924403..bd8164c90 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/nodes/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/nodes/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package nodes @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package nodes // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/nodes/CatNodesResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/nodes/CatNodesResponse.ts#L22-L24 type Response []types.NodesRecord diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/pendingtasks/pending_tasks.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/pendingtasks/pending_tasks.go index 153b2276e..9bf474797 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/pendingtasks/pending_tasks.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/pendingtasks/pending_tasks.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns a concise representation of the cluster pending tasks. package pendingtasks import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -47,9 +46,13 @@ type PendingTasks struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPendingTasks type alias for index. @@ -73,7 +76,12 @@ func New(tp elastictransport.Interface) *PendingTasks { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,9 +116,9 @@ func (r *PendingTasks) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -127,27 +135,66 @@ func (r *PendingTasks) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PendingTasks) Perform(ctx context.Context) (*http.Response, error) { +func (r PendingTasks) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cat.pending_tasks") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cat.pending_tasks") + if reader := instrument.RecordRequestBody(ctx, "cat.pending_tasks", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.pending_tasks") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PendingTasks query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PendingTasks query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a pendingtasks.Response -func (r PendingTasks) Do(ctx context.Context) (Response, error) { +func (r PendingTasks) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.pending_tasks") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -155,6 +202,9 @@ func (r PendingTasks) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -164,6 +214,9 @@ func (r PendingTasks) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -171,12 +224,25 @@ func (r PendingTasks) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r PendingTasks) IsSuccess(ctx context.Context) (bool, error) { +func (r PendingTasks) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.pending_tasks") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -192,6 +258,14 @@ func (r PendingTasks) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the PendingTasks query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/pendingtasks/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/pendingtasks/response.go index b474464a9..5c88ea5dc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/pendingtasks/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/pendingtasks/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package pendingtasks @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package pendingtasks // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/pending_tasks/CatPendingTasksResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/pending_tasks/CatPendingTasksResponse.ts#L22-L24 type Response []types.PendingTasksRecord diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/plugins/plugins.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/plugins/plugins.go index 36fe67203..12a85cddc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/plugins/plugins.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/plugins/plugins.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns information about installed plugins across nodes node. package plugins import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -47,9 +46,13 @@ type Plugins struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPlugins type alias for index. @@ -73,7 +76,12 @@ func New(tp elastictransport.Interface) *Plugins { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,9 +116,9 @@ func (r *Plugins) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -127,27 +135,66 @@ func (r *Plugins) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Plugins) Perform(ctx context.Context) (*http.Response, error) { +func (r Plugins) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cat.plugins") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cat.plugins") + if reader := instrument.RecordRequestBody(ctx, "cat.plugins", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.plugins") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Plugins query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Plugins query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a plugins.Response -func (r Plugins) Do(ctx context.Context) (Response, error) { +func (r Plugins) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.plugins") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -155,6 +202,9 @@ func (r Plugins) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -164,6 +214,9 @@ func (r Plugins) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -171,12 +224,25 @@ func (r Plugins) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Plugins) IsSuccess(ctx context.Context) (bool, error) { +func (r Plugins) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.plugins") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -192,6 +258,14 @@ func (r Plugins) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Plugins query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/plugins/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/plugins/response.go index 01584665d..dca947d94 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/plugins/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/plugins/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package plugins @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package plugins // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/plugins/CatPluginsResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/plugins/CatPluginsResponse.ts#L22-L24 type Response []types.PluginsRecord diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/recovery/recovery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/recovery/recovery.go index 0d700722f..dc7850f0c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/recovery/recovery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/recovery/recovery.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns information about index shard recoveries, both on-going completed. package recovery import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,11 +52,15 @@ type Recovery struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewRecovery type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *Recovery { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -113,6 +121,9 @@ func (r *Recovery) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("recovery") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) method = http.MethodGet @@ -126,9 +137,9 @@ func (r *Recovery) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -145,27 +156,66 @@ func (r *Recovery) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Recovery) Perform(ctx context.Context) (*http.Response, error) { +func (r Recovery) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cat.recovery") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cat.recovery") + if reader := instrument.RecordRequestBody(ctx, "cat.recovery", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.recovery") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Recovery query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Recovery query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a recovery.Response -func (r Recovery) Do(ctx context.Context) (Response, error) { +func (r Recovery) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.recovery") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -173,6 +223,9 @@ func (r Recovery) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,6 +235,9 @@ func (r Recovery) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -189,12 +245,25 @@ func (r Recovery) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Recovery) IsSuccess(ctx context.Context) (bool, error) { +func (r Recovery) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.recovery") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -210,6 +279,14 @@ func (r Recovery) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Recovery query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/recovery/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/recovery/response.go index d0b15ce9d..547c7a172 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/recovery/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/recovery/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package recovery @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package recovery // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/recovery/CatRecoveryResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/recovery/CatRecoveryResponse.ts#L22-L24 type Response []types.RecoveryRecord diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/repositories/repositories.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/repositories/repositories.go index af2b5642d..3f3f469c5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/repositories/repositories.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/repositories/repositories.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns information about snapshot repositories registered in the cluster. package repositories import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -47,9 +46,13 @@ type Repositories struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewRepositories type alias for index. @@ -73,7 +76,12 @@ func New(tp elastictransport.Interface) *Repositories { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,9 +116,9 @@ func (r *Repositories) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -127,27 +135,66 @@ func (r *Repositories) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Repositories) Perform(ctx context.Context) (*http.Response, error) { +func (r Repositories) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cat.repositories") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cat.repositories") + if reader := instrument.RecordRequestBody(ctx, "cat.repositories", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.repositories") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Repositories query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Repositories query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a repositories.Response -func (r Repositories) Do(ctx context.Context) (Response, error) { +func (r Repositories) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.repositories") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -155,6 +202,9 @@ func (r Repositories) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -164,6 +214,9 @@ func (r Repositories) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -171,12 +224,25 @@ func (r Repositories) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Repositories) IsSuccess(ctx context.Context) (bool, error) { +func (r Repositories) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.repositories") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -192,6 +258,14 @@ func (r Repositories) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Repositories query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/repositories/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/repositories/response.go index 9f3dfff11..6364aaed8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/repositories/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/repositories/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package repositories @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package repositories // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/repositories/CatRepositoriesResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/repositories/CatRepositoriesResponse.ts#L22-L24 type Response []types.RepositoriesRecord diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/segments/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/segments/response.go index ca032790d..41bd8a68e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/segments/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/segments/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package segments @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package segments // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/segments/CatSegmentsResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/segments/CatSegmentsResponse.ts#L22-L24 type Response []types.SegmentsRecord diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/segments/segments.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/segments/segments.go index cbe261485..36f711bc7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/segments/segments.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/segments/segments.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Provides low-level information about the segments in the shards of an index. package segments import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type Segments struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewSegments type alias for index. @@ -80,7 +83,12 @@ func New(tp elastictransport.Interface) *Segments { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -112,6 +120,9 @@ func (r *Segments) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("segments") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) method = http.MethodGet @@ -125,9 +136,9 @@ func (r *Segments) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -144,27 +155,66 @@ func (r *Segments) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Segments) Perform(ctx context.Context) (*http.Response, error) { +func (r Segments) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cat.segments") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cat.segments") + if reader := instrument.RecordRequestBody(ctx, "cat.segments", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.segments") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Segments query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Segments query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a segments.Response -func (r Segments) Do(ctx context.Context) (Response, error) { +func (r Segments) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.segments") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -172,6 +222,9 @@ func (r Segments) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -181,6 +234,9 @@ func (r Segments) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -188,12 +244,25 @@ func (r Segments) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Segments) IsSuccess(ctx context.Context) (bool, error) { +func (r Segments) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.segments") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -209,6 +278,14 @@ func (r Segments) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Segments query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/shards/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/shards/response.go index 52c39c672..995ecf81a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/shards/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/shards/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package shards @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package shards // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/shards/CatShardsResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/shards/CatShardsResponse.ts#L22-L24 type Response []types.ShardsRecord diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/shards/shards.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/shards/shards.go index 47e295755..3f6a2124e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/shards/shards.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/shards/shards.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Provides a detailed view of shard allocation on nodes. package shards import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type Shards struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewShards type alias for index. @@ -80,7 +83,12 @@ func New(tp elastictransport.Interface) *Shards { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -112,6 +120,9 @@ func (r *Shards) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("shards") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) method = http.MethodGet @@ -125,9 +136,9 @@ func (r *Shards) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -144,27 +155,66 @@ func (r *Shards) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Shards) Perform(ctx context.Context) (*http.Response, error) { +func (r Shards) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cat.shards") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cat.shards") + if reader := instrument.RecordRequestBody(ctx, "cat.shards", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.shards") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Shards query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Shards query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a shards.Response -func (r Shards) Do(ctx context.Context) (Response, error) { +func (r Shards) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.shards") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -172,6 +222,9 @@ func (r Shards) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -181,6 +234,9 @@ func (r Shards) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -188,12 +244,25 @@ func (r Shards) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Shards) IsSuccess(ctx context.Context) (bool, error) { +func (r Shards) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.shards") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -209,6 +278,14 @@ func (r Shards) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Shards query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/snapshots/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/snapshots/response.go index 35062ae2f..4f5767a14 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/snapshots/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/snapshots/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package snapshots @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package snapshots // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/snapshots/CatSnapshotsResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/snapshots/CatSnapshotsResponse.ts#L22-L24 type Response []types.SnapshotsRecord diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/snapshots/snapshots.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/snapshots/snapshots.go index 387110cad..af5c98c1e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/snapshots/snapshots.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/snapshots/snapshots.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns all snapshots in a specific repository. package snapshots import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type Snapshots struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int repository string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewSnapshots type alias for index. @@ -80,7 +83,12 @@ func New(tp elastictransport.Interface) *Snapshots { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -112,6 +120,9 @@ func (r *Snapshots) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("snapshots") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "repository", r.repository) + } path.WriteString(r.repository) method = http.MethodGet @@ -125,9 +136,9 @@ func (r *Snapshots) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -144,27 +155,66 @@ func (r *Snapshots) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Snapshots) Perform(ctx context.Context) (*http.Response, error) { +func (r Snapshots) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cat.snapshots") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cat.snapshots") + if reader := instrument.RecordRequestBody(ctx, "cat.snapshots", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.snapshots") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Snapshots query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Snapshots query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a snapshots.Response -func (r Snapshots) Do(ctx context.Context) (Response, error) { +func (r Snapshots) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.snapshots") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -172,6 +222,9 @@ func (r Snapshots) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -181,6 +234,9 @@ func (r Snapshots) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -188,12 +244,25 @@ func (r Snapshots) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Snapshots) IsSuccess(ctx context.Context) (bool, error) { +func (r Snapshots) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.snapshots") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -209,6 +278,14 @@ func (r Snapshots) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Snapshots query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/tasks/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/tasks/response.go index ffd57c6fa..b72b5281c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/tasks/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/tasks/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package tasks @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package tasks // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/tasks/CatTasksResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/tasks/CatTasksResponse.ts#L22-L24 type Response []types.TasksRecord diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/tasks/tasks.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/tasks/tasks.go index 618726925..46a32ca4a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/tasks/tasks.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/tasks/tasks.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns information about the tasks currently executing on one or more nodes // in the cluster. package tasks import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -49,9 +48,13 @@ type Tasks struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewTasks type alias for index. @@ -76,7 +79,12 @@ func New(tp elastictransport.Interface) *Tasks { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -111,9 +119,9 @@ func (r *Tasks) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -130,27 +138,66 @@ func (r *Tasks) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Tasks) Perform(ctx context.Context) (*http.Response, error) { +func (r Tasks) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cat.tasks") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cat.tasks") + if reader := instrument.RecordRequestBody(ctx, "cat.tasks", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.tasks") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Tasks query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Tasks query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a tasks.Response -func (r Tasks) Do(ctx context.Context) (Response, error) { +func (r Tasks) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.tasks") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -158,6 +205,9 @@ func (r Tasks) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -167,6 +217,9 @@ func (r Tasks) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -174,12 +227,25 @@ func (r Tasks) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Tasks) IsSuccess(ctx context.Context) (bool, error) { +func (r Tasks) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.tasks") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -195,6 +261,14 @@ func (r Tasks) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Tasks query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/templates/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/templates/response.go index 6179f9fe5..6a5f35e5c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/templates/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/templates/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package templates @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package templates // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/templates/CatTemplatesResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/templates/CatTemplatesResponse.ts#L22-L24 type Response []types.TemplatesRecord diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/templates/templates.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/templates/templates.go index 41da3d967..bb008f13a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/templates/templates.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/templates/templates.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns information about existing templates. package templates import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type Templates struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewTemplates type alias for index. @@ -79,7 +82,12 @@ func New(tp elastictransport.Interface) *Templates { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -111,6 +119,9 @@ func (r *Templates) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("templates") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodGet @@ -124,9 +135,9 @@ func (r *Templates) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -143,27 +154,66 @@ func (r *Templates) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Templates) Perform(ctx context.Context) (*http.Response, error) { +func (r Templates) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cat.templates") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cat.templates") + if reader := instrument.RecordRequestBody(ctx, "cat.templates", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.templates") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Templates query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Templates query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a templates.Response -func (r Templates) Do(ctx context.Context) (Response, error) { +func (r Templates) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.templates") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -171,6 +221,9 @@ func (r Templates) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -180,6 +233,9 @@ func (r Templates) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -187,12 +243,25 @@ func (r Templates) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Templates) IsSuccess(ctx context.Context) (bool, error) { +func (r Templates) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.templates") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -208,6 +277,14 @@ func (r Templates) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Templates query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/threadpool/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/threadpool/response.go index 6b4cf0ecc..0bc04e520 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/threadpool/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/threadpool/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package threadpool @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package threadpool // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/thread_pool/CatThreadPoolResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/thread_pool/CatThreadPoolResponse.ts#L22-L24 type Response []types.ThreadPoolRecord diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/threadpool/thread_pool.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/threadpool/thread_pool.go index 2bd68f32e..c9540d0e2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/threadpool/thread_pool.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/threadpool/thread_pool.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns cluster-wide thread pool statistics per node. // By default the active, queue and rejected statistics are returned for all @@ -24,7 +24,6 @@ package threadpool import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -54,11 +53,15 @@ type ThreadPool struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int threadpoolpatterns string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewThreadPool type alias for index. @@ -84,7 +87,12 @@ func New(tp elastictransport.Interface) *ThreadPool { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -116,6 +124,9 @@ func (r *ThreadPool) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("thread_pool") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "threadpoolpatterns", r.threadpoolpatterns) + } path.WriteString(r.threadpoolpatterns) method = http.MethodGet @@ -129,9 +140,9 @@ func (r *ThreadPool) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -148,27 +159,66 @@ func (r *ThreadPool) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ThreadPool) Perform(ctx context.Context) (*http.Response, error) { +func (r ThreadPool) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cat.thread_pool") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cat.thread_pool") + if reader := instrument.RecordRequestBody(ctx, "cat.thread_pool", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.thread_pool") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ThreadPool query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ThreadPool query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a threadpool.Response -func (r ThreadPool) Do(ctx context.Context) (Response, error) { +func (r ThreadPool) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.thread_pool") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -176,6 +226,9 @@ func (r ThreadPool) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -185,6 +238,9 @@ func (r ThreadPool) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -192,12 +248,25 @@ func (r ThreadPool) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ThreadPool) IsSuccess(ctx context.Context) (bool, error) { +func (r ThreadPool) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.thread_pool") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -213,6 +282,14 @@ func (r ThreadPool) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ThreadPool query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/transforms/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/transforms/response.go index 6513fbac8..ab001a8ab 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/transforms/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/transforms/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package transforms @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package transforms // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/transforms/CatTransformsResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/transforms/CatTransformsResponse.ts#L22-L24 type Response []types.TransformsRecord diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/transforms/transforms.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/transforms/transforms.go index eda5137e0..999d5c9eb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/transforms/transforms.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cat/transforms/transforms.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Gets configuration and usage information about transforms. package transforms import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -54,11 +53,15 @@ type Transforms struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int transformid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewTransforms type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *Transforms { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -114,6 +122,9 @@ func (r *Transforms) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("transforms") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "transformid", r.transformid) + } path.WriteString(r.transformid) method = http.MethodGet @@ -127,9 +138,9 @@ func (r *Transforms) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -146,27 +157,66 @@ func (r *Transforms) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Transforms) Perform(ctx context.Context) (*http.Response, error) { +func (r Transforms) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cat.transforms") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cat.transforms") + if reader := instrument.RecordRequestBody(ctx, "cat.transforms", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cat.transforms") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Transforms query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Transforms query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a transforms.Response -func (r Transforms) Do(ctx context.Context) (Response, error) { +func (r Transforms) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.transforms") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -174,6 +224,9 @@ func (r Transforms) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -183,6 +236,9 @@ func (r Transforms) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -190,12 +246,25 @@ func (r Transforms) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Transforms) IsSuccess(ctx context.Context) (bool, error) { +func (r Transforms) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cat.transforms") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -211,6 +280,14 @@ func (r Transforms) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Transforms query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/deleteautofollowpattern/delete_auto_follow_pattern.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/deleteautofollowpattern/delete_auto_follow_pattern.go index bec938fa2..5dea701c9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/deleteautofollowpattern/delete_auto_follow_pattern.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/deleteautofollowpattern/delete_auto_follow_pattern.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes auto-follow patterns. package deleteautofollowpattern import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type DeleteAutoFollowPattern struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteAutoFollowPattern type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *DeleteAutoFollowPattern { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *DeleteAutoFollowPattern) HttpRequest(ctx context.Context) (*http.Reques path.WriteString("auto_follow") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodDelete @@ -119,9 +130,9 @@ func (r *DeleteAutoFollowPattern) HttpRequest(ctx context.Context) (*http.Reques } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -138,27 +149,66 @@ func (r *DeleteAutoFollowPattern) HttpRequest(ctx context.Context) (*http.Reques } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteAutoFollowPattern) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteAutoFollowPattern) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ccr.delete_auto_follow_pattern") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ccr.delete_auto_follow_pattern") + if reader := instrument.RecordRequestBody(ctx, "ccr.delete_auto_follow_pattern", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ccr.delete_auto_follow_pattern") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteAutoFollowPattern query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteAutoFollowPattern query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deleteautofollowpattern.Response -func (r DeleteAutoFollowPattern) Do(ctx context.Context) (*Response, error) { +func (r DeleteAutoFollowPattern) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.delete_auto_follow_pattern") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -166,6 +216,9 @@ func (r DeleteAutoFollowPattern) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,6 +228,9 @@ func (r DeleteAutoFollowPattern) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,12 +238,25 @@ func (r DeleteAutoFollowPattern) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteAutoFollowPattern) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteAutoFollowPattern) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.delete_auto_follow_pattern") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -203,6 +272,14 @@ func (r DeleteAutoFollowPattern) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteAutoFollowPattern query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/deleteautofollowpattern/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/deleteautofollowpattern/response.go index 434bac858..30d38c9db 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/deleteautofollowpattern/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/deleteautofollowpattern/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deleteautofollowpattern // Response holds the response body struct for the package deleteautofollowpattern // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ccr/delete_auto_follow_pattern/DeleteAutoFollowPatternResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ccr/delete_auto_follow_pattern/DeleteAutoFollowPatternResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/follow/follow.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/follow/follow.go index 48ae16dd3..c421286fc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/follow/follow.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/follow/follow.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates a new follower index configured to follow the referenced leader // index. @@ -51,15 +51,19 @@ type Follow struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewFollow type alias for index. @@ -86,11 +90,18 @@ func New(tp elastictransport.Interface) *Follow { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -127,9 +138,7 @@ func (r *Follow) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -141,12 +150,19 @@ func (r *Follow) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_ccr") @@ -164,15 +180,15 @@ func (r *Follow) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -189,27 +205,66 @@ func (r *Follow) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Follow) Perform(ctx context.Context) (*http.Response, error) { +func (r Follow) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ccr.follow") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ccr.follow") + if reader := instrument.RecordRequestBody(ctx, "ccr.follow", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ccr.follow") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Follow query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Follow query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a follow.Response -func (r Follow) Do(ctx context.Context) (*Response, error) { +func (r Follow) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.follow") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -217,6 +272,9 @@ func (r Follow) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -226,6 +284,9 @@ func (r Follow) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -233,6 +294,9 @@ func (r Follow) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/follow/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/follow/request.go index 430ff09a9..5e2e7a28a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/follow/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/follow/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package follow @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package follow // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ccr/follow/CreateFollowIndexRequest.ts#L25-L51 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ccr/follow/CreateFollowIndexRequest.ts#L25-L51 type Request struct { LeaderIndex *string `json:"leader_index,omitempty"` MaxOutstandingReadRequests *int64 `json:"max_outstanding_read_requests,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/follow/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/follow/response.go index b36a346bf..a8b230023 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/follow/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/follow/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package follow // Response holds the response body struct for the package follow // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ccr/follow/CreateFollowIndexResponse.ts#L20-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ccr/follow/CreateFollowIndexResponse.ts#L20-L26 type Response struct { FollowIndexCreated bool `json:"follow_index_created"` FollowIndexShardsAcked bool `json:"follow_index_shards_acked"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/followinfo/follow_info.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/followinfo/follow_info.go index 3a5a9230b..a84410da2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/followinfo/follow_info.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/followinfo/follow_info.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves information about all follower indices, including parameters and // status for each follower index package followinfo import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type FollowInfo struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewFollowInfo type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *FollowInfo { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *FollowInfo) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_ccr") @@ -121,9 +132,9 @@ func (r *FollowInfo) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -140,27 +151,66 @@ func (r *FollowInfo) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r FollowInfo) Perform(ctx context.Context) (*http.Response, error) { +func (r FollowInfo) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ccr.follow_info") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ccr.follow_info") + if reader := instrument.RecordRequestBody(ctx, "ccr.follow_info", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ccr.follow_info") + } if err != nil { - return nil, fmt.Errorf("an error happened during the FollowInfo query execution: %w", err) + localErr := fmt.Errorf("an error happened during the FollowInfo query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a followinfo.Response -func (r FollowInfo) Do(ctx context.Context) (*Response, error) { +func (r FollowInfo) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.follow_info") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -168,6 +218,9 @@ func (r FollowInfo) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -177,6 +230,9 @@ func (r FollowInfo) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,12 +240,25 @@ func (r FollowInfo) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r FollowInfo) IsSuccess(ctx context.Context) (bool, error) { +func (r FollowInfo) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.follow_info") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -205,6 +274,14 @@ func (r FollowInfo) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the FollowInfo query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/followinfo/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/followinfo/response.go index 0d02b8af7..b2e3f01c1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/followinfo/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/followinfo/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package followinfo @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package followinfo // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ccr/follow_info/FollowInfoResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ccr/follow_info/FollowInfoResponse.ts#L22-L24 type Response struct { FollowerIndices []types.FollowerIndex `json:"follower_indices"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/followstats/follow_stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/followstats/follow_stats.go index 96534186e..56d169c6f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/followstats/follow_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/followstats/follow_stats.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves follower stats. return shard-level stats about the following tasks // associated with each shard for the specified indices. package followstats import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type FollowStats struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewFollowStats type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *FollowStats { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *FollowStats) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_ccr") @@ -121,9 +132,9 @@ func (r *FollowStats) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -140,27 +151,66 @@ func (r *FollowStats) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r FollowStats) Perform(ctx context.Context) (*http.Response, error) { +func (r FollowStats) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ccr.follow_stats") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ccr.follow_stats") + if reader := instrument.RecordRequestBody(ctx, "ccr.follow_stats", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ccr.follow_stats") + } if err != nil { - return nil, fmt.Errorf("an error happened during the FollowStats query execution: %w", err) + localErr := fmt.Errorf("an error happened during the FollowStats query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a followstats.Response -func (r FollowStats) Do(ctx context.Context) (*Response, error) { +func (r FollowStats) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.follow_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -168,6 +218,9 @@ func (r FollowStats) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -177,6 +230,9 @@ func (r FollowStats) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,12 +240,25 @@ func (r FollowStats) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r FollowStats) IsSuccess(ctx context.Context) (bool, error) { +func (r FollowStats) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.follow_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -205,6 +274,14 @@ func (r FollowStats) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the FollowStats query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/followstats/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/followstats/response.go index a1200a1ff..c7f71cd75 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/followstats/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/followstats/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package followstats @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package followstats // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ccr/follow_stats/FollowIndexStatsResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ccr/follow_stats/FollowIndexStatsResponse.ts#L22-L24 type Response struct { Indices []types.FollowIndexStats `json:"indices"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/forgetfollower/forget_follower.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/forgetfollower/forget_follower.go index 5a8b113e0..f2c157710 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/forgetfollower/forget_follower.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/forgetfollower/forget_follower.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Removes the follower retention leases from the leader. package forgetfollower @@ -50,15 +50,19 @@ type ForgetFollower struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewForgetFollower type alias for index. @@ -84,11 +88,18 @@ func New(tp elastictransport.Interface) *ForgetFollower { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -125,9 +136,7 @@ func (r *ForgetFollower) HttpRequest(ctx context.Context) (*http.Request, error) } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -139,12 +148,19 @@ func (r *ForgetFollower) HttpRequest(ctx context.Context) (*http.Request, error) } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_ccr") @@ -162,15 +178,15 @@ func (r *ForgetFollower) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -187,27 +203,66 @@ func (r *ForgetFollower) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ForgetFollower) Perform(ctx context.Context) (*http.Response, error) { +func (r ForgetFollower) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ccr.forget_follower") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ccr.forget_follower") + if reader := instrument.RecordRequestBody(ctx, "ccr.forget_follower", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ccr.forget_follower") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ForgetFollower query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ForgetFollower query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a forgetfollower.Response -func (r ForgetFollower) Do(ctx context.Context) (*Response, error) { +func (r ForgetFollower) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.forget_follower") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -215,6 +270,9 @@ func (r ForgetFollower) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -224,6 +282,9 @@ func (r ForgetFollower) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -231,6 +292,9 @@ func (r ForgetFollower) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/forgetfollower/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/forgetfollower/request.go index 0c7b6e393..0f0dc783c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/forgetfollower/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/forgetfollower/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package forgetfollower @@ -27,7 +27,7 @@ import ( // Request holds the request body struct for the package forgetfollower // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ccr/forget_follower/ForgetFollowerIndexRequest.ts#L23-L38 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ccr/forget_follower/ForgetFollowerIndexRequest.ts#L23-L38 type Request struct { FollowerCluster *string `json:"follower_cluster,omitempty"` FollowerIndex *string `json:"follower_index,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/forgetfollower/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/forgetfollower/response.go index 790fbddbf..08577b2bb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/forgetfollower/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/forgetfollower/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package forgetfollower @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package forgetfollower // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ccr/forget_follower/ForgetFollowerIndexResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ccr/forget_follower/ForgetFollowerIndexResponse.ts#L22-L24 type Response struct { Shards_ types.ShardStatistics `json:"_shards"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/getautofollowpattern/get_auto_follow_pattern.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/getautofollowpattern/get_auto_follow_pattern.go index dc694ca12..49953e6af 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/getautofollowpattern/get_auto_follow_pattern.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/getautofollowpattern/get_auto_follow_pattern.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Gets configured auto-follow patterns. Returns the specified auto-follow // pattern collection. package getautofollowpattern import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type GetAutoFollowPattern struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetAutoFollowPattern type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *GetAutoFollowPattern { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -113,6 +121,9 @@ func (r *GetAutoFollowPattern) HttpRequest(ctx context.Context) (*http.Request, path.WriteString("auto_follow") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodGet @@ -126,9 +137,9 @@ func (r *GetAutoFollowPattern) HttpRequest(ctx context.Context) (*http.Request, } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -145,27 +156,66 @@ func (r *GetAutoFollowPattern) HttpRequest(ctx context.Context) (*http.Request, } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetAutoFollowPattern) Perform(ctx context.Context) (*http.Response, error) { +func (r GetAutoFollowPattern) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ccr.get_auto_follow_pattern") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ccr.get_auto_follow_pattern") + if reader := instrument.RecordRequestBody(ctx, "ccr.get_auto_follow_pattern", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ccr.get_auto_follow_pattern") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetAutoFollowPattern query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetAutoFollowPattern query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getautofollowpattern.Response -func (r GetAutoFollowPattern) Do(ctx context.Context) (*Response, error) { +func (r GetAutoFollowPattern) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.get_auto_follow_pattern") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -173,6 +223,9 @@ func (r GetAutoFollowPattern) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,6 +235,9 @@ func (r GetAutoFollowPattern) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -189,12 +245,25 @@ func (r GetAutoFollowPattern) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetAutoFollowPattern) IsSuccess(ctx context.Context) (bool, error) { +func (r GetAutoFollowPattern) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.get_auto_follow_pattern") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -210,6 +279,14 @@ func (r GetAutoFollowPattern) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetAutoFollowPattern query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/getautofollowpattern/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/getautofollowpattern/response.go index e5373cfc4..97af8cdf0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/getautofollowpattern/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/getautofollowpattern/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getautofollowpattern @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getautofollowpattern // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ccr/get_auto_follow_pattern/GetAutoFollowPatternResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ccr/get_auto_follow_pattern/GetAutoFollowPatternResponse.ts#L22-L24 type Response struct { Patterns []types.AutoFollowPattern `json:"patterns"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/pauseautofollowpattern/pause_auto_follow_pattern.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/pauseautofollowpattern/pause_auto_follow_pattern.go index 21e336688..4af83929c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/pauseautofollowpattern/pause_auto_follow_pattern.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/pauseautofollowpattern/pause_auto_follow_pattern.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Pauses an auto-follow pattern package pauseautofollowpattern import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type PauseAutoFollowPattern struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPauseAutoFollowPattern type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *PauseAutoFollowPattern { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *PauseAutoFollowPattern) HttpRequest(ctx context.Context) (*http.Request path.WriteString("auto_follow") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) path.WriteString("/") path.WriteString("pause") @@ -121,9 +132,9 @@ func (r *PauseAutoFollowPattern) HttpRequest(ctx context.Context) (*http.Request } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -140,27 +151,66 @@ func (r *PauseAutoFollowPattern) HttpRequest(ctx context.Context) (*http.Request } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PauseAutoFollowPattern) Perform(ctx context.Context) (*http.Response, error) { +func (r PauseAutoFollowPattern) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ccr.pause_auto_follow_pattern") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ccr.pause_auto_follow_pattern") + if reader := instrument.RecordRequestBody(ctx, "ccr.pause_auto_follow_pattern", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ccr.pause_auto_follow_pattern") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PauseAutoFollowPattern query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PauseAutoFollowPattern query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a pauseautofollowpattern.Response -func (r PauseAutoFollowPattern) Do(ctx context.Context) (*Response, error) { +func (r PauseAutoFollowPattern) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.pause_auto_follow_pattern") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -168,6 +218,9 @@ func (r PauseAutoFollowPattern) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -177,6 +230,9 @@ func (r PauseAutoFollowPattern) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,12 +240,25 @@ func (r PauseAutoFollowPattern) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r PauseAutoFollowPattern) IsSuccess(ctx context.Context) (bool, error) { +func (r PauseAutoFollowPattern) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.pause_auto_follow_pattern") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -205,6 +274,14 @@ func (r PauseAutoFollowPattern) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the PauseAutoFollowPattern query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/pauseautofollowpattern/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/pauseautofollowpattern/response.go index aae957028..40051fc22 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/pauseautofollowpattern/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/pauseautofollowpattern/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package pauseautofollowpattern // Response holds the response body struct for the package pauseautofollowpattern // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ccr/pause_auto_follow_pattern/PauseAutoFollowPatternResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ccr/pause_auto_follow_pattern/PauseAutoFollowPatternResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/pausefollow/pause_follow.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/pausefollow/pause_follow.go index 973ff55ba..0ae338651 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/pausefollow/pause_follow.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/pausefollow/pause_follow.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Pauses a follower index. The follower index will not fetch any additional // operations from the leader index. package pausefollow import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type PauseFollow struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPauseFollow type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *PauseFollow { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *PauseFollow) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_ccr") @@ -121,9 +132,9 @@ func (r *PauseFollow) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -140,27 +151,66 @@ func (r *PauseFollow) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PauseFollow) Perform(ctx context.Context) (*http.Response, error) { +func (r PauseFollow) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ccr.pause_follow") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ccr.pause_follow") + if reader := instrument.RecordRequestBody(ctx, "ccr.pause_follow", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ccr.pause_follow") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PauseFollow query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PauseFollow query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a pausefollow.Response -func (r PauseFollow) Do(ctx context.Context) (*Response, error) { +func (r PauseFollow) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.pause_follow") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -168,6 +218,9 @@ func (r PauseFollow) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -177,6 +230,9 @@ func (r PauseFollow) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,12 +240,25 @@ func (r PauseFollow) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r PauseFollow) IsSuccess(ctx context.Context) (bool, error) { +func (r PauseFollow) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.pause_follow") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -205,6 +274,14 @@ func (r PauseFollow) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the PauseFollow query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/pausefollow/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/pausefollow/response.go index a58acc914..f7d06f5f6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/pausefollow/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/pausefollow/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package pausefollow // Response holds the response body struct for the package pausefollow // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ccr/pause_follow/PauseFollowIndexResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ccr/pause_follow/PauseFollowIndexResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/putautofollowpattern/put_auto_follow_pattern.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/putautofollowpattern/put_auto_follow_pattern.go index 4e3a6511f..7efcb6327 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/putautofollowpattern/put_auto_follow_pattern.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/putautofollowpattern/put_auto_follow_pattern.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates a new named collection of auto-follow patterns against a specified // remote cluster. Newly created indices on the remote cluster matching any of @@ -52,15 +52,19 @@ type PutAutoFollowPattern struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutAutoFollowPattern type alias for index. @@ -88,11 +92,18 @@ func New(tp elastictransport.Interface) *PutAutoFollowPattern { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -129,9 +140,7 @@ func (r *PutAutoFollowPattern) HttpRequest(ctx context.Context) (*http.Request, } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -143,6 +152,10 @@ func (r *PutAutoFollowPattern) HttpRequest(ctx context.Context) (*http.Request, } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -153,6 +166,9 @@ func (r *PutAutoFollowPattern) HttpRequest(ctx context.Context) (*http.Request, path.WriteString("auto_follow") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodPut @@ -166,15 +182,15 @@ func (r *PutAutoFollowPattern) HttpRequest(ctx context.Context) (*http.Request, } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -191,27 +207,66 @@ func (r *PutAutoFollowPattern) HttpRequest(ctx context.Context) (*http.Request, } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutAutoFollowPattern) Perform(ctx context.Context) (*http.Response, error) { +func (r PutAutoFollowPattern) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ccr.put_auto_follow_pattern") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ccr.put_auto_follow_pattern") + if reader := instrument.RecordRequestBody(ctx, "ccr.put_auto_follow_pattern", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ccr.put_auto_follow_pattern") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutAutoFollowPattern query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutAutoFollowPattern query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a putautofollowpattern.Response -func (r PutAutoFollowPattern) Do(ctx context.Context) (*Response, error) { +func (r PutAutoFollowPattern) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.put_auto_follow_pattern") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -219,6 +274,9 @@ func (r PutAutoFollowPattern) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -228,6 +286,9 @@ func (r PutAutoFollowPattern) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -235,6 +296,9 @@ func (r PutAutoFollowPattern) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/putautofollowpattern/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/putautofollowpattern/request.go index 0081e6c6c..4959f8f05 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/putautofollowpattern/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/putautofollowpattern/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putautofollowpattern @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package putautofollowpattern // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ccr/put_auto_follow_pattern/PutAutoFollowPatternRequest.ts#L27-L112 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ccr/put_auto_follow_pattern/PutAutoFollowPatternRequest.ts#L27-L112 type Request struct { // FollowIndexPattern The name of follower index. The template {{leader_index}} can be used to diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/putautofollowpattern/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/putautofollowpattern/response.go index b767898a6..e43581251 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/putautofollowpattern/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/putautofollowpattern/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putautofollowpattern // Response holds the response body struct for the package putautofollowpattern // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ccr/put_auto_follow_pattern/PutAutoFollowPatternResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ccr/put_auto_follow_pattern/PutAutoFollowPatternResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/resumeautofollowpattern/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/resumeautofollowpattern/response.go index a056067c2..b27c3118b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/resumeautofollowpattern/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/resumeautofollowpattern/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package resumeautofollowpattern // Response holds the response body struct for the package resumeautofollowpattern // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ccr/resume_auto_follow_pattern/ResumeAutoFollowPatternResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ccr/resume_auto_follow_pattern/ResumeAutoFollowPatternResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/resumeautofollowpattern/resume_auto_follow_pattern.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/resumeautofollowpattern/resume_auto_follow_pattern.go index a6ddcc223..98f3dda5c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/resumeautofollowpattern/resume_auto_follow_pattern.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/resumeautofollowpattern/resume_auto_follow_pattern.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Resumes an auto-follow pattern that has been paused package resumeautofollowpattern import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type ResumeAutoFollowPattern struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewResumeAutoFollowPattern type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *ResumeAutoFollowPattern { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *ResumeAutoFollowPattern) HttpRequest(ctx context.Context) (*http.Reques path.WriteString("auto_follow") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) path.WriteString("/") path.WriteString("resume") @@ -121,9 +132,9 @@ func (r *ResumeAutoFollowPattern) HttpRequest(ctx context.Context) (*http.Reques } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -140,27 +151,66 @@ func (r *ResumeAutoFollowPattern) HttpRequest(ctx context.Context) (*http.Reques } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ResumeAutoFollowPattern) Perform(ctx context.Context) (*http.Response, error) { +func (r ResumeAutoFollowPattern) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ccr.resume_auto_follow_pattern") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ccr.resume_auto_follow_pattern") + if reader := instrument.RecordRequestBody(ctx, "ccr.resume_auto_follow_pattern", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ccr.resume_auto_follow_pattern") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ResumeAutoFollowPattern query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ResumeAutoFollowPattern query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a resumeautofollowpattern.Response -func (r ResumeAutoFollowPattern) Do(ctx context.Context) (*Response, error) { +func (r ResumeAutoFollowPattern) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.resume_auto_follow_pattern") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -168,6 +218,9 @@ func (r ResumeAutoFollowPattern) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -177,6 +230,9 @@ func (r ResumeAutoFollowPattern) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,12 +240,25 @@ func (r ResumeAutoFollowPattern) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ResumeAutoFollowPattern) IsSuccess(ctx context.Context) (bool, error) { +func (r ResumeAutoFollowPattern) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.resume_auto_follow_pattern") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -205,6 +274,14 @@ func (r ResumeAutoFollowPattern) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ResumeAutoFollowPattern query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/resumefollow/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/resumefollow/request.go index d8d86a275..7e57bb2b1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/resumefollow/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/resumefollow/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package resumefollow @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package resumefollow // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ccr/resume_follow/ResumeFollowIndexRequest.ts#L25-L46 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ccr/resume_follow/ResumeFollowIndexRequest.ts#L25-L46 type Request struct { MaxOutstandingReadRequests *int64 `json:"max_outstanding_read_requests,omitempty"` MaxOutstandingWriteRequests *int64 `json:"max_outstanding_write_requests,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/resumefollow/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/resumefollow/response.go index e94453cdf..6dcfb91ef 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/resumefollow/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/resumefollow/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package resumefollow // Response holds the response body struct for the package resumefollow // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ccr/resume_follow/ResumeFollowIndexResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ccr/resume_follow/ResumeFollowIndexResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/resumefollow/resume_follow.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/resumefollow/resume_follow.go index 40b58e73a..371fa4554 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/resumefollow/resume_follow.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/resumefollow/resume_follow.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Resumes a follower index that has been paused package resumefollow @@ -50,15 +50,19 @@ type ResumeFollow struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewResumeFollow type alias for index. @@ -84,11 +88,18 @@ func New(tp elastictransport.Interface) *ResumeFollow { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -125,9 +136,7 @@ func (r *ResumeFollow) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -139,12 +148,19 @@ func (r *ResumeFollow) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_ccr") @@ -162,15 +178,15 @@ func (r *ResumeFollow) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -187,27 +203,66 @@ func (r *ResumeFollow) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ResumeFollow) Perform(ctx context.Context) (*http.Response, error) { +func (r ResumeFollow) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ccr.resume_follow") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ccr.resume_follow") + if reader := instrument.RecordRequestBody(ctx, "ccr.resume_follow", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ccr.resume_follow") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ResumeFollow query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ResumeFollow query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a resumefollow.Response -func (r ResumeFollow) Do(ctx context.Context) (*Response, error) { +func (r ResumeFollow) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.resume_follow") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -215,6 +270,9 @@ func (r ResumeFollow) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -224,6 +282,9 @@ func (r ResumeFollow) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -231,6 +292,9 @@ func (r ResumeFollow) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/stats/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/stats/response.go index 4af590e22..f46716394 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/stats/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/stats/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package stats @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package stats // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ccr/stats/CcrStatsResponse.ts#L22-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ccr/stats/CcrStatsResponse.ts#L22-L27 type Response struct { AutoFollowStats types.AutoFollowStats `json:"auto_follow_stats"` FollowStats types.FollowStats `json:"follow_stats"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/stats/stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/stats/stats.go index 583bafbbd..cce8f79ff 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/stats/stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/stats/stats.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Gets all stats related to cross-cluster replication. package stats import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -47,9 +46,13 @@ type Stats struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewStats type alias for index. @@ -73,7 +76,12 @@ func New(tp elastictransport.Interface) *Stats { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,9 +116,9 @@ func (r *Stats) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -127,27 +135,66 @@ func (r *Stats) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Stats) Perform(ctx context.Context) (*http.Response, error) { +func (r Stats) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ccr.stats") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ccr.stats") + if reader := instrument.RecordRequestBody(ctx, "ccr.stats", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ccr.stats") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Stats query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Stats query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a stats.Response -func (r Stats) Do(ctx context.Context) (*Response, error) { +func (r Stats) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -155,6 +202,9 @@ func (r Stats) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -164,6 +214,9 @@ func (r Stats) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -171,12 +224,25 @@ func (r Stats) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Stats) IsSuccess(ctx context.Context) (bool, error) { +func (r Stats) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -192,6 +258,14 @@ func (r Stats) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Stats query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/unfollow/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/unfollow/response.go index 511d27de0..b669056eb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/unfollow/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/unfollow/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package unfollow // Response holds the response body struct for the package unfollow // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ccr/unfollow/UnfollowIndexResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ccr/unfollow/UnfollowIndexResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/unfollow/unfollow.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/unfollow/unfollow.go index 496f71098..4ae55e665 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/unfollow/unfollow.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ccr/unfollow/unfollow.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Stops the following task associated with a follower index and removes index // metadata and settings associated with cross-cluster replication. package unfollow import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type Unfollow struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewUnfollow type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *Unfollow { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *Unfollow) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_ccr") @@ -121,9 +132,9 @@ func (r *Unfollow) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -140,27 +151,66 @@ func (r *Unfollow) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Unfollow) Perform(ctx context.Context) (*http.Response, error) { +func (r Unfollow) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ccr.unfollow") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ccr.unfollow") + if reader := instrument.RecordRequestBody(ctx, "ccr.unfollow", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ccr.unfollow") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Unfollow query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Unfollow query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a unfollow.Response -func (r Unfollow) Do(ctx context.Context) (*Response, error) { +func (r Unfollow) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.unfollow") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -168,6 +218,9 @@ func (r Unfollow) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -177,6 +230,9 @@ func (r Unfollow) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,12 +240,25 @@ func (r Unfollow) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Unfollow) IsSuccess(ctx context.Context) (bool, error) { +func (r Unfollow) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ccr.unfollow") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -205,6 +274,14 @@ func (r Unfollow) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Unfollow query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/allocationexplain/allocation_explain.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/allocationexplain/allocation_explain.go index d25297c26..93306893b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/allocationexplain/allocation_explain.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/allocationexplain/allocation_explain.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Provides explanations for shard allocations in the cluster. package allocationexplain @@ -47,13 +47,17 @@ type AllocationExplain struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewAllocationExplain type alias for index. @@ -77,11 +81,18 @@ func New(tp elastictransport.Interface) *AllocationExplain { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -118,9 +129,7 @@ func (r *AllocationExplain) HttpRequest(ctx context.Context) (*http.Request, err } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -132,6 +141,10 @@ func (r *AllocationExplain) HttpRequest(ctx context.Context) (*http.Request, err } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -154,15 +167,15 @@ func (r *AllocationExplain) HttpRequest(ctx context.Context) (*http.Request, err } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -179,27 +192,66 @@ func (r *AllocationExplain) HttpRequest(ctx context.Context) (*http.Request, err } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r AllocationExplain) Perform(ctx context.Context) (*http.Response, error) { +func (r AllocationExplain) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cluster.allocation_explain") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cluster.allocation_explain") + if reader := instrument.RecordRequestBody(ctx, "cluster.allocation_explain", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cluster.allocation_explain") + } if err != nil { - return nil, fmt.Errorf("an error happened during the AllocationExplain query execution: %w", err) + localErr := fmt.Errorf("an error happened during the AllocationExplain query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a allocationexplain.Response -func (r AllocationExplain) Do(ctx context.Context) (*Response, error) { +func (r AllocationExplain) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.allocation_explain") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -207,6 +259,9 @@ func (r AllocationExplain) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -216,6 +271,9 @@ func (r AllocationExplain) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -223,6 +281,9 @@ func (r AllocationExplain) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/allocationexplain/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/allocationexplain/request.go index de24dc057..f399dd40c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/allocationexplain/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/allocationexplain/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package allocationexplain @@ -27,7 +27,7 @@ import ( // Request holds the request body struct for the package allocationexplain // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/allocation_explain/ClusterAllocationExplainRequest.ts#L24-L61 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/allocation_explain/ClusterAllocationExplainRequest.ts#L24-L61 type Request struct { // CurrentNode Specifies the node ID or the name of the node to only explain a shard that is diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/allocationexplain/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/allocationexplain/response.go index 703cb9fef..553083aac 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/allocationexplain/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/allocationexplain/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package allocationexplain @@ -27,7 +27,7 @@ import ( // Response holds the response body struct for the package allocationexplain // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/allocation_explain/ClusterAllocationExplainResponse.ts#L32-L64 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/allocation_explain/ClusterAllocationExplainResponse.ts#L32-L64 type Response struct { AllocateExplanation *string `json:"allocate_explanation,omitempty"` AllocationDelay types.Duration `json:"allocation_delay,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/deletecomponenttemplate/delete_component_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/deletecomponenttemplate/delete_component_template.go index 165986351..36a985d3e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/deletecomponenttemplate/delete_component_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/deletecomponenttemplate/delete_component_template.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes a component template package deletecomponenttemplate import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type DeleteComponentTemplate struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteComponentTemplate type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *DeleteComponentTemplate { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *DeleteComponentTemplate) HttpRequest(ctx context.Context) (*http.Reques path.WriteString("_component_template") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodDelete @@ -117,9 +128,9 @@ func (r *DeleteComponentTemplate) HttpRequest(ctx context.Context) (*http.Reques } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -136,27 +147,66 @@ func (r *DeleteComponentTemplate) HttpRequest(ctx context.Context) (*http.Reques } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteComponentTemplate) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteComponentTemplate) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cluster.delete_component_template") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cluster.delete_component_template") + if reader := instrument.RecordRequestBody(ctx, "cluster.delete_component_template", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cluster.delete_component_template") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteComponentTemplate query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteComponentTemplate query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deletecomponenttemplate.Response -func (r DeleteComponentTemplate) Do(ctx context.Context) (*Response, error) { +func (r DeleteComponentTemplate) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.delete_component_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -164,6 +214,9 @@ func (r DeleteComponentTemplate) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -173,6 +226,9 @@ func (r DeleteComponentTemplate) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -180,12 +236,25 @@ func (r DeleteComponentTemplate) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteComponentTemplate) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteComponentTemplate) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.delete_component_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -201,6 +270,14 @@ func (r DeleteComponentTemplate) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteComponentTemplate query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/deletecomponenttemplate/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/deletecomponenttemplate/response.go index dbfffc4dc..0cef972c3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/deletecomponenttemplate/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/deletecomponenttemplate/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deletecomponenttemplate // Response holds the response body struct for the package deletecomponenttemplate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/delete_component_template/ClusterDeleteComponentTemplateResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/delete_component_template/ClusterDeleteComponentTemplateResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/deletevotingconfigexclusions/delete_voting_config_exclusions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/deletevotingconfigexclusions/delete_voting_config_exclusions.go index 2d36dd529..3c7440553 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/deletevotingconfigexclusions/delete_voting_config_exclusions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/deletevotingconfigexclusions/delete_voting_config_exclusions.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Clears cluster voting config exclusions. package deletevotingconfigexclusions import ( - gobytes "bytes" "context" "errors" "fmt" @@ -46,9 +45,13 @@ type DeleteVotingConfigExclusions struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteVotingConfigExclusions type alias for index. @@ -72,7 +75,12 @@ func New(tp elastictransport.Interface) *DeleteVotingConfigExclusions { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -107,9 +115,9 @@ func (r *DeleteVotingConfigExclusions) HttpRequest(ctx context.Context) (*http.R } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -126,15 +134,42 @@ func (r *DeleteVotingConfigExclusions) HttpRequest(ctx context.Context) (*http.R } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteVotingConfigExclusions) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteVotingConfigExclusions) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cluster.delete_voting_config_exclusions") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cluster.delete_voting_config_exclusions") + if reader := instrument.RecordRequestBody(ctx, "cluster.delete_voting_config_exclusions", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cluster.delete_voting_config_exclusions") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteVotingConfigExclusions query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteVotingConfigExclusions query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil @@ -147,7 +182,17 @@ func (r DeleteVotingConfigExclusions) Do(ctx context.Context) (bool, error) { // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteVotingConfigExclusions) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteVotingConfigExclusions) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.delete_voting_config_exclusions") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -163,6 +208,14 @@ func (r DeleteVotingConfigExclusions) IsSuccess(ctx context.Context) (bool, erro return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteVotingConfigExclusions query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/existscomponenttemplate/exists_component_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/existscomponenttemplate/exists_component_template.go index e9d44ddb5..9da112ce1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/existscomponenttemplate/exists_component_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/existscomponenttemplate/exists_component_template.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns information about whether a particular component template exist package existscomponenttemplate import ( - gobytes "bytes" "context" "errors" "fmt" @@ -50,11 +49,15 @@ type ExistsComponentTemplate struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewExistsComponentTemplate type alias for index. @@ -80,7 +83,12 @@ func New(tp elastictransport.Interface) *ExistsComponentTemplate { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -103,6 +111,9 @@ func (r *ExistsComponentTemplate) HttpRequest(ctx context.Context) (*http.Reques path.WriteString("_component_template") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodHead @@ -116,9 +127,9 @@ func (r *ExistsComponentTemplate) HttpRequest(ctx context.Context) (*http.Reques } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -135,15 +146,42 @@ func (r *ExistsComponentTemplate) HttpRequest(ctx context.Context) (*http.Reques } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ExistsComponentTemplate) Perform(ctx context.Context) (*http.Response, error) { +func (r ExistsComponentTemplate) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cluster.exists_component_template") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cluster.exists_component_template") + if reader := instrument.RecordRequestBody(ctx, "cluster.exists_component_template", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cluster.exists_component_template") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ExistsComponentTemplate query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ExistsComponentTemplate query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil @@ -156,7 +194,17 @@ func (r ExistsComponentTemplate) Do(ctx context.Context) (bool, error) { // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ExistsComponentTemplate) IsSuccess(ctx context.Context) (bool, error) { +func (r ExistsComponentTemplate) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.exists_component_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -172,6 +220,14 @@ func (r ExistsComponentTemplate) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ExistsComponentTemplate query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/getcomponenttemplate/get_component_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/getcomponenttemplate/get_component_template.go index 2ae3a4bf8..58f5c67c9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/getcomponenttemplate/get_component_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/getcomponenttemplate/get_component_template.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns one or more component templates package getcomponenttemplate import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type GetComponentTemplate struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetComponentTemplate type alias for index. @@ -80,7 +83,12 @@ func New(tp elastictransport.Interface) *GetComponentTemplate { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,6 +116,9 @@ func (r *GetComponentTemplate) HttpRequest(ctx context.Context) (*http.Request, path.WriteString("_component_template") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodGet @@ -121,9 +132,9 @@ func (r *GetComponentTemplate) HttpRequest(ctx context.Context) (*http.Request, } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -140,27 +151,66 @@ func (r *GetComponentTemplate) HttpRequest(ctx context.Context) (*http.Request, } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetComponentTemplate) Perform(ctx context.Context) (*http.Response, error) { +func (r GetComponentTemplate) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cluster.get_component_template") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cluster.get_component_template") + if reader := instrument.RecordRequestBody(ctx, "cluster.get_component_template", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cluster.get_component_template") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetComponentTemplate query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetComponentTemplate query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getcomponenttemplate.Response -func (r GetComponentTemplate) Do(ctx context.Context) (*Response, error) { +func (r GetComponentTemplate) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.get_component_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -168,6 +218,9 @@ func (r GetComponentTemplate) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -177,6 +230,9 @@ func (r GetComponentTemplate) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,12 +240,25 @@ func (r GetComponentTemplate) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetComponentTemplate) IsSuccess(ctx context.Context) (bool, error) { +func (r GetComponentTemplate) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.get_component_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -205,6 +274,14 @@ func (r GetComponentTemplate) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetComponentTemplate query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/getcomponenttemplate/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/getcomponenttemplate/response.go index 40fbf7839..f05800fd9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/getcomponenttemplate/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/getcomponenttemplate/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getcomponenttemplate @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getcomponenttemplate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/get_component_template/ClusterGetComponentTemplateResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/get_component_template/ClusterGetComponentTemplateResponse.ts#L22-L24 type Response struct { ComponentTemplates []types.ClusterComponentTemplate `json:"component_templates"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/getsettings/get_settings.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/getsettings/get_settings.go index 0991b859a..a56b6d801 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/getsettings/get_settings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/getsettings/get_settings.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns cluster settings. package getsettings import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -48,9 +47,13 @@ type GetSettings struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetSettings type alias for index. @@ -74,7 +77,12 @@ func New(tp elastictransport.Interface) *GetSettings { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -109,9 +117,9 @@ func (r *GetSettings) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -128,27 +136,66 @@ func (r *GetSettings) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetSettings) Perform(ctx context.Context) (*http.Response, error) { +func (r GetSettings) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cluster.get_settings") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cluster.get_settings") + if reader := instrument.RecordRequestBody(ctx, "cluster.get_settings", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cluster.get_settings") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetSettings query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetSettings query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getsettings.Response -func (r GetSettings) Do(ctx context.Context) (*Response, error) { +func (r GetSettings) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.get_settings") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -156,6 +203,9 @@ func (r GetSettings) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -165,6 +215,9 @@ func (r GetSettings) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -172,12 +225,25 @@ func (r GetSettings) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetSettings) IsSuccess(ctx context.Context) (bool, error) { +func (r GetSettings) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.get_settings") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -193,6 +259,14 @@ func (r GetSettings) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetSettings query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/getsettings/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/getsettings/response.go index 0bed40b37..4b1d388cb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/getsettings/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/getsettings/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getsettings @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getsettings // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/get_settings/ClusterGetSettingsResponse.ts#L23-L29 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/get_settings/ClusterGetSettingsResponse.ts#L23-L29 type Response struct { Defaults map[string]json.RawMessage `json:"defaults,omitempty"` Persistent map[string]json.RawMessage `json:"persistent"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/health/health.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/health/health.go index 94e87c2ab..482d0d94f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/health/health.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/health/health.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns basic information about the health of the cluster. package health @@ -56,11 +56,15 @@ type Health struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewHealth type alias for index. @@ -84,7 +88,12 @@ func New(tp elastictransport.Interface) *Health { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -116,6 +125,9 @@ func (r *Health) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("health") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) method = http.MethodGet @@ -129,9 +141,9 @@ func (r *Health) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -148,27 +160,66 @@ func (r *Health) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Health) Perform(ctx context.Context) (*http.Response, error) { +func (r Health) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cluster.health") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cluster.health") + if reader := instrument.RecordRequestBody(ctx, "cluster.health", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cluster.health") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Health query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Health query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a health.Response -func (r Health) Do(ctx context.Context) (*Response, error) { +func (r Health) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.health") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -176,6 +227,9 @@ func (r Health) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -185,30 +239,45 @@ func (r Health) Do(ctx context.Context) (*Response, error) { if res.StatusCode == 408 { data, err := ioutil.ReadAll(res.Body) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } errorResponse := types.NewElasticsearchError() err = json.NewDecoder(gobytes.NewReader(data)).Decode(&errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } if errorResponse.Status == 0 { err = json.NewDecoder(gobytes.NewReader(data)).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } return response, nil } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -216,12 +285,25 @@ func (r Health) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Health) IsSuccess(ctx context.Context) (bool, error) { +func (r Health) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.health") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -237,6 +319,14 @@ func (r Health) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Health query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/health/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/health/response.go index b8377e405..32543cda2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/health/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/health/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package health @@ -27,7 +27,7 @@ import ( // Response holds the response body struct for the package health // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/health/ClusterHealthResponse.ts#L26-L37 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/health/ClusterHealthResponse.ts#L26-L37 type Response struct { // ActivePrimaryShards The number of active primary shards. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/info/info.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/info/info.go index 905cb1bc2..bb0794e44 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/info/info.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/info/info.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns different information about the cluster. package info import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type Info struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int target string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewInfo type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *Info { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *Info) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_info") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "target", r.target) + } path.WriteString(r.target) method = http.MethodGet @@ -117,9 +128,9 @@ func (r *Info) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -136,27 +147,66 @@ func (r *Info) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Info) Perform(ctx context.Context) (*http.Response, error) { +func (r Info) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cluster.info") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cluster.info") + if reader := instrument.RecordRequestBody(ctx, "cluster.info", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cluster.info") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Info query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Info query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a info.Response -func (r Info) Do(ctx context.Context) (*Response, error) { +func (r Info) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.info") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -164,6 +214,9 @@ func (r Info) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -173,6 +226,9 @@ func (r Info) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -180,12 +236,25 @@ func (r Info) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Info) IsSuccess(ctx context.Context) (bool, error) { +func (r Info) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.info") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -201,6 +270,14 @@ func (r Info) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Info query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/info/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/info/response.go index 9944b45d4..d9745a577 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/info/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/info/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package info @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package info // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/info/ClusterInfoResponse.ts#L26-L34 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/info/ClusterInfoResponse.ts#L26-L34 type Response struct { ClusterName string `json:"cluster_name"` Http *types.Http `json:"http,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/pendingtasks/pending_tasks.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/pendingtasks/pending_tasks.go index 21b457a4b..d8e17c82b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/pendingtasks/pending_tasks.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/pendingtasks/pending_tasks.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns a list of any cluster-level changes (e.g. create index, update // mapping, @@ -24,7 +24,6 @@ package pendingtasks import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -50,9 +49,13 @@ type PendingTasks struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPendingTasks type alias for index. @@ -78,7 +81,12 @@ func New(tp elastictransport.Interface) *PendingTasks { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -113,9 +121,9 @@ func (r *PendingTasks) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -132,27 +140,66 @@ func (r *PendingTasks) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PendingTasks) Perform(ctx context.Context) (*http.Response, error) { +func (r PendingTasks) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cluster.pending_tasks") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cluster.pending_tasks") + if reader := instrument.RecordRequestBody(ctx, "cluster.pending_tasks", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cluster.pending_tasks") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PendingTasks query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PendingTasks query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a pendingtasks.Response -func (r PendingTasks) Do(ctx context.Context) (*Response, error) { +func (r PendingTasks) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.pending_tasks") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -160,6 +207,9 @@ func (r PendingTasks) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -169,6 +219,9 @@ func (r PendingTasks) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -176,12 +229,25 @@ func (r PendingTasks) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r PendingTasks) IsSuccess(ctx context.Context) (bool, error) { +func (r PendingTasks) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.pending_tasks") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -197,6 +263,14 @@ func (r PendingTasks) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the PendingTasks query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/pendingtasks/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/pendingtasks/response.go index f5c09a3c8..3e92a2263 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/pendingtasks/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/pendingtasks/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package pendingtasks @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package pendingtasks // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/pending_tasks/ClusterPendingTasksResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/pending_tasks/ClusterPendingTasksResponse.ts#L22-L24 type Response struct { Tasks []types.PendingTask `json:"tasks"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/postvotingconfigexclusions/post_voting_config_exclusions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/postvotingconfigexclusions/post_voting_config_exclusions.go index a99220ec9..df94f919d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/postvotingconfigexclusions/post_voting_config_exclusions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/postvotingconfigexclusions/post_voting_config_exclusions.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Updates the cluster voting config exclusions by node ids or node names. package postvotingconfigexclusions import ( - gobytes "bytes" "context" "errors" "fmt" @@ -45,9 +44,13 @@ type PostVotingConfigExclusions struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPostVotingConfigExclusions type alias for index. @@ -71,7 +74,12 @@ func New(tp elastictransport.Interface) *PostVotingConfigExclusions { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,9 +114,9 @@ func (r *PostVotingConfigExclusions) HttpRequest(ctx context.Context) (*http.Req } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -125,15 +133,42 @@ func (r *PostVotingConfigExclusions) HttpRequest(ctx context.Context) (*http.Req } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PostVotingConfigExclusions) Perform(ctx context.Context) (*http.Response, error) { +func (r PostVotingConfigExclusions) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cluster.post_voting_config_exclusions") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cluster.post_voting_config_exclusions") + if reader := instrument.RecordRequestBody(ctx, "cluster.post_voting_config_exclusions", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cluster.post_voting_config_exclusions") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PostVotingConfigExclusions query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PostVotingConfigExclusions query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil @@ -146,7 +181,17 @@ func (r PostVotingConfigExclusions) Do(ctx context.Context) (bool, error) { // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r PostVotingConfigExclusions) IsSuccess(ctx context.Context) (bool, error) { +func (r PostVotingConfigExclusions) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.post_voting_config_exclusions") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -162,6 +207,14 @@ func (r PostVotingConfigExclusions) IsSuccess(ctx context.Context) (bool, error) return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the PostVotingConfigExclusions query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/putcomponenttemplate/put_component_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/putcomponenttemplate/put_component_template.go index c17456962..1ed5f7d77 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/putcomponenttemplate/put_component_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/putcomponenttemplate/put_component_template.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates or updates a component template package putcomponenttemplate @@ -51,15 +51,19 @@ type PutComponentTemplate struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutComponentTemplate type alias for index. @@ -85,11 +89,18 @@ func New(tp elastictransport.Interface) *PutComponentTemplate { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -126,9 +137,7 @@ func (r *PutComponentTemplate) HttpRequest(ctx context.Context) (*http.Request, } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -140,6 +149,10 @@ func (r *PutComponentTemplate) HttpRequest(ctx context.Context) (*http.Request, } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -148,6 +161,9 @@ func (r *PutComponentTemplate) HttpRequest(ctx context.Context) (*http.Request, path.WriteString("_component_template") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodPut @@ -161,15 +177,15 @@ func (r *PutComponentTemplate) HttpRequest(ctx context.Context) (*http.Request, } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -186,27 +202,66 @@ func (r *PutComponentTemplate) HttpRequest(ctx context.Context) (*http.Request, } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutComponentTemplate) Perform(ctx context.Context) (*http.Response, error) { +func (r PutComponentTemplate) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cluster.put_component_template") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cluster.put_component_template") + if reader := instrument.RecordRequestBody(ctx, "cluster.put_component_template", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cluster.put_component_template") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutComponentTemplate query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutComponentTemplate query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a putcomponenttemplate.Response -func (r PutComponentTemplate) Do(ctx context.Context) (*Response, error) { +func (r PutComponentTemplate) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.put_component_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -214,6 +269,9 @@ func (r PutComponentTemplate) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -223,6 +281,9 @@ func (r PutComponentTemplate) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -230,6 +291,9 @@ func (r PutComponentTemplate) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/putcomponenttemplate/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/putcomponenttemplate/request.go index fd003ee6f..283ef88af 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/putcomponenttemplate/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/putcomponenttemplate/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putcomponenttemplate @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package putcomponenttemplate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/put_component_template/ClusterPutComponentTemplateRequest.ts#L29-L99 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/put_component_template/ClusterPutComponentTemplateRequest.ts#L29-L99 type Request struct { // AllowAutoCreate This setting overrides the value of the `action.auto_create_index` cluster diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/putcomponenttemplate/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/putcomponenttemplate/response.go index e6589fc6d..c1d359c84 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/putcomponenttemplate/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/putcomponenttemplate/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putcomponenttemplate // Response holds the response body struct for the package putcomponenttemplate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/put_component_template/ClusterPutComponentTemplateResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/put_component_template/ClusterPutComponentTemplateResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/putsettings/put_settings.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/putsettings/put_settings.go index 5406bbb27..157dc98d4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/putsettings/put_settings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/putsettings/put_settings.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Updates the cluster settings. package putsettings @@ -47,13 +47,17 @@ type PutSettings struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutSettings type alias for index. @@ -77,11 +81,18 @@ func New(tp elastictransport.Interface) *PutSettings { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -118,9 +129,7 @@ func (r *PutSettings) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -132,6 +141,10 @@ func (r *PutSettings) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -152,15 +165,15 @@ func (r *PutSettings) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -177,27 +190,66 @@ func (r *PutSettings) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutSettings) Perform(ctx context.Context) (*http.Response, error) { +func (r PutSettings) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cluster.put_settings") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cluster.put_settings") + if reader := instrument.RecordRequestBody(ctx, "cluster.put_settings", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cluster.put_settings") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutSettings query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutSettings query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a putsettings.Response -func (r PutSettings) Do(ctx context.Context) (*Response, error) { +func (r PutSettings) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.put_settings") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -205,6 +257,9 @@ func (r PutSettings) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -214,6 +269,9 @@ func (r PutSettings) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -221,6 +279,9 @@ func (r PutSettings) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/putsettings/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/putsettings/request.go index d21550b43..9ff7085f8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/putsettings/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/putsettings/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putsettings @@ -27,7 +27,7 @@ import ( // Request holds the request body struct for the package putsettings // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/put_settings/ClusterPutSettingsRequest.ts#L25-L43 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/put_settings/ClusterPutSettingsRequest.ts#L25-L43 type Request struct { Persistent map[string]json.RawMessage `json:"persistent,omitempty"` Transient map[string]json.RawMessage `json:"transient,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/putsettings/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/putsettings/response.go index 61fe52faf..0d022395b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/putsettings/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/putsettings/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putsettings @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package putsettings // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/put_settings/ClusterPutSettingsResponse.ts#L23-L29 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/put_settings/ClusterPutSettingsResponse.ts#L23-L29 type Response struct { Acknowledged bool `json:"acknowledged"` Persistent map[string]json.RawMessage `json:"persistent"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/remoteinfo/remote_info.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/remoteinfo/remote_info.go index fdf0c2846..44d3315c4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/remoteinfo/remote_info.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/remoteinfo/remote_info.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns the information about configured remote clusters. package remoteinfo import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -47,9 +46,13 @@ type RemoteInfo struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewRemoteInfo type alias for index. @@ -73,7 +76,12 @@ func New(tp elastictransport.Interface) *RemoteInfo { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,9 +116,9 @@ func (r *RemoteInfo) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -127,27 +135,66 @@ func (r *RemoteInfo) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r RemoteInfo) Perform(ctx context.Context) (*http.Response, error) { +func (r RemoteInfo) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cluster.remote_info") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cluster.remote_info") + if reader := instrument.RecordRequestBody(ctx, "cluster.remote_info", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cluster.remote_info") + } if err != nil { - return nil, fmt.Errorf("an error happened during the RemoteInfo query execution: %w", err) + localErr := fmt.Errorf("an error happened during the RemoteInfo query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a remoteinfo.Response -func (r RemoteInfo) Do(ctx context.Context) (Response, error) { +func (r RemoteInfo) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.remote_info") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -155,6 +202,9 @@ func (r RemoteInfo) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -164,6 +214,9 @@ func (r RemoteInfo) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -171,12 +224,25 @@ func (r RemoteInfo) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r RemoteInfo) IsSuccess(ctx context.Context) (bool, error) { +func (r RemoteInfo) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.remote_info") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -192,6 +258,14 @@ func (r RemoteInfo) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the RemoteInfo query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/remoteinfo/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/remoteinfo/response.go index 6c31fed8d..f65ab6867 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/remoteinfo/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/remoteinfo/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package remoteinfo @@ -32,7 +32,7 @@ import ( // Response holds the response body struct for the package remoteinfo // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/remote_info/ClusterRemoteInfoResponse.ts#L24-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/remote_info/ClusterRemoteInfoResponse.ts#L24-L26 type Response map[string]types.ClusterRemoteInfo diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/reroute/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/reroute/request.go index 53546d25c..b539fa2e4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/reroute/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/reroute/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package reroute @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package reroute // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/reroute/ClusterRerouteRequest.ts#L25-L70 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/reroute/ClusterRerouteRequest.ts#L25-L70 type Request struct { // Commands Defines the commands to perform. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/reroute/reroute.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/reroute/reroute.go index 9523f1a7f..e2b013297 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/reroute/reroute.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/reroute/reroute.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Allows to manually change the allocation of individual shards in the cluster. package reroute @@ -47,13 +47,17 @@ type Reroute struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewReroute type alias for index. @@ -77,11 +81,18 @@ func New(tp elastictransport.Interface) *Reroute { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -118,9 +129,7 @@ func (r *Reroute) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -132,6 +141,10 @@ func (r *Reroute) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -152,15 +165,15 @@ func (r *Reroute) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -177,27 +190,66 @@ func (r *Reroute) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Reroute) Perform(ctx context.Context) (*http.Response, error) { +func (r Reroute) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cluster.reroute") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cluster.reroute") + if reader := instrument.RecordRequestBody(ctx, "cluster.reroute", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cluster.reroute") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Reroute query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Reroute query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a reroute.Response -func (r Reroute) Do(ctx context.Context) (*Response, error) { +func (r Reroute) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.reroute") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -205,6 +257,9 @@ func (r Reroute) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -214,6 +269,9 @@ func (r Reroute) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -221,6 +279,9 @@ func (r Reroute) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/reroute/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/reroute/response.go index 3a6257629..1149ce442 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/reroute/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/reroute/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package reroute @@ -28,7 +28,7 @@ import ( // Response holds the response body struct for the package reroute // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/reroute/ClusterRerouteResponse.ts#L23-L34 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/reroute/ClusterRerouteResponse.ts#L23-L34 type Response struct { Acknowledged bool `json:"acknowledged"` Explanations []types.RerouteExplanation `json:"explanations,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/state/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/state/response.go index 722f72bdd..4cc4bc75b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/state/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/state/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package state @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package state // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/state/ClusterStateResponse.ts#L22-L29 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/state/ClusterStateResponse.ts#L22-L29 type Response = json.RawMessage diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/state/state.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/state/state.go index e226e4849..6c976fbbd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/state/state.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/state/state.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns a comprehensive information about the state of the cluster. package state import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -55,12 +54,16 @@ type State struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int metric string index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewState type alias for index. @@ -84,7 +87,12 @@ func New(tp elastictransport.Interface) *State { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -116,6 +124,9 @@ func (r *State) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("state") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "metric", r.metric) + } path.WriteString(r.metric) method = http.MethodGet @@ -126,9 +137,15 @@ func (r *State) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("state") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "metric", r.metric) + } path.WriteString(r.metric) path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) method = http.MethodGet @@ -142,9 +159,9 @@ func (r *State) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -161,27 +178,66 @@ func (r *State) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r State) Perform(ctx context.Context) (*http.Response, error) { +func (r State) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cluster.state") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cluster.state") + if reader := instrument.RecordRequestBody(ctx, "cluster.state", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cluster.state") + } if err != nil { - return nil, fmt.Errorf("an error happened during the State query execution: %w", err) + localErr := fmt.Errorf("an error happened during the State query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a state.Response -func (r State) Do(ctx context.Context) (Response, error) { +func (r State) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.state") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := new(Response) res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -189,6 +245,9 @@ func (r State) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -198,6 +257,9 @@ func (r State) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -205,12 +267,25 @@ func (r State) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r State) IsSuccess(ctx context.Context) (bool, error) { +func (r State) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.state") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -226,6 +301,14 @@ func (r State) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the State query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/stats/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/stats/response.go index 4045b5f08..ab91f9a58 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/stats/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/stats/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package stats @@ -27,7 +27,7 @@ import ( // Response holds the response body struct for the package stats // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/stats/ClusterStatsResponse.ts#L53-L55 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/stats/ClusterStatsResponse.ts#L53-L55 type Response struct { // ClusterName Name of the cluster, based on the cluster name setting. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/stats/stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/stats/stats.go index 3f42502a6..4373494b7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/stats/stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/cluster/stats/stats.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns high-level overview of cluster statistics. package stats import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type Stats struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int nodeid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewStats type alias for index. @@ -80,7 +83,12 @@ func New(tp elastictransport.Interface) *Stats { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -114,6 +122,9 @@ func (r *Stats) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("nodes") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "nodeid", r.nodeid) + } path.WriteString(r.nodeid) method = http.MethodGet @@ -127,9 +138,9 @@ func (r *Stats) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -146,27 +157,66 @@ func (r *Stats) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Stats) Perform(ctx context.Context) (*http.Response, error) { +func (r Stats) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "cluster.stats") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "cluster.stats") + if reader := instrument.RecordRequestBody(ctx, "cluster.stats", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "cluster.stats") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Stats query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Stats query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a stats.Response -func (r Stats) Do(ctx context.Context) (*Response, error) { +func (r Stats) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -174,6 +224,9 @@ func (r Stats) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -183,6 +236,9 @@ func (r Stats) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -190,12 +246,25 @@ func (r Stats) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Stats) IsSuccess(ctx context.Context) (bool, error) { +func (r Stats) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "cluster.stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -211,6 +280,14 @@ func (r Stats) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Stats query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/bulk/bulk.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/bulk/bulk.go index 0210f0505..de78106c5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/bulk/bulk.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/bulk/bulk.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Allows to perform multiple index/update/delete operations in a single // request. @@ -53,15 +53,19 @@ type Bulk struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewBulk type alias for index. @@ -86,7 +90,14 @@ func New(tp elastictransport.Interface) *Bulk { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -125,9 +136,7 @@ func (r *Bulk) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { for _, elem := range *r.req { data, err := json.Marshal(elem) @@ -144,6 +153,10 @@ func (r *Bulk) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -155,6 +168,9 @@ func (r *Bulk) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_bulk") @@ -170,15 +186,15 @@ func (r *Bulk) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+x-ndjson;compatible-with=8") } } @@ -195,27 +211,66 @@ func (r *Bulk) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Bulk) Perform(ctx context.Context) (*http.Response, error) { +func (r Bulk) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "bulk") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "bulk") + if reader := instrument.RecordRequestBody(ctx, "bulk", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "bulk") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Bulk query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Bulk query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a bulk.Response -func (r Bulk) Do(ctx context.Context) (*Response, error) { +func (r Bulk) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "bulk") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -223,6 +278,9 @@ func (r Bulk) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -232,6 +290,9 @@ func (r Bulk) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -239,6 +300,9 @@ func (r Bulk) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/bulk/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/bulk/request.go index 2f8a92791..0e86424d7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/bulk/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/bulk/request.go @@ -16,11 +16,11 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package bulk // Request holds the request body struct for the package bulk // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/bulk/BulkRequest.ts#L32-L103 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/bulk/BulkRequest.ts#L32-L103 type Request = []interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/bulk/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/bulk/response.go index 404a54e6a..aee9ad8ee 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/bulk/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/bulk/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package bulk @@ -27,7 +27,7 @@ import ( // Response holds the response body struct for the package bulk // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/bulk/BulkResponse.ts#L24-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/bulk/BulkResponse.ts#L24-L31 type Response struct { Errors bool `json:"errors"` IngestTook *int64 `json:"ingest_took,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/clearscroll/clear_scroll.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/clearscroll/clear_scroll.go index e83e67b4e..eb0658427 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/clearscroll/clear_scroll.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/clearscroll/clear_scroll.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Explicitly clears the search context for a scroll. package clearscroll @@ -51,15 +51,19 @@ type ClearScroll struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int scrollid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewClearScroll type alias for index. @@ -83,11 +87,18 @@ func New(tp elastictransport.Interface) *ClearScroll { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -124,9 +135,7 @@ func (r *ClearScroll) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -138,6 +147,10 @@ func (r *ClearScroll) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -155,6 +168,9 @@ func (r *ClearScroll) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("scroll") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "scrollid", r.scrollid) + } path.WriteString(r.scrollid) method = http.MethodDelete @@ -168,15 +184,15 @@ func (r *ClearScroll) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -193,27 +209,66 @@ func (r *ClearScroll) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ClearScroll) Perform(ctx context.Context) (*http.Response, error) { +func (r ClearScroll) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "clear_scroll") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "clear_scroll") + if reader := instrument.RecordRequestBody(ctx, "clear_scroll", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "clear_scroll") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ClearScroll query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ClearScroll query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a clearscroll.Response -func (r ClearScroll) Do(ctx context.Context) (*Response, error) { +func (r ClearScroll) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "clear_scroll") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -221,6 +276,9 @@ func (r ClearScroll) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -230,30 +288,45 @@ func (r ClearScroll) Do(ctx context.Context) (*Response, error) { if res.StatusCode == 404 { data, err := ioutil.ReadAll(res.Body) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } errorResponse := types.NewElasticsearchError() err = json.NewDecoder(gobytes.NewReader(data)).Decode(&errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } if errorResponse.Status == 0 { err = json.NewDecoder(gobytes.NewReader(data)).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } return response, nil } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -261,6 +334,9 @@ func (r ClearScroll) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/clearscroll/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/clearscroll/request.go index 3ea2213f6..7f8792119 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/clearscroll/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/clearscroll/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package clearscroll @@ -27,7 +27,7 @@ import ( // Request holds the request body struct for the package clearscroll // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/clear_scroll/ClearScrollRequest.ts#L23-L45 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/clear_scroll/ClearScrollRequest.ts#L23-L45 type Request struct { // ScrollId Scroll IDs to clear. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/clearscroll/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/clearscroll/response.go index f19e9ab3c..eb14ed820 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/clearscroll/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/clearscroll/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package clearscroll // Response holds the response body struct for the package clearscroll // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/clear_scroll/ClearScrollResponse.ts#L22-L36 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/clear_scroll/ClearScrollResponse.ts#L22-L36 type Response struct { NumFreed int `json:"num_freed"` Succeeded bool `json:"succeeded"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/closepointintime/close_point_in_time.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/closepointintime/close_point_in_time.go index f786ba2e8..1dfeb74da 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/closepointintime/close_point_in_time.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/closepointintime/close_point_in_time.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Close a point in time package closepointintime @@ -47,13 +47,17 @@ type ClosePointInTime struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewClosePointInTime type alias for index. @@ -77,11 +81,18 @@ func New(tp elastictransport.Interface) *ClosePointInTime { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -118,9 +129,7 @@ func (r *ClosePointInTime) HttpRequest(ctx context.Context) (*http.Request, erro } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -132,6 +141,10 @@ func (r *ClosePointInTime) HttpRequest(ctx context.Context) (*http.Request, erro } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -150,15 +163,15 @@ func (r *ClosePointInTime) HttpRequest(ctx context.Context) (*http.Request, erro } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -175,27 +188,66 @@ func (r *ClosePointInTime) HttpRequest(ctx context.Context) (*http.Request, erro } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ClosePointInTime) Perform(ctx context.Context) (*http.Response, error) { +func (r ClosePointInTime) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "close_point_in_time") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "close_point_in_time") + if reader := instrument.RecordRequestBody(ctx, "close_point_in_time", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "close_point_in_time") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ClosePointInTime query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ClosePointInTime query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a closepointintime.Response -func (r ClosePointInTime) Do(ctx context.Context) (*Response, error) { +func (r ClosePointInTime) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "close_point_in_time") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -203,6 +255,9 @@ func (r ClosePointInTime) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -212,30 +267,45 @@ func (r ClosePointInTime) Do(ctx context.Context) (*Response, error) { if res.StatusCode == 404 { data, err := ioutil.ReadAll(res.Body) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } errorResponse := types.NewElasticsearchError() err = json.NewDecoder(gobytes.NewReader(data)).Decode(&errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } if errorResponse.Status == 0 { err = json.NewDecoder(gobytes.NewReader(data)).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } return response, nil } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -243,6 +313,9 @@ func (r ClosePointInTime) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/closepointintime/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/closepointintime/request.go index 113e16274..c6272ec3c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/closepointintime/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/closepointintime/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package closepointintime @@ -27,7 +27,7 @@ import ( // Request holds the request body struct for the package closepointintime // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/close_point_in_time/ClosePointInTimeRequest.ts#L23-L37 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/close_point_in_time/ClosePointInTimeRequest.ts#L23-L37 type Request struct { // Id The ID of the point-in-time. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/closepointintime/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/closepointintime/response.go index b97eea8ed..2e543c10f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/closepointintime/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/closepointintime/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package closepointintime // Response holds the response body struct for the package closepointintime // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/close_point_in_time/ClosePointInTimeResponse.ts#L22-L36 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/close_point_in_time/ClosePointInTimeResponse.ts#L22-L36 type Response struct { NumFreed int `json:"num_freed"` Succeeded bool `json:"succeeded"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/count/count.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/count/count.go index f2a1170c5..d3cba3e2d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/count/count.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/count/count.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns number of documents matching a query. package count @@ -53,15 +53,19 @@ type Count struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewCount type alias for index. @@ -85,11 +89,18 @@ func New(tp elastictransport.Interface) *Count { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -126,9 +137,7 @@ func (r *Count) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -140,6 +149,10 @@ func (r *Count) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -151,6 +164,9 @@ func (r *Count) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_count") @@ -166,15 +182,15 @@ func (r *Count) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -191,27 +207,66 @@ func (r *Count) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Count) Perform(ctx context.Context) (*http.Response, error) { +func (r Count) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "count") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "count") + if reader := instrument.RecordRequestBody(ctx, "count", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "count") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Count query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Count query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a count.Response -func (r Count) Do(ctx context.Context) (*Response, error) { +func (r Count) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "count") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -219,6 +274,9 @@ func (r Count) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -228,6 +286,9 @@ func (r Count) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -235,6 +296,9 @@ func (r Count) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/count/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/count/request.go index 2e72b7d68..d2d5c9ae0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/count/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/count/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package count @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package count // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/count/CountRequest.ts#L26-L120 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/count/CountRequest.ts#L26-L120 type Request struct { // Query Defines the search definition using the Query DSL. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/count/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/count/response.go index 21162cd23..944479c4b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/count/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/count/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package count @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package count // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/count/CountResponse.ts#L23-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/count/CountResponse.ts#L23-L25 type Response struct { Count int64 `json:"count"` Shards_ types.ShardStatistics `json:"_shards"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/create/create.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/create/create.go index f784c5fc7..fb6534f5a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/create/create.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/create/create.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates a new document in the index. // @@ -57,16 +57,20 @@ type Create struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req interface{} deferred []func(request interface{}) error - raw io.Reader + buf *gobytes.Buffer paramSet int id string index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewCreate type alias for index. @@ -97,7 +101,14 @@ func New(tp elastictransport.Interface) *Create { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -143,9 +154,7 @@ func (r *Create) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -157,17 +166,27 @@ func (r *Create) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { case r.paramSet == indexMask|idMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_create") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodPut @@ -181,15 +200,15 @@ func (r *Create) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -206,27 +225,66 @@ func (r *Create) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Create) Perform(ctx context.Context) (*http.Response, error) { +func (r Create) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "create") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "create") + if reader := instrument.RecordRequestBody(ctx, "create", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "create") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Create query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Create query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a create.Response -func (r Create) Do(ctx context.Context) (*Response, error) { +func (r Create) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "create") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -234,6 +292,9 @@ func (r Create) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -243,6 +304,9 @@ func (r Create) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -250,6 +314,9 @@ func (r Create) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/create/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/create/request.go index 8a61ac507..7c33b723d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/create/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/create/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package create @@ -26,5 +26,5 @@ import ( // Request holds the request body struct for the package create // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/create/CreateRequest.ts#L32-L95 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/create/CreateRequest.ts#L32-L95 type Request = json.RawMessage diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/create/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/create/response.go index 86f01ae97..605e3b5b4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/create/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/create/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package create @@ -27,7 +27,7 @@ import ( // Response holds the response body struct for the package create // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/create/CreateResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/create/CreateResponse.ts#L22-L24 type Response struct { ForcedRefresh *bool `json:"forced_refresh,omitempty"` Id_ string `json:"_id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/delete/delete.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/delete/delete.go index 5be0de488..a016bc2a5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/delete/delete.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/delete/delete.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Removes a document from the index. package delete @@ -55,12 +55,16 @@ type Delete struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDelete type alias for index. @@ -88,7 +92,12 @@ func New(tp elastictransport.Interface) *Delete { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -109,11 +118,17 @@ func (r *Delete) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask|idMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_doc") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodDelete @@ -127,9 +142,9 @@ func (r *Delete) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -146,27 +161,66 @@ func (r *Delete) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Delete) Perform(ctx context.Context) (*http.Response, error) { +func (r Delete) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "delete") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "delete") + if reader := instrument.RecordRequestBody(ctx, "delete", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "delete") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Delete query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Delete query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a delete.Response -func (r Delete) Do(ctx context.Context) (*Response, error) { +func (r Delete) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "delete") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -174,6 +228,9 @@ func (r Delete) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -183,30 +240,45 @@ func (r Delete) Do(ctx context.Context) (*Response, error) { if res.StatusCode == 404 { data, err := ioutil.ReadAll(res.Body) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } errorResponse := types.NewElasticsearchError() err = json.NewDecoder(gobytes.NewReader(data)).Decode(&errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } if errorResponse.Status == 0 { err = json.NewDecoder(gobytes.NewReader(data)).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } return response, nil } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -214,12 +286,25 @@ func (r Delete) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Delete) IsSuccess(ctx context.Context) (bool, error) { +func (r Delete) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "delete") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -235,6 +320,14 @@ func (r Delete) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Delete query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/delete/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/delete/response.go index 4e7eeba82..a8b646fb1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/delete/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/delete/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package delete @@ -27,7 +27,7 @@ import ( // Response holds the response body struct for the package delete // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/delete/DeleteResponse.ts#L22-L34 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/delete/DeleteResponse.ts#L22-L34 type Response struct { ForcedRefresh *bool `json:"forced_refresh,omitempty"` Id_ string `json:"_id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/deletebyquery/delete_by_query.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/deletebyquery/delete_by_query.go index c4342df53..83dc1c14e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/deletebyquery/delete_by_query.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/deletebyquery/delete_by_query.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes documents matching the provided query. package deletebyquery @@ -55,15 +55,19 @@ type DeleteByQuery struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteByQuery type alias for index. @@ -89,11 +93,18 @@ func New(tp elastictransport.Interface) *DeleteByQuery { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -130,9 +141,7 @@ func (r *DeleteByQuery) HttpRequest(ctx context.Context) (*http.Request, error) } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -144,12 +153,19 @@ func (r *DeleteByQuery) HttpRequest(ctx context.Context) (*http.Request, error) } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_delete_by_query") @@ -165,15 +181,15 @@ func (r *DeleteByQuery) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -190,27 +206,66 @@ func (r *DeleteByQuery) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteByQuery) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteByQuery) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "delete_by_query") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "delete_by_query") + if reader := instrument.RecordRequestBody(ctx, "delete_by_query", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "delete_by_query") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteByQuery query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteByQuery query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deletebyquery.Response -func (r DeleteByQuery) Do(ctx context.Context) (*Response, error) { +func (r DeleteByQuery) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "delete_by_query") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -218,6 +273,9 @@ func (r DeleteByQuery) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -227,6 +285,9 @@ func (r DeleteByQuery) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -234,6 +295,9 @@ func (r DeleteByQuery) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/deletebyquery/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/deletebyquery/request.go index 277ce99bc..bd14a198c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/deletebyquery/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/deletebyquery/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deletebyquery @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package deletebyquery // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/delete_by_query/DeleteByQueryRequest.ts#L36-L209 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/delete_by_query/DeleteByQueryRequest.ts#L36-L209 type Request struct { // MaxDocs The maximum number of documents to delete. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/deletebyquery/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/deletebyquery/response.go index 7bfbeee91..d0144e599 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/deletebyquery/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/deletebyquery/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deletebyquery @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package deletebyquery // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/delete_by_query/DeleteByQueryResponse.ts#L26-L45 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/delete_by_query/DeleteByQueryResponse.ts#L26-L45 type Response struct { Batches *int64 `json:"batches,omitempty"` Deleted *int64 `json:"deleted,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/deletebyqueryrethrottle/delete_by_query_rethrottle.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/deletebyqueryrethrottle/delete_by_query_rethrottle.go index e4c20d8cc..851195eb9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/deletebyqueryrethrottle/delete_by_query_rethrottle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/deletebyqueryrethrottle/delete_by_query_rethrottle.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Changes the number of requests per second for a particular Delete By Query // operation. package deletebyqueryrethrottle import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type DeleteByQueryRethrottle struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int taskid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteByQueryRethrottle type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *DeleteByQueryRethrottle { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *DeleteByQueryRethrottle) HttpRequest(ctx context.Context) (*http.Reques path.WriteString("_delete_by_query") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "taskid", r.taskid) + } path.WriteString(r.taskid) path.WriteString("/") path.WriteString("_rethrottle") @@ -121,9 +132,9 @@ func (r *DeleteByQueryRethrottle) HttpRequest(ctx context.Context) (*http.Reques } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -140,27 +151,66 @@ func (r *DeleteByQueryRethrottle) HttpRequest(ctx context.Context) (*http.Reques } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteByQueryRethrottle) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteByQueryRethrottle) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "delete_by_query_rethrottle") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "delete_by_query_rethrottle") + if reader := instrument.RecordRequestBody(ctx, "delete_by_query_rethrottle", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "delete_by_query_rethrottle") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteByQueryRethrottle query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteByQueryRethrottle query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deletebyqueryrethrottle.Response -func (r DeleteByQueryRethrottle) Do(ctx context.Context) (*Response, error) { +func (r DeleteByQueryRethrottle) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "delete_by_query_rethrottle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -168,6 +218,9 @@ func (r DeleteByQueryRethrottle) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -177,6 +230,9 @@ func (r DeleteByQueryRethrottle) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,12 +240,25 @@ func (r DeleteByQueryRethrottle) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteByQueryRethrottle) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteByQueryRethrottle) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "delete_by_query_rethrottle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -205,6 +274,14 @@ func (r DeleteByQueryRethrottle) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteByQueryRethrottle query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/deletebyqueryrethrottle/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/deletebyqueryrethrottle/response.go index 5486728fd..b1b3a32c3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/deletebyqueryrethrottle/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/deletebyqueryrethrottle/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deletebyqueryrethrottle @@ -31,7 +31,7 @@ import ( // Response holds the response body struct for the package deletebyqueryrethrottle // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/delete_by_query_rethrottle/DeleteByQueryRethrottleResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/delete_by_query_rethrottle/DeleteByQueryRethrottleResponse.ts#L22-L24 type Response struct { NodeFailures []types.ErrorCause `json:"node_failures,omitempty"` // Nodes Task information grouped by node, if `group_by` was set to `node` (the diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/deletescript/delete_script.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/deletescript/delete_script.go index fc64617b2..20dc93c0b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/deletescript/delete_script.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/deletescript/delete_script.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes a script. package deletescript import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type DeleteScript struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteScript type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *DeleteScript { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *DeleteScript) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_scripts") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodDelete @@ -117,9 +128,9 @@ func (r *DeleteScript) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -136,27 +147,66 @@ func (r *DeleteScript) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteScript) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteScript) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "delete_script") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "delete_script") + if reader := instrument.RecordRequestBody(ctx, "delete_script", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "delete_script") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteScript query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteScript query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deletescript.Response -func (r DeleteScript) Do(ctx context.Context) (*Response, error) { +func (r DeleteScript) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "delete_script") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -164,6 +214,9 @@ func (r DeleteScript) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -173,6 +226,9 @@ func (r DeleteScript) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -180,12 +236,25 @@ func (r DeleteScript) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteScript) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteScript) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "delete_script") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -201,6 +270,14 @@ func (r DeleteScript) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteScript query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/deletescript/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/deletescript/response.go index 756c414b1..6b7a82f9c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/deletescript/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/deletescript/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deletescript // Response holds the response body struct for the package deletescript // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/delete_script/DeleteScriptResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/delete_script/DeleteScriptResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/exists/exists.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/exists/exists.go index 664beeecd..adf9b1ed8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/exists/exists.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/exists/exists.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns information about whether a document exists in an index. package exists import ( - gobytes "bytes" "context" "errors" "fmt" @@ -53,12 +52,16 @@ type Exists struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewExists type alias for index. @@ -86,7 +89,12 @@ func New(tp elastictransport.Interface) *Exists { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -107,11 +115,17 @@ func (r *Exists) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask|idMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_doc") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodHead @@ -125,9 +139,9 @@ func (r *Exists) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -144,15 +158,42 @@ func (r *Exists) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Exists) Perform(ctx context.Context) (*http.Response, error) { +func (r Exists) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "exists") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "exists") + if reader := instrument.RecordRequestBody(ctx, "exists", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "exists") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Exists query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Exists query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil @@ -165,7 +206,17 @@ func (r Exists) Do(ctx context.Context) (bool, error) { // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Exists) IsSuccess(ctx context.Context) (bool, error) { +func (r Exists) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "exists") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -181,6 +232,14 @@ func (r Exists) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Exists query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/existssource/exists_source.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/existssource/exists_source.go index 16b7f1ada..33bf60681 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/existssource/exists_source.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/existssource/exists_source.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns information about whether a document source exists in an index. package existssource import ( - gobytes "bytes" "context" "errors" "fmt" @@ -53,12 +52,16 @@ type ExistsSource struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewExistsSource type alias for index. @@ -86,7 +89,12 @@ func New(tp elastictransport.Interface) *ExistsSource { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -107,11 +115,17 @@ func (r *ExistsSource) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask|idMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_source") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodHead @@ -125,9 +139,9 @@ func (r *ExistsSource) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -144,15 +158,42 @@ func (r *ExistsSource) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ExistsSource) Perform(ctx context.Context) (*http.Response, error) { +func (r ExistsSource) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "exists_source") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "exists_source") + if reader := instrument.RecordRequestBody(ctx, "exists_source", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "exists_source") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ExistsSource query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ExistsSource query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil @@ -165,7 +206,17 @@ func (r ExistsSource) Do(ctx context.Context) (bool, error) { // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ExistsSource) IsSuccess(ctx context.Context) (bool, error) { +func (r ExistsSource) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "exists_source") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -181,6 +232,14 @@ func (r ExistsSource) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ExistsSource query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/explain/explain.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/explain/explain.go index c6665e067..d828c8357 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/explain/explain.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/explain/explain.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns information about why a specific matches (or doesn't match) a query. package explain @@ -54,16 +54,20 @@ type Explain struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int id string index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewExplain type alias for index. @@ -91,11 +95,18 @@ func New(tp elastictransport.Interface) *Explain { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -132,9 +143,7 @@ func (r *Explain) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -146,17 +155,27 @@ func (r *Explain) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { case r.paramSet == indexMask|idMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_explain") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodPost @@ -170,15 +189,15 @@ func (r *Explain) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -195,27 +214,66 @@ func (r *Explain) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Explain) Perform(ctx context.Context) (*http.Response, error) { +func (r Explain) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "explain") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "explain") + if reader := instrument.RecordRequestBody(ctx, "explain", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "explain") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Explain query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Explain query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a explain.Response -func (r Explain) Do(ctx context.Context) (*Response, error) { +func (r Explain) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "explain") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -223,6 +281,9 @@ func (r Explain) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -232,6 +293,9 @@ func (r Explain) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -239,6 +303,9 @@ func (r Explain) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/explain/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/explain/request.go index ae83f8b7c..021013721 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/explain/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/explain/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package explain @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package explain // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/explain/ExplainRequest.ts#L26-L105 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/explain/ExplainRequest.ts#L26-L105 type Request struct { // Query Defines the search definition using the Query DSL. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/explain/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/explain/response.go index fa85491aa..6f5b43b88 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/explain/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/explain/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package explain @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package explain // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/explain/ExplainResponse.ts#L23-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/explain/ExplainResponse.ts#L23-L31 type Response struct { Explanation *types.ExplanationDetail `json:"explanation,omitempty"` Get *types.InlineGet `json:"get,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/fieldcaps/field_caps.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/fieldcaps/field_caps.go index c3570abf7..9bc0d3f6d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/fieldcaps/field_caps.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/fieldcaps/field_caps.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns the information about the capabilities of fields among multiple // indices. @@ -53,15 +53,19 @@ type FieldCaps struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewFieldCaps type alias for index. @@ -86,11 +90,18 @@ func New(tp elastictransport.Interface) *FieldCaps { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -127,9 +138,7 @@ func (r *FieldCaps) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -141,6 +150,10 @@ func (r *FieldCaps) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -152,6 +165,9 @@ func (r *FieldCaps) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_field_caps") @@ -167,15 +183,15 @@ func (r *FieldCaps) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -192,27 +208,66 @@ func (r *FieldCaps) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r FieldCaps) Perform(ctx context.Context) (*http.Response, error) { +func (r FieldCaps) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "field_caps") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "field_caps") + if reader := instrument.RecordRequestBody(ctx, "field_caps", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "field_caps") + } if err != nil { - return nil, fmt.Errorf("an error happened during the FieldCaps query execution: %w", err) + localErr := fmt.Errorf("an error happened during the FieldCaps query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a fieldcaps.Response -func (r FieldCaps) Do(ctx context.Context) (*Response, error) { +func (r FieldCaps) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "field_caps") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -220,6 +275,9 @@ func (r FieldCaps) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -229,6 +287,9 @@ func (r FieldCaps) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -236,6 +297,9 @@ func (r FieldCaps) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/fieldcaps/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/fieldcaps/request.go index 8c84506c5..da6c0aa23 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/fieldcaps/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/fieldcaps/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package fieldcaps @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package fieldcaps // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/field_caps/FieldCapabilitiesRequest.ts#L25-L99 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/field_caps/FieldCapabilitiesRequest.ts#L25-L99 type Request struct { // Fields List of fields to retrieve capabilities for. Wildcard (`*`) expressions are diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/fieldcaps/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/fieldcaps/response.go index e34e0d3fa..cf78d5064 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/fieldcaps/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/fieldcaps/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package fieldcaps @@ -31,7 +31,7 @@ import ( // Response holds the response body struct for the package fieldcaps // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/field_caps/FieldCapabilitiesResponse.ts#L24-L35 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/field_caps/FieldCapabilitiesResponse.ts#L24-L35 type Response struct { Fields map[string]map[string]types.FieldCapability `json:"fields"` Indices []string `json:"indices"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/get/get.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/get/get.go index cf1fde076..14444f59c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/get/get.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/get/get.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns a document. package get @@ -55,12 +55,16 @@ type Get struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGet type alias for index. @@ -88,7 +92,12 @@ func New(tp elastictransport.Interface) *Get { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -109,11 +118,17 @@ func (r *Get) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask|idMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_doc") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodGet @@ -127,9 +142,9 @@ func (r *Get) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -146,27 +161,66 @@ func (r *Get) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Get) Perform(ctx context.Context) (*http.Response, error) { +func (r Get) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "get") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "get") + if reader := instrument.RecordRequestBody(ctx, "get", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "get") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Get query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Get query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a get.Response -func (r Get) Do(ctx context.Context) (*Response, error) { +func (r Get) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "get") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -174,6 +228,9 @@ func (r Get) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -183,30 +240,45 @@ func (r Get) Do(ctx context.Context) (*Response, error) { if res.StatusCode == 404 { data, err := ioutil.ReadAll(res.Body) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } errorResponse := types.NewElasticsearchError() err = json.NewDecoder(gobytes.NewReader(data)).Decode(&errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } if errorResponse.Status == 0 { err = json.NewDecoder(gobytes.NewReader(data)).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } return response, nil } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -214,12 +286,25 @@ func (r Get) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Get) IsSuccess(ctx context.Context) (bool, error) { +func (r Get) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "get") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -235,6 +320,14 @@ func (r Get) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Get query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/get/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/get/response.go index 0d3cd5e5c..3c5a31d94 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/get/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/get/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package get @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package get // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/get/GetResponse.ts#L23-L34 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/get/GetResponse.ts#L23-L34 type Response struct { Fields map[string]json.RawMessage `json:"fields,omitempty"` Found bool `json:"found"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/getscript/get_script.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/getscript/get_script.go index eecc1e756..7b72bdbca 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/getscript/get_script.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/getscript/get_script.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns a script. package getscript import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type GetScript struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetScript type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *GetScript { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *GetScript) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_scripts") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodGet @@ -117,9 +128,9 @@ func (r *GetScript) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -136,27 +147,66 @@ func (r *GetScript) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetScript) Perform(ctx context.Context) (*http.Response, error) { +func (r GetScript) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "get_script") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "get_script") + if reader := instrument.RecordRequestBody(ctx, "get_script", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "get_script") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetScript query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetScript query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getscript.Response -func (r GetScript) Do(ctx context.Context) (*Response, error) { +func (r GetScript) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "get_script") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -164,6 +214,9 @@ func (r GetScript) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -173,6 +226,9 @@ func (r GetScript) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -180,12 +236,25 @@ func (r GetScript) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetScript) IsSuccess(ctx context.Context) (bool, error) { +func (r GetScript) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "get_script") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -201,6 +270,14 @@ func (r GetScript) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetScript query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/getscript/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/getscript/response.go index bcc1d62ad..5833a8049 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/getscript/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/getscript/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getscript @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getscript // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/get_script/GetScriptResponse.ts#L23-L29 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/get_script/GetScriptResponse.ts#L23-L29 type Response struct { Found bool `json:"found"` Id_ string `json:"_id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/getscriptcontext/get_script_context.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/getscriptcontext/get_script_context.go index 9cbc7ebc7..c4dd65627 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/getscriptcontext/get_script_context.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/getscriptcontext/get_script_context.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns all script contexts. package getscriptcontext import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -47,9 +46,13 @@ type GetScriptContext struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetScriptContext type alias for index. @@ -73,7 +76,12 @@ func New(tp elastictransport.Interface) *GetScriptContext { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,9 +114,9 @@ func (r *GetScriptContext) HttpRequest(ctx context.Context) (*http.Request, erro } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -125,27 +133,66 @@ func (r *GetScriptContext) HttpRequest(ctx context.Context) (*http.Request, erro } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetScriptContext) Perform(ctx context.Context) (*http.Response, error) { +func (r GetScriptContext) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "get_script_context") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "get_script_context") + if reader := instrument.RecordRequestBody(ctx, "get_script_context", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "get_script_context") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetScriptContext query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetScriptContext query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getscriptcontext.Response -func (r GetScriptContext) Do(ctx context.Context) (*Response, error) { +func (r GetScriptContext) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "get_script_context") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -153,6 +200,9 @@ func (r GetScriptContext) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -162,6 +212,9 @@ func (r GetScriptContext) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -169,12 +222,25 @@ func (r GetScriptContext) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetScriptContext) IsSuccess(ctx context.Context) (bool, error) { +func (r GetScriptContext) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "get_script_context") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -190,6 +256,14 @@ func (r GetScriptContext) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetScriptContext query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/getscriptcontext/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/getscriptcontext/response.go index 34e9a300f..826e33787 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/getscriptcontext/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/getscriptcontext/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getscriptcontext @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getscriptcontext // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/get_script_context/GetScriptContextResponse.ts#L22-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/get_script_context/GetScriptContextResponse.ts#L22-L26 type Response struct { Contexts []types.GetScriptContext `json:"contexts"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/getscriptlanguages/get_script_languages.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/getscriptlanguages/get_script_languages.go index 1500dda86..0904a0738 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/getscriptlanguages/get_script_languages.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/getscriptlanguages/get_script_languages.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns available script types, languages and contexts package getscriptlanguages import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -47,9 +46,13 @@ type GetScriptLanguages struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetScriptLanguages type alias for index. @@ -73,7 +76,12 @@ func New(tp elastictransport.Interface) *GetScriptLanguages { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,9 +114,9 @@ func (r *GetScriptLanguages) HttpRequest(ctx context.Context) (*http.Request, er } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -125,27 +133,66 @@ func (r *GetScriptLanguages) HttpRequest(ctx context.Context) (*http.Request, er } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetScriptLanguages) Perform(ctx context.Context) (*http.Response, error) { +func (r GetScriptLanguages) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "get_script_languages") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "get_script_languages") + if reader := instrument.RecordRequestBody(ctx, "get_script_languages", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "get_script_languages") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetScriptLanguages query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetScriptLanguages query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getscriptlanguages.Response -func (r GetScriptLanguages) Do(ctx context.Context) (*Response, error) { +func (r GetScriptLanguages) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "get_script_languages") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -153,6 +200,9 @@ func (r GetScriptLanguages) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -162,6 +212,9 @@ func (r GetScriptLanguages) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -169,12 +222,25 @@ func (r GetScriptLanguages) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetScriptLanguages) IsSuccess(ctx context.Context) (bool, error) { +func (r GetScriptLanguages) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "get_script_languages") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -190,6 +256,14 @@ func (r GetScriptLanguages) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetScriptLanguages query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/getscriptlanguages/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/getscriptlanguages/response.go index cf4ae4896..79ff02dbe 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/getscriptlanguages/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/getscriptlanguages/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getscriptlanguages @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getscriptlanguages // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/get_script_languages/GetScriptLanguagesResponse.ts#L22-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/get_script_languages/GetScriptLanguagesResponse.ts#L22-L27 type Response struct { LanguageContexts []types.LanguageContext `json:"language_contexts"` TypesAllowed []string `json:"types_allowed"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/getsource/get_source.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/getsource/get_source.go index 6db7b47aa..40e755676 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/getsource/get_source.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/getsource/get_source.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns the source of a document. package getsource import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -55,12 +54,16 @@ type GetSource struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetSource type alias for index. @@ -88,7 +91,12 @@ func New(tp elastictransport.Interface) *GetSource { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -109,11 +117,17 @@ func (r *GetSource) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask|idMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_source") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodGet @@ -127,9 +141,9 @@ func (r *GetSource) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -146,27 +160,66 @@ func (r *GetSource) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetSource) Perform(ctx context.Context) (*http.Response, error) { +func (r GetSource) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "get_source") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "get_source") + if reader := instrument.RecordRequestBody(ctx, "get_source", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "get_source") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetSource query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetSource query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getsource.Response -func (r GetSource) Do(ctx context.Context) (Response, error) { +func (r GetSource) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "get_source") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := new(Response) res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -174,6 +227,9 @@ func (r GetSource) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -183,6 +239,9 @@ func (r GetSource) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -190,12 +249,25 @@ func (r GetSource) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetSource) IsSuccess(ctx context.Context) (bool, error) { +func (r GetSource) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "get_source") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -211,6 +283,14 @@ func (r GetSource) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetSource query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/getsource/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/getsource/response.go index e92c4fbf7..6eaf7ab5c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/getsource/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/getsource/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getsource @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getsource // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/get_source/SourceResponse.ts#L20-L22 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/get_source/SourceResponse.ts#L20-L22 type Response = json.RawMessage diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/healthreport/health_report.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/healthreport/health_report.go index 77c1fce7e..88d0e3b62 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/healthreport/health_report.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/healthreport/health_report.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns the health of the cluster. package healthreport import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type HealthReport struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int feature string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewHealthReport type alias for index. @@ -80,7 +83,12 @@ func New(tp elastictransport.Interface) *HealthReport { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,6 +116,9 @@ func (r *HealthReport) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_health_report") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "feature", r.feature) + } path.WriteString(r.feature) method = http.MethodGet @@ -121,9 +132,9 @@ func (r *HealthReport) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -140,27 +151,66 @@ func (r *HealthReport) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r HealthReport) Perform(ctx context.Context) (*http.Response, error) { +func (r HealthReport) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "health_report") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "health_report") + if reader := instrument.RecordRequestBody(ctx, "health_report", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "health_report") + } if err != nil { - return nil, fmt.Errorf("an error happened during the HealthReport query execution: %w", err) + localErr := fmt.Errorf("an error happened during the HealthReport query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a healthreport.Response -func (r HealthReport) Do(ctx context.Context) (*Response, error) { +func (r HealthReport) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "health_report") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -168,6 +218,9 @@ func (r HealthReport) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -177,6 +230,9 @@ func (r HealthReport) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,12 +240,25 @@ func (r HealthReport) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r HealthReport) IsSuccess(ctx context.Context) (bool, error) { +func (r HealthReport) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "health_report") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -205,6 +274,14 @@ func (r HealthReport) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the HealthReport query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/healthreport/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/healthreport/response.go index 4fbfcecd7..2d056f4a7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/healthreport/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/healthreport/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package healthreport @@ -27,7 +27,7 @@ import ( // Response holds the response body struct for the package healthreport // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/health_report/Response.ts#L22-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/health_report/Response.ts#L22-L28 type Response struct { ClusterName string `json:"cluster_name"` Indicators types.Indicators `json:"indicators"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/index/index.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/index/index.go index ecb47cfb5..6d5268bde 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/index/index.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/index/index.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates or updates a document in an index. package index @@ -56,16 +56,20 @@ type Index struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req interface{} deferred []func(request interface{}) error - raw io.Reader + buf *gobytes.Buffer paramSet int id string index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewIndex type alias for index. @@ -91,7 +95,14 @@ func New(tp elastictransport.Interface) *Index { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -137,9 +148,7 @@ func (r *Index) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -151,23 +160,36 @@ func (r *Index) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { case r.paramSet == indexMask|idMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_doc") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodPut case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_doc") @@ -183,15 +205,15 @@ func (r *Index) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -208,27 +230,66 @@ func (r *Index) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Index) Perform(ctx context.Context) (*http.Response, error) { +func (r Index) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "index") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "index") + if reader := instrument.RecordRequestBody(ctx, "index", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "index") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Index query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Index query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a index.Response -func (r Index) Do(ctx context.Context) (*Response, error) { +func (r Index) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "index") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -236,6 +297,9 @@ func (r Index) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -245,6 +309,9 @@ func (r Index) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -252,6 +319,9 @@ func (r Index) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/index/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/index/request.go index 04cad9bac..a335053ca 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/index/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/index/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package index @@ -26,5 +26,5 @@ import ( // Request holds the request body struct for the package index // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/index/IndexRequest.ts#L35-L117 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/index/IndexRequest.ts#L35-L117 type Request = json.RawMessage diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/index/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/index/response.go index c8ed7a23a..c1e37099d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/index/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/index/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package index @@ -27,7 +27,7 @@ import ( // Response holds the response body struct for the package index // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/index/IndexResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/index/IndexResponse.ts#L22-L24 type Response struct { ForcedRefresh *bool `json:"forced_refresh,omitempty"` Id_ string `json:"_id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/info/info.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/info/info.go index 6f5ab415c..69866f5f9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/info/info.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/info/info.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns basic information about the cluster. package info import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -47,9 +46,13 @@ type Info struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewInfo type alias for index. @@ -73,7 +76,12 @@ func New(tp elastictransport.Interface) *Info { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,9 +112,9 @@ func (r *Info) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -123,27 +131,66 @@ func (r *Info) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Info) Perform(ctx context.Context) (*http.Response, error) { +func (r Info) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "info") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "info") + if reader := instrument.RecordRequestBody(ctx, "info", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "info") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Info query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Info query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a info.Response -func (r Info) Do(ctx context.Context) (*Response, error) { +func (r Info) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "info") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -151,6 +198,9 @@ func (r Info) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -160,6 +210,9 @@ func (r Info) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -167,12 +220,25 @@ func (r Info) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Info) IsSuccess(ctx context.Context) (bool, error) { +func (r Info) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "info") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -188,6 +254,14 @@ func (r Info) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Info query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/info/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/info/response.go index 083b42513..56519689e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/info/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/info/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package info @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package info // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/info/RootNodeInfoResponse.ts#L23-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/info/RootNodeInfoResponse.ts#L23-L31 type Response struct { ClusterName string `json:"cluster_name"` ClusterUuid string `json:"cluster_uuid"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/knnsearch/knn_search.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/knnsearch/knn_search.go index cab8e1b05..06ff6446c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/knnsearch/knn_search.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/knnsearch/knn_search.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Performs a kNN search. package knnsearch @@ -50,15 +50,19 @@ type KnnSearch struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewKnnSearch type alias for index. @@ -84,11 +88,18 @@ func New(tp elastictransport.Interface) *KnnSearch { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -125,9 +136,7 @@ func (r *KnnSearch) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -139,12 +148,19 @@ func (r *KnnSearch) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_knn_search") @@ -160,15 +176,15 @@ func (r *KnnSearch) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -185,27 +201,66 @@ func (r *KnnSearch) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r KnnSearch) Perform(ctx context.Context) (*http.Response, error) { +func (r KnnSearch) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "knn_search") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "knn_search") + if reader := instrument.RecordRequestBody(ctx, "knn_search", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "knn_search") + } if err != nil { - return nil, fmt.Errorf("an error happened during the KnnSearch query execution: %w", err) + localErr := fmt.Errorf("an error happened during the KnnSearch query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a knnsearch.Response -func (r KnnSearch) Do(ctx context.Context) (*Response, error) { +func (r KnnSearch) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "knn_search") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -213,6 +268,9 @@ func (r KnnSearch) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -222,6 +280,9 @@ func (r KnnSearch) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -229,6 +290,9 @@ func (r KnnSearch) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/knnsearch/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/knnsearch/request.go index 6d60c3f88..595e7aa23 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/knnsearch/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/knnsearch/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package knnsearch @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package knnsearch // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/knn_search/KnnSearchRequest.ts#L27-L80 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/knn_search/KnnSearchRequest.ts#L27-L80 type Request struct { // DocvalueFields The request returns doc values for field names matching these patterns diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/knnsearch/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/knnsearch/response.go index babe91294..4cb43fbd3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/knnsearch/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/knnsearch/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package knnsearch @@ -28,7 +28,7 @@ import ( // Response holds the response body struct for the package knnsearch // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/knn_search/KnnSearchResponse.ts#L26-L54 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/knn_search/KnnSearchResponse.ts#L26-L54 type Response struct { // Fields Contains field values for the documents. These fields diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/mget/mget.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/mget/mget.go index d4b910a10..e150db781 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/mget/mget.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/mget/mget.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Allows to get multiple documents in one request. package mget @@ -51,15 +51,19 @@ type Mget struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewMget type alias for index. @@ -83,11 +87,18 @@ func New(tp elastictransport.Interface) *Mget { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -124,9 +135,7 @@ func (r *Mget) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -138,6 +147,10 @@ func (r *Mget) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -149,6 +162,9 @@ func (r *Mget) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_mget") @@ -164,15 +180,15 @@ func (r *Mget) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -189,27 +205,66 @@ func (r *Mget) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Mget) Perform(ctx context.Context) (*http.Response, error) { +func (r Mget) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "mget") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "mget") + if reader := instrument.RecordRequestBody(ctx, "mget", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "mget") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Mget query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Mget query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a mget.Response -func (r Mget) Do(ctx context.Context) (*Response, error) { +func (r Mget) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "mget") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -217,6 +272,9 @@ func (r Mget) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -226,6 +284,9 @@ func (r Mget) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -233,6 +294,9 @@ func (r Mget) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/mget/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/mget/request.go index e2f45e8ed..685170341 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/mget/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/mget/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package mget @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package mget // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/mget/MultiGetRequest.ts#L25-L91 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/mget/MultiGetRequest.ts#L25-L91 type Request struct { // Docs The documents you want to retrieve. Required if no index is specified in the diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/mget/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/mget/response.go index ff7fe881e..8d205eef3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/mget/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/mget/response.go @@ -16,17 +16,22 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package mget import ( + "bytes" + "encoding/json" + "errors" + "io" + "github.com/elastic/go-elasticsearch/v8/typedapi/types" ) // Response holds the response body struct for the package mget // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/mget/MultiGetResponse.ts#L22-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/mget/MultiGetResponse.ts#L22-L26 type Response struct { Docs []types.MgetResponseItem `json:"docs"` } @@ -36,3 +41,63 @@ func NewResponse() *Response { r := &Response{} return r } + +func (s *Response) UnmarshalJSON(data []byte) error { + dec := json.NewDecoder(bytes.NewReader(data)) + + for { + t, err := dec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "docs": + messageArray := []json.RawMessage{} + if err := dec.Decode(&messageArray); err != nil { + return err + } + docs: + for _, message := range messageArray { + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "fields", "found", "_primary_term", "_routing", "_seq_no", "_source", "_version": + o := types.NewGetResult() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Docs = append(s.Docs, o) + continue docs + + case "error": + o := types.NewMultiGetError() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Docs = append(s.Docs, o) + continue docs + + } + } + } + + } + } + return nil +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/msearch/msearch.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/msearch/msearch.go index b1e235762..c8e534dc0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/msearch/msearch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/msearch/msearch.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Allows to execute several search operations in one request. package msearch @@ -53,15 +53,19 @@ type Msearch struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewMsearch type alias for index. @@ -85,7 +89,14 @@ func New(tp elastictransport.Interface) *Msearch { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -124,9 +135,7 @@ func (r *Msearch) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { for _, elem := range *r.req { data, err := json.Marshal(elem) @@ -143,6 +152,10 @@ func (r *Msearch) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -154,6 +167,9 @@ func (r *Msearch) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_msearch") @@ -169,15 +185,15 @@ func (r *Msearch) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+x-ndjson;compatible-with=8") } } @@ -194,22 +210,58 @@ func (r *Msearch) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Msearch) Perform(ctx context.Context) (*http.Response, error) { +func (r Msearch) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "msearch") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "msearch") + if reader := instrument.RecordRequestBody(ctx, "msearch", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "msearch") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Msearch query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Msearch query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a msearch.Response -func (r Msearch) Do(ctx context.Context) (*Response, error) { +func (r Msearch) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "msearch") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() @@ -217,6 +269,9 @@ func (r Msearch) Do(ctx context.Context) (*Response, error) { res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -224,6 +279,9 @@ func (r Msearch) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -233,6 +291,9 @@ func (r Msearch) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -240,6 +301,9 @@ func (r Msearch) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/msearch/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/msearch/request.go index e5f8447e9..47834c66c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/msearch/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/msearch/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package msearch @@ -26,5 +26,5 @@ import ( // Request holds the request body struct for the package msearch // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/msearch/MultiSearchRequest.ts#L25-L96 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/msearch/MultiSearchRequest.ts#L25-L96 type Request = []types.MsearchRequestItem diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/msearch/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/msearch/response.go index 738ceb3ef..9b52c7297 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/msearch/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/msearch/response.go @@ -16,17 +16,23 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package msearch import ( + "bytes" + "encoding/json" + "errors" + "io" + "strconv" + "github.com/elastic/go-elasticsearch/v8/typedapi/types" ) // Response holds the response body struct for the package msearch // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/msearch/MultiSearchResponse.ts#L25-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/msearch/MultiSearchResponse.ts#L25-L27 type Response struct { Responses []types.MsearchResponseItem `json:"responses"` Took int64 `json:"took"` @@ -37,3 +43,78 @@ func NewResponse() *Response { r := &Response{} return r } + +func (s *Response) UnmarshalJSON(data []byte) error { + dec := json.NewDecoder(bytes.NewReader(data)) + + for { + t, err := dec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "responses": + messageArray := []json.RawMessage{} + if err := dec.Decode(&messageArray); err != nil { + return err + } + responses: + for _, message := range messageArray { + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "aggregations", "_clusters", "fields", "hits", "max_score", "num_reduce_phases", "pit_id", "profile", "_scroll_id", "_shards", "suggest", "terminated_early", "timed_out", "took": + o := types.NewMultiSearchItem() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Responses = append(s.Responses, o) + continue responses + + case "error": + o := types.NewErrorResponseBase() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Responses = append(s.Responses, o) + continue responses + + } + } + } + + case "took": + var tmp interface{} + dec.Decode(&tmp) + switch v := tmp.(type) { + case string: + value, err := strconv.ParseInt(v, 10, 64) + if err != nil { + return err + } + s.Took = value + case float64: + f := int64(v) + s.Took = f + } + + } + } + return nil +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/msearchtemplate/msearch_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/msearchtemplate/msearch_template.go index 1ae181c16..6fcc5bb70 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/msearchtemplate/msearch_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/msearchtemplate/msearch_template.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Allows to execute several search template operations in one request. package msearchtemplate @@ -52,15 +52,19 @@ type MsearchTemplate struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewMsearchTemplate type alias for index. @@ -84,7 +88,14 @@ func New(tp elastictransport.Interface) *MsearchTemplate { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -123,9 +134,7 @@ func (r *MsearchTemplate) HttpRequest(ctx context.Context) (*http.Request, error } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { for _, elem := range *r.req { data, err := json.Marshal(elem) @@ -142,6 +151,10 @@ func (r *MsearchTemplate) HttpRequest(ctx context.Context) (*http.Request, error } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -155,6 +168,9 @@ func (r *MsearchTemplate) HttpRequest(ctx context.Context) (*http.Request, error case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_msearch") @@ -172,15 +188,15 @@ func (r *MsearchTemplate) HttpRequest(ctx context.Context) (*http.Request, error } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+x-ndjson;compatible-with=8") } } @@ -197,22 +213,58 @@ func (r *MsearchTemplate) HttpRequest(ctx context.Context) (*http.Request, error } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r MsearchTemplate) Perform(ctx context.Context) (*http.Response, error) { +func (r MsearchTemplate) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "msearch_template") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "msearch_template") + if reader := instrument.RecordRequestBody(ctx, "msearch_template", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "msearch_template") + } if err != nil { - return nil, fmt.Errorf("an error happened during the MsearchTemplate query execution: %w", err) + localErr := fmt.Errorf("an error happened during the MsearchTemplate query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a msearchtemplate.Response -func (r MsearchTemplate) Do(ctx context.Context) (*Response, error) { +func (r MsearchTemplate) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "msearch_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() @@ -220,6 +272,9 @@ func (r MsearchTemplate) Do(ctx context.Context) (*Response, error) { res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -227,6 +282,9 @@ func (r MsearchTemplate) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -236,6 +294,9 @@ func (r MsearchTemplate) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -243,6 +304,9 @@ func (r MsearchTemplate) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/msearchtemplate/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/msearchtemplate/request.go index 1b9c55968..4b40a4f7d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/msearchtemplate/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/msearchtemplate/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package msearchtemplate @@ -26,5 +26,5 @@ import ( // Request holds the request body struct for the package msearchtemplate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/msearch_template/MultiSearchTemplateRequest.ts#L25-L70 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/msearch_template/MultiSearchTemplateRequest.ts#L25-L70 type Request = []types.RequestItem diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/msearchtemplate/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/msearchtemplate/response.go index 0e6144627..208f4c711 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/msearchtemplate/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/msearchtemplate/response.go @@ -16,17 +16,23 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package msearchtemplate import ( + "bytes" + "encoding/json" + "errors" + "io" + "strconv" + "github.com/elastic/go-elasticsearch/v8/typedapi/types" ) // Response holds the response body struct for the package msearchtemplate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/msearch_template/MultiSearchTemplateResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/msearch_template/MultiSearchTemplateResponse.ts#L22-L24 type Response struct { Responses []types.MsearchResponseItem `json:"responses"` Took int64 `json:"took"` @@ -37,3 +43,78 @@ func NewResponse() *Response { r := &Response{} return r } + +func (s *Response) UnmarshalJSON(data []byte) error { + dec := json.NewDecoder(bytes.NewReader(data)) + + for { + t, err := dec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "responses": + messageArray := []json.RawMessage{} + if err := dec.Decode(&messageArray); err != nil { + return err + } + responses: + for _, message := range messageArray { + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "aggregations", "_clusters", "fields", "hits", "max_score", "num_reduce_phases", "pit_id", "profile", "_scroll_id", "_shards", "suggest", "terminated_early", "timed_out", "took": + o := types.NewMultiSearchItem() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Responses = append(s.Responses, o) + continue responses + + case "error": + o := types.NewErrorResponseBase() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Responses = append(s.Responses, o) + continue responses + + } + } + } + + case "took": + var tmp interface{} + dec.Decode(&tmp) + switch v := tmp.(type) { + case string: + value, err := strconv.ParseInt(v, 10, 64) + if err != nil { + return err + } + s.Took = value + case float64: + f := int64(v) + s.Took = f + } + + } + } + return nil +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/mtermvectors/mtermvectors.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/mtermvectors/mtermvectors.go index 55bff8b89..f2e8386f6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/mtermvectors/mtermvectors.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/mtermvectors/mtermvectors.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns multiple termvectors in one request. package mtermvectors @@ -52,15 +52,19 @@ type Mtermvectors struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewMtermvectors type alias for index. @@ -84,11 +88,18 @@ func New(tp elastictransport.Interface) *Mtermvectors { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -125,9 +136,7 @@ func (r *Mtermvectors) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -139,6 +148,10 @@ func (r *Mtermvectors) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -150,6 +163,9 @@ func (r *Mtermvectors) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_mtermvectors") @@ -165,15 +181,15 @@ func (r *Mtermvectors) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -190,27 +206,66 @@ func (r *Mtermvectors) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Mtermvectors) Perform(ctx context.Context) (*http.Response, error) { +func (r Mtermvectors) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "mtermvectors") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "mtermvectors") + if reader := instrument.RecordRequestBody(ctx, "mtermvectors", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "mtermvectors") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Mtermvectors query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Mtermvectors query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a mtermvectors.Response -func (r Mtermvectors) Do(ctx context.Context) (*Response, error) { +func (r Mtermvectors) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "mtermvectors") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -218,6 +273,9 @@ func (r Mtermvectors) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -227,6 +285,9 @@ func (r Mtermvectors) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -234,6 +295,9 @@ func (r Mtermvectors) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/mtermvectors/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/mtermvectors/request.go index 1e33e44ae..ebe5cdcc2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/mtermvectors/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/mtermvectors/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package mtermvectors @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package mtermvectors // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/mtermvectors/MultiTermVectorsRequest.ts#L31-L109 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/mtermvectors/MultiTermVectorsRequest.ts#L31-L109 type Request struct { // Docs Array of existing or artificial documents. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/mtermvectors/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/mtermvectors/response.go index 689124732..3de00d78a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/mtermvectors/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/mtermvectors/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package mtermvectors @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package mtermvectors // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/mtermvectors/MultiTermVectorsResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/mtermvectors/MultiTermVectorsResponse.ts#L22-L24 type Response struct { Docs []types.TermVectorsResult `json:"docs"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/openpointintime/open_point_in_time.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/openpointintime/open_point_in_time.go index fcd6b1751..168628325 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/openpointintime/open_point_in_time.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/openpointintime/open_point_in_time.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Open a point in time that can be used in subsequent searches package openpointintime import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,11 +52,15 @@ type OpenPointInTime struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewOpenPointInTime type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *OpenPointInTime { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *OpenPointInTime) HttpRequest(ctx context.Context) (*http.Request, error case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_pit") @@ -119,9 +130,9 @@ func (r *OpenPointInTime) HttpRequest(ctx context.Context) (*http.Request, error } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -138,27 +149,66 @@ func (r *OpenPointInTime) HttpRequest(ctx context.Context) (*http.Request, error } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r OpenPointInTime) Perform(ctx context.Context) (*http.Response, error) { +func (r OpenPointInTime) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "open_point_in_time") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "open_point_in_time") + if reader := instrument.RecordRequestBody(ctx, "open_point_in_time", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "open_point_in_time") + } if err != nil { - return nil, fmt.Errorf("an error happened during the OpenPointInTime query execution: %w", err) + localErr := fmt.Errorf("an error happened during the OpenPointInTime query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a openpointintime.Response -func (r OpenPointInTime) Do(ctx context.Context) (*Response, error) { +func (r OpenPointInTime) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "open_point_in_time") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -166,6 +216,9 @@ func (r OpenPointInTime) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,6 +228,9 @@ func (r OpenPointInTime) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,12 +238,25 @@ func (r OpenPointInTime) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r OpenPointInTime) IsSuccess(ctx context.Context) (bool, error) { +func (r OpenPointInTime) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "open_point_in_time") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -203,6 +272,14 @@ func (r OpenPointInTime) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the OpenPointInTime query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/openpointintime/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/openpointintime/response.go index 7dbd0fbf1..612021e92 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/openpointintime/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/openpointintime/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package openpointintime // Response holds the response body struct for the package openpointintime // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/open_point_in_time/OpenPointInTimeResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/open_point_in_time/OpenPointInTimeResponse.ts#L22-L24 type Response struct { Id string `json:"id"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/ping/ping.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/ping/ping.go index f423acbba..5257b7f8b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/ping/ping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/ping/ping.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns whether the cluster is running. package ping import ( - gobytes "bytes" "context" "errors" "fmt" @@ -45,9 +44,13 @@ type Ping struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPing type alias for index. @@ -71,7 +74,12 @@ func New(tp elastictransport.Interface) *Ping { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -102,9 +110,9 @@ func (r *Ping) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -121,15 +129,42 @@ func (r *Ping) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Ping) Perform(ctx context.Context) (*http.Response, error) { +func (r Ping) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ping") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ping") + if reader := instrument.RecordRequestBody(ctx, "ping", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ping") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Ping query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Ping query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil @@ -142,7 +177,17 @@ func (r Ping) Do(ctx context.Context) (bool, error) { // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Ping) IsSuccess(ctx context.Context) (bool, error) { +func (r Ping) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ping") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -158,6 +203,14 @@ func (r Ping) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Ping query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/putscript/put_script.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/putscript/put_script.go index 0479beda4..165eaab56 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/putscript/put_script.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/putscript/put_script.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates or updates a script. package putscript @@ -52,16 +52,20 @@ type PutScript struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int id string context string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutScript type alias for index. @@ -87,11 +91,18 @@ func New(tp elastictransport.Interface) *PutScript { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -128,9 +139,7 @@ func (r *PutScript) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -142,6 +151,10 @@ func (r *PutScript) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -150,6 +163,9 @@ func (r *PutScript) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_scripts") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodPut @@ -158,9 +174,15 @@ func (r *PutScript) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_scripts") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "context", r.context) + } path.WriteString(r.context) method = http.MethodPut @@ -174,15 +196,15 @@ func (r *PutScript) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -199,27 +221,66 @@ func (r *PutScript) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutScript) Perform(ctx context.Context) (*http.Response, error) { +func (r PutScript) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "put_script") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "put_script") + if reader := instrument.RecordRequestBody(ctx, "put_script", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "put_script") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutScript query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutScript query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a putscript.Response -func (r PutScript) Do(ctx context.Context) (*Response, error) { +func (r PutScript) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "put_script") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -227,6 +288,9 @@ func (r PutScript) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -236,6 +300,9 @@ func (r PutScript) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -243,6 +310,9 @@ func (r PutScript) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/putscript/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/putscript/request.go index f60f70376..713645732 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/putscript/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/putscript/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putscript @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package putscript // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/put_script/PutScriptRequest.ts#L25-L64 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/put_script/PutScriptRequest.ts#L25-L64 type Request struct { // Script Contains the script or search template, its parameters, and its language. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/putscript/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/putscript/response.go index 03549dc37..ee39bb196 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/putscript/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/putscript/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putscript // Response holds the response body struct for the package putscript // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/put_script/PutScriptResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/put_script/PutScriptResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/rankeval/rank_eval.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/rankeval/rank_eval.go index d11bfaca3..73cc6b6d1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/rankeval/rank_eval.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/rankeval/rank_eval.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Allows to evaluate the quality of ranked search results over a set of typical // search queries @@ -53,15 +53,19 @@ type RankEval struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewRankEval type alias for index. @@ -86,11 +90,18 @@ func New(tp elastictransport.Interface) *RankEval { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -127,9 +138,7 @@ func (r *RankEval) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -141,6 +150,10 @@ func (r *RankEval) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -152,6 +165,9 @@ func (r *RankEval) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_rank_eval") @@ -167,15 +183,15 @@ func (r *RankEval) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -192,27 +208,66 @@ func (r *RankEval) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r RankEval) Perform(ctx context.Context) (*http.Response, error) { +func (r RankEval) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "rank_eval") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "rank_eval") + if reader := instrument.RecordRequestBody(ctx, "rank_eval", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "rank_eval") + } if err != nil { - return nil, fmt.Errorf("an error happened during the RankEval query execution: %w", err) + localErr := fmt.Errorf("an error happened during the RankEval query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a rankeval.Response -func (r RankEval) Do(ctx context.Context) (*Response, error) { +func (r RankEval) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "rank_eval") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -220,6 +275,9 @@ func (r RankEval) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -229,6 +287,9 @@ func (r RankEval) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -236,6 +297,9 @@ func (r RankEval) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/rankeval/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/rankeval/request.go index afeb6375f..80acc6b8f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/rankeval/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/rankeval/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package rankeval @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package rankeval // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/rank_eval/RankEvalRequest.ts#L24-L61 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/rank_eval/RankEvalRequest.ts#L24-L61 type Request struct { // Metric Definition of the evaluation metric to calculate. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/rankeval/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/rankeval/response.go index a516cece9..33065cf84 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/rankeval/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/rankeval/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package rankeval @@ -28,7 +28,7 @@ import ( // Response holds the response body struct for the package rankeval // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/rank_eval/RankEvalResponse.ts#L26-L34 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/rank_eval/RankEvalResponse.ts#L26-L34 type Response struct { // Details The details section contains one entry for every query in the original diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/reindex/reindex.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/reindex/reindex.go index 33b9d97ca..a51a50176 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/reindex/reindex.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/reindex/reindex.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Allows to copy documents from one index to another, optionally filtering the // source @@ -52,13 +52,17 @@ type Reindex struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewReindex type alias for index. @@ -86,11 +90,18 @@ func New(tp elastictransport.Interface) *Reindex { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -127,9 +138,7 @@ func (r *Reindex) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -141,6 +150,10 @@ func (r *Reindex) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -159,15 +172,15 @@ func (r *Reindex) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -184,27 +197,66 @@ func (r *Reindex) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Reindex) Perform(ctx context.Context) (*http.Response, error) { +func (r Reindex) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "reindex") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "reindex") + if reader := instrument.RecordRequestBody(ctx, "reindex", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "reindex") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Reindex query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Reindex query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a reindex.Response -func (r Reindex) Do(ctx context.Context) (*Response, error) { +func (r Reindex) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "reindex") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -212,6 +264,9 @@ func (r Reindex) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -221,6 +276,9 @@ func (r Reindex) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -228,6 +286,9 @@ func (r Reindex) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/reindex/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/reindex/request.go index 6da93dbf0..336b75988 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/reindex/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/reindex/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package reindex @@ -30,7 +30,7 @@ import ( // Request holds the request body struct for the package reindex // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/reindex/ReindexRequest.ts#L27-L101 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/reindex/ReindexRequest.ts#L27-L101 type Request struct { // Conflicts Set to proceed to continue reindexing even if there are conflicts. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/reindex/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/reindex/response.go index 5891c63aa..fbc602589 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/reindex/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/reindex/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package reindex @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package reindex // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/reindex/ReindexResponse.ts#L26-L45 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/reindex/ReindexResponse.ts#L26-L45 type Response struct { Batches *int64 `json:"batches,omitempty"` Created *int64 `json:"created,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/reindexrethrottle/reindex_rethrottle.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/reindexrethrottle/reindex_rethrottle.go index 0e323c7c9..f94456097 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/reindexrethrottle/reindex_rethrottle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/reindexrethrottle/reindex_rethrottle.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Changes the number of requests per second for a particular Reindex operation. package reindexrethrottle import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type ReindexRethrottle struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int taskid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewReindexRethrottle type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *ReindexRethrottle { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *ReindexRethrottle) HttpRequest(ctx context.Context) (*http.Request, err path.WriteString("_reindex") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "taskid", r.taskid) + } path.WriteString(r.taskid) path.WriteString("/") path.WriteString("_rethrottle") @@ -119,9 +130,9 @@ func (r *ReindexRethrottle) HttpRequest(ctx context.Context) (*http.Request, err } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -138,27 +149,66 @@ func (r *ReindexRethrottle) HttpRequest(ctx context.Context) (*http.Request, err } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ReindexRethrottle) Perform(ctx context.Context) (*http.Response, error) { +func (r ReindexRethrottle) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "reindex_rethrottle") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "reindex_rethrottle") + if reader := instrument.RecordRequestBody(ctx, "reindex_rethrottle", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "reindex_rethrottle") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ReindexRethrottle query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ReindexRethrottle query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a reindexrethrottle.Response -func (r ReindexRethrottle) Do(ctx context.Context) (*Response, error) { +func (r ReindexRethrottle) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "reindex_rethrottle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -166,6 +216,9 @@ func (r ReindexRethrottle) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,6 +228,9 @@ func (r ReindexRethrottle) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,12 +238,25 @@ func (r ReindexRethrottle) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ReindexRethrottle) IsSuccess(ctx context.Context) (bool, error) { +func (r ReindexRethrottle) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "reindex_rethrottle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -203,6 +272,14 @@ func (r ReindexRethrottle) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ReindexRethrottle query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/reindexrethrottle/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/reindexrethrottle/response.go index 0a126ed01..f1992790b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/reindexrethrottle/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/reindexrethrottle/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package reindexrethrottle @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package reindexrethrottle // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/reindex_rethrottle/ReindexRethrottleResponse.ts#L23-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/reindex_rethrottle/ReindexRethrottleResponse.ts#L23-L25 type Response struct { Nodes map[string]types.ReindexNode `json:"nodes"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/rendersearchtemplate/render_search_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/rendersearchtemplate/render_search_template.go index aadfeecbe..7de92a9a1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/rendersearchtemplate/render_search_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/rendersearchtemplate/render_search_template.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Allows to use the Mustache language to pre-render a search definition. package rendersearchtemplate @@ -50,15 +50,19 @@ type RenderSearchTemplate struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewRenderSearchTemplate type alias for index. @@ -82,11 +86,18 @@ func New(tp elastictransport.Interface) *RenderSearchTemplate { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -123,9 +134,7 @@ func (r *RenderSearchTemplate) HttpRequest(ctx context.Context) (*http.Request, } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -137,6 +146,10 @@ func (r *RenderSearchTemplate) HttpRequest(ctx context.Context) (*http.Request, } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -154,6 +167,9 @@ func (r *RenderSearchTemplate) HttpRequest(ctx context.Context) (*http.Request, path.WriteString("template") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodPost @@ -167,15 +183,15 @@ func (r *RenderSearchTemplate) HttpRequest(ctx context.Context) (*http.Request, } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -192,27 +208,66 @@ func (r *RenderSearchTemplate) HttpRequest(ctx context.Context) (*http.Request, } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r RenderSearchTemplate) Perform(ctx context.Context) (*http.Response, error) { +func (r RenderSearchTemplate) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "render_search_template") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "render_search_template") + if reader := instrument.RecordRequestBody(ctx, "render_search_template", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "render_search_template") + } if err != nil { - return nil, fmt.Errorf("an error happened during the RenderSearchTemplate query execution: %w", err) + localErr := fmt.Errorf("an error happened during the RenderSearchTemplate query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a rendersearchtemplate.Response -func (r RenderSearchTemplate) Do(ctx context.Context) (*Response, error) { +func (r RenderSearchTemplate) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "render_search_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -220,6 +275,9 @@ func (r RenderSearchTemplate) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -229,6 +287,9 @@ func (r RenderSearchTemplate) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -236,6 +297,9 @@ func (r RenderSearchTemplate) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/rendersearchtemplate/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/rendersearchtemplate/request.go index 232e00f08..a7d1cf26e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/rendersearchtemplate/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/rendersearchtemplate/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package rendersearchtemplate @@ -27,7 +27,7 @@ import ( // Request holds the request body struct for the package rendersearchtemplate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/render_search_template/RenderSearchTemplateRequest.ts#L25-L55 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/render_search_template/RenderSearchTemplateRequest.ts#L25-L55 type Request struct { File *string `json:"file,omitempty"` // Params Key-value pairs used to replace Mustache variables in the template. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/rendersearchtemplate/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/rendersearchtemplate/response.go index 5b78e7ef9..f72311913 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/rendersearchtemplate/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/rendersearchtemplate/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package rendersearchtemplate @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package rendersearchtemplate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/render_search_template/RenderSearchTemplateResponse.ts#L23-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/render_search_template/RenderSearchTemplateResponse.ts#L23-L25 type Response struct { TemplateOutput map[string]json.RawMessage `json:"template_output"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/scriptspainlessexecute/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/scriptspainlessexecute/request.go index 26b3fadcf..a00f6079b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/scriptspainlessexecute/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/scriptspainlessexecute/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package scriptspainlessexecute @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package scriptspainlessexecute // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/scripts_painless_execute/ExecutePainlessScriptRequest.ts#L24-L46 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/scripts_painless_execute/ExecutePainlessScriptRequest.ts#L24-L46 type Request struct { // Context The context that the script should run in. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/scriptspainlessexecute/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/scriptspainlessexecute/response.go index f05938bc1..4e17bd0f9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/scriptspainlessexecute/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/scriptspainlessexecute/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package scriptspainlessexecute @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package scriptspainlessexecute // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/scripts_painless_execute/ExecutePainlessScriptResponse.ts#L20-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/scripts_painless_execute/ExecutePainlessScriptResponse.ts#L20-L24 type Response struct { Result json.RawMessage `json:"result,omitempty"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/scriptspainlessexecute/scripts_painless_execute.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/scriptspainlessexecute/scripts_painless_execute.go index c8b5eb694..fd5fa10e5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/scriptspainlessexecute/scripts_painless_execute.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/scriptspainlessexecute/scripts_painless_execute.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Allows an arbitrary script to be executed and a result to be returned package scriptspainlessexecute @@ -46,13 +46,17 @@ type ScriptsPainlessExecute struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewScriptsPainlessExecute type alias for index. @@ -76,11 +80,18 @@ func New(tp elastictransport.Interface) *ScriptsPainlessExecute { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -117,9 +128,7 @@ func (r *ScriptsPainlessExecute) HttpRequest(ctx context.Context) (*http.Request } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -131,6 +140,10 @@ func (r *ScriptsPainlessExecute) HttpRequest(ctx context.Context) (*http.Request } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -153,15 +166,15 @@ func (r *ScriptsPainlessExecute) HttpRequest(ctx context.Context) (*http.Request } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -178,27 +191,66 @@ func (r *ScriptsPainlessExecute) HttpRequest(ctx context.Context) (*http.Request } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ScriptsPainlessExecute) Perform(ctx context.Context) (*http.Response, error) { +func (r ScriptsPainlessExecute) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "scripts_painless_execute") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "scripts_painless_execute") + if reader := instrument.RecordRequestBody(ctx, "scripts_painless_execute", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "scripts_painless_execute") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ScriptsPainlessExecute query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ScriptsPainlessExecute query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a scriptspainlessexecute.Response -func (r ScriptsPainlessExecute) Do(ctx context.Context) (*Response, error) { +func (r ScriptsPainlessExecute) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "scripts_painless_execute") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -206,6 +258,9 @@ func (r ScriptsPainlessExecute) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -215,6 +270,9 @@ func (r ScriptsPainlessExecute) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -222,6 +280,9 @@ func (r ScriptsPainlessExecute) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/scroll/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/scroll/request.go index 5dbfa7b76..f78f69542 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/scroll/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/scroll/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package scroll @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package scroll // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/scroll/ScrollRequest.ts#L24-L59 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/scroll/ScrollRequest.ts#L24-L59 type Request struct { // Scroll Period to retain the search context for scrolling. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/scroll/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/scroll/response.go index 289f9f413..28fe9776d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/scroll/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/scroll/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package scroll @@ -33,7 +33,7 @@ import ( // Response holds the response body struct for the package scroll // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/scroll/ScrollResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/scroll/ScrollResponse.ts#L22-L24 type Response struct { Aggregations map[string]types.Aggregate `json:"aggregations,omitempty"` Clusters_ *types.ClusterStatistics `json:"_clusters,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/scroll/scroll.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/scroll/scroll.go index f2f729edf..99ebf3273 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/scroll/scroll.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/scroll/scroll.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Allows to retrieve a large numbers of results from a single search request. package scroll @@ -51,15 +51,19 @@ type Scroll struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int scrollid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewScroll type alias for index. @@ -83,11 +87,18 @@ func New(tp elastictransport.Interface) *Scroll { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -124,9 +135,7 @@ func (r *Scroll) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -138,6 +147,10 @@ func (r *Scroll) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -155,6 +168,9 @@ func (r *Scroll) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("scroll") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "scrollid", r.scrollid) + } path.WriteString(r.scrollid) method = http.MethodPost @@ -168,15 +184,15 @@ func (r *Scroll) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -193,27 +209,66 @@ func (r *Scroll) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Scroll) Perform(ctx context.Context) (*http.Response, error) { +func (r Scroll) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "scroll") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "scroll") + if reader := instrument.RecordRequestBody(ctx, "scroll", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "scroll") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Scroll query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Scroll query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a scroll.Response -func (r Scroll) Do(ctx context.Context) (*Response, error) { +func (r Scroll) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "scroll") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -221,6 +276,9 @@ func (r Scroll) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -230,6 +288,9 @@ func (r Scroll) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -237,6 +298,9 @@ func (r Scroll) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/search/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/search/request.go index 44492cdcf..59744d87e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/search/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/search/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package search @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package search // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/SearchRequest.ts#L53-L506 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/SearchRequest.ts#L53-L506 type Request struct { // Aggregations Defines the aggregations that are run as part of the search request. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/search/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/search/response.go index 5caaafc25..78660f663 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/search/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/search/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package search @@ -33,7 +33,7 @@ import ( // Response holds the response body struct for the package search // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/SearchResponse.ts#L34-L36 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/SearchResponse.ts#L34-L36 type Response struct { Aggregations map[string]types.Aggregate `json:"aggregations,omitempty"` Clusters_ *types.ClusterStatistics `json:"_clusters,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/search/search.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/search/search.go index 35006b7f9..ab1f52cd0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/search/search.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/search/search.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns results matching a query. package search @@ -55,15 +55,19 @@ type Search struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewSearch type alias for index. @@ -87,11 +91,18 @@ func New(tp elastictransport.Interface) *Search { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -128,9 +139,7 @@ func (r *Search) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -142,6 +151,10 @@ func (r *Search) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -153,6 +166,9 @@ func (r *Search) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_search") @@ -168,15 +184,15 @@ func (r *Search) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -193,22 +209,58 @@ func (r *Search) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Search) Perform(ctx context.Context) (*http.Response, error) { +func (r Search) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "search") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "search") + if reader := instrument.RecordRequestBody(ctx, "search", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "search") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Search query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Search query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a search.Response -func (r Search) Do(ctx context.Context) (*Response, error) { +func (r Search) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "search") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() @@ -216,6 +268,9 @@ func (r Search) Do(ctx context.Context) (*Response, error) { res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -223,6 +278,9 @@ func (r Search) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -232,6 +290,9 @@ func (r Search) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -239,6 +300,9 @@ func (r Search) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/searchmvt/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/searchmvt/request.go index e48bd7f4a..c3e61d96b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/searchmvt/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/searchmvt/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package searchmvt @@ -31,7 +31,7 @@ import ( // Request holds the request body struct for the package searchmvt // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search_mvt/SearchMvtRequest.ts#L33-L188 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search_mvt/SearchMvtRequest.ts#L33-L188 type Request struct { // Aggs Sub-aggregations for the geotile_grid. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/searchmvt/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/searchmvt/response.go index 3913a05db..518569dcf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/searchmvt/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/searchmvt/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package searchmvt // Response holds the response body struct for the package searchmvt // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search_mvt/SearchMvtResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search_mvt/SearchMvtResponse.ts#L22-L24 type Response = []byte diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/searchmvt/search_mvt.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/searchmvt/search_mvt.go index d898d5fea..26d139e98 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/searchmvt/search_mvt.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/searchmvt/search_mvt.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Searches a vector tile for geospatial values. Returns results as a binary // Mapbox vector tile. @@ -61,11 +61,11 @@ type SearchMvt struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int @@ -74,6 +74,10 @@ type SearchMvt struct { zoom string x string y string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewSearchMvt type alias for index. @@ -108,11 +112,18 @@ func New(tp elastictransport.Interface) *SearchMvt { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -149,9 +160,7 @@ func (r *SearchMvt) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -163,26 +172,45 @@ func (r *SearchMvt) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { case r.paramSet == indexMask|fieldMask|zoomMask|xMask|yMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_mvt") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "field", r.field) + } path.WriteString(r.field) path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "zoom", r.zoom) + } path.WriteString(r.zoom) path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "x", r.x) + } path.WriteString(r.x) path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "y", r.y) + } path.WriteString(r.y) method = http.MethodPost @@ -196,15 +224,15 @@ func (r *SearchMvt) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/json") } } @@ -221,27 +249,66 @@ func (r *SearchMvt) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r SearchMvt) Perform(ctx context.Context) (*http.Response, error) { +func (r SearchMvt) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "search_mvt") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "search_mvt") + if reader := instrument.RecordRequestBody(ctx, "search_mvt", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "search_mvt") + } if err != nil { - return nil, fmt.Errorf("an error happened during the SearchMvt query execution: %w", err) + localErr := fmt.Errorf("an error happened during the SearchMvt query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a searchmvt.Response -func (r SearchMvt) Do(ctx context.Context) (Response, error) { +func (r SearchMvt) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "search_mvt") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -249,6 +316,9 @@ func (r SearchMvt) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -258,6 +328,9 @@ func (r SearchMvt) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -265,6 +338,9 @@ func (r SearchMvt) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/searchshards/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/searchshards/response.go index f8d474648..178f655e7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/searchshards/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/searchshards/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package searchshards @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package searchshards // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search_shards/SearchShardsResponse.ts#L25-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search_shards/SearchShardsResponse.ts#L25-L31 type Response struct { Indices map[string]types.ShardStoreIndex `json:"indices"` Nodes map[string]types.NodeAttributes `json:"nodes"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/searchshards/search_shards.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/searchshards/search_shards.go index b400e9b8d..d1607f9e6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/searchshards/search_shards.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/searchshards/search_shards.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns information about the indices and shards that a search request would // be executed against. package searchshards import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -54,11 +53,15 @@ type SearchShards struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewSearchShards type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *SearchShards { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -109,6 +117,9 @@ func (r *SearchShards) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_search_shards") @@ -124,9 +135,9 @@ func (r *SearchShards) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -143,27 +154,66 @@ func (r *SearchShards) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r SearchShards) Perform(ctx context.Context) (*http.Response, error) { +func (r SearchShards) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "search_shards") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "search_shards") + if reader := instrument.RecordRequestBody(ctx, "search_shards", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "search_shards") + } if err != nil { - return nil, fmt.Errorf("an error happened during the SearchShards query execution: %w", err) + localErr := fmt.Errorf("an error happened during the SearchShards query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a searchshards.Response -func (r SearchShards) Do(ctx context.Context) (*Response, error) { +func (r SearchShards) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "search_shards") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -171,6 +221,9 @@ func (r SearchShards) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -180,6 +233,9 @@ func (r SearchShards) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -187,12 +243,25 @@ func (r SearchShards) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r SearchShards) IsSuccess(ctx context.Context) (bool, error) { +func (r SearchShards) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "search_shards") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -208,6 +277,14 @@ func (r SearchShards) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the SearchShards query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/searchtemplate/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/searchtemplate/request.go index 3ea97dec7..ea78441af 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/searchtemplate/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/searchtemplate/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package searchtemplate @@ -27,7 +27,7 @@ import ( // Request holds the request body struct for the package searchtemplate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search_template/SearchTemplateRequest.ts#L32-L134 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search_template/SearchTemplateRequest.ts#L32-L134 type Request struct { // Explain If `true`, returns detailed information about score calculation as part of diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/searchtemplate/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/searchtemplate/response.go index b15b23ce0..497216226 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/searchtemplate/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/searchtemplate/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package searchtemplate @@ -33,7 +33,7 @@ import ( // Response holds the response body struct for the package searchtemplate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search_template/SearchTemplateResponse.ts#L30-L48 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search_template/SearchTemplateResponse.ts#L30-L48 type Response struct { Aggregations map[string]types.Aggregate `json:"aggregations,omitempty"` Clusters_ *types.ClusterStatistics `json:"_clusters,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/searchtemplate/search_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/searchtemplate/search_template.go index 6a692206b..989006d54 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/searchtemplate/search_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/searchtemplate/search_template.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Allows to use the Mustache language to pre-render a search definition. package searchtemplate @@ -53,15 +53,19 @@ type SearchTemplate struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewSearchTemplate type alias for index. @@ -85,11 +89,18 @@ func New(tp elastictransport.Interface) *SearchTemplate { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -126,9 +137,7 @@ func (r *SearchTemplate) HttpRequest(ctx context.Context) (*http.Request, error) } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -140,6 +149,10 @@ func (r *SearchTemplate) HttpRequest(ctx context.Context) (*http.Request, error) } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -153,6 +166,9 @@ func (r *SearchTemplate) HttpRequest(ctx context.Context) (*http.Request, error) case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_search") @@ -170,15 +186,15 @@ func (r *SearchTemplate) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -195,22 +211,58 @@ func (r *SearchTemplate) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r SearchTemplate) Perform(ctx context.Context) (*http.Response, error) { +func (r SearchTemplate) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "search_template") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "search_template") + if reader := instrument.RecordRequestBody(ctx, "search_template", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "search_template") + } if err != nil { - return nil, fmt.Errorf("an error happened during the SearchTemplate query execution: %w", err) + localErr := fmt.Errorf("an error happened during the SearchTemplate query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a searchtemplate.Response -func (r SearchTemplate) Do(ctx context.Context) (*Response, error) { +func (r SearchTemplate) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "search_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() @@ -218,6 +270,9 @@ func (r SearchTemplate) Do(ctx context.Context) (*Response, error) { res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -225,6 +280,9 @@ func (r SearchTemplate) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -234,6 +292,9 @@ func (r SearchTemplate) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -241,6 +302,9 @@ func (r SearchTemplate) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/termsenum/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/termsenum/request.go index 8bc57d119..41b82d1e1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/termsenum/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/termsenum/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package termsenum @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package termsenum // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/terms_enum/TermsEnumRequest.ts#L26-L65 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/terms_enum/TermsEnumRequest.ts#L26-L65 type Request struct { // CaseInsensitive When true the provided search string is matched against index terms without diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/termsenum/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/termsenum/response.go index 98c147282..51b6d01bf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/termsenum/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/termsenum/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package termsenum @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package termsenum // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/terms_enum/TermsEnumResponse.ts#L22-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/terms_enum/TermsEnumResponse.ts#L22-L28 type Response struct { Complete bool `json:"complete"` Shards_ types.ShardStatistics `json:"_shards"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/termsenum/terms_enum.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/termsenum/terms_enum.go index 34da1854a..816a04e83 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/termsenum/terms_enum.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/termsenum/terms_enum.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // The terms enum API can be used to discover terms in the index that begin // with the provided string. It is designed for low-latency look-ups used in @@ -52,15 +52,19 @@ type TermsEnum struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewTermsEnum type alias for index. @@ -88,11 +92,18 @@ func New(tp elastictransport.Interface) *TermsEnum { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -129,9 +140,7 @@ func (r *TermsEnum) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -143,12 +152,19 @@ func (r *TermsEnum) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_terms_enum") @@ -164,15 +180,15 @@ func (r *TermsEnum) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -189,27 +205,66 @@ func (r *TermsEnum) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r TermsEnum) Perform(ctx context.Context) (*http.Response, error) { +func (r TermsEnum) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "terms_enum") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "terms_enum") + if reader := instrument.RecordRequestBody(ctx, "terms_enum", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "terms_enum") + } if err != nil { - return nil, fmt.Errorf("an error happened during the TermsEnum query execution: %w", err) + localErr := fmt.Errorf("an error happened during the TermsEnum query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a termsenum.Response -func (r TermsEnum) Do(ctx context.Context) (*Response, error) { +func (r TermsEnum) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "terms_enum") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -217,6 +272,9 @@ func (r TermsEnum) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -226,6 +284,9 @@ func (r TermsEnum) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -233,6 +294,9 @@ func (r TermsEnum) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/termvectors/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/termvectors/request.go index a9eacc905..5acdbbeae 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/termvectors/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/termvectors/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package termvectors @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package termvectors // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/termvectors/TermVectorsRequest.ts#L33-L118 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/termvectors/TermVectorsRequest.ts#L33-L118 type Request struct { // Doc An artificial document (a document not present in the index) for which you diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/termvectors/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/termvectors/response.go index 3a35abd27..011a217a6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/termvectors/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/termvectors/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package termvectors @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package termvectors // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/termvectors/TermVectorsResponse.ts#L25-L34 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/termvectors/TermVectorsResponse.ts#L25-L34 type Response struct { Found bool `json:"found"` Id_ string `json:"_id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/termvectors/termvectors.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/termvectors/termvectors.go index 55dee389b..92eff62fe 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/termvectors/termvectors.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/termvectors/termvectors.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns information and statistics about terms in the fields of a particular // document. @@ -55,16 +55,20 @@ type Termvectors struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewTermvectors type alias for index. @@ -91,11 +95,18 @@ func New(tp elastictransport.Interface) *Termvectors { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -132,9 +143,7 @@ func (r *Termvectors) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -146,23 +155,36 @@ func (r *Termvectors) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { case r.paramSet == indexMask|idMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_termvectors") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodPost case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_termvectors") @@ -178,15 +200,15 @@ func (r *Termvectors) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -203,27 +225,66 @@ func (r *Termvectors) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Termvectors) Perform(ctx context.Context) (*http.Response, error) { +func (r Termvectors) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "termvectors") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "termvectors") + if reader := instrument.RecordRequestBody(ctx, "termvectors", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "termvectors") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Termvectors query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Termvectors query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a termvectors.Response -func (r Termvectors) Do(ctx context.Context) (*Response, error) { +func (r Termvectors) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "termvectors") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -231,6 +292,9 @@ func (r Termvectors) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -240,6 +304,9 @@ func (r Termvectors) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -247,6 +314,9 @@ func (r Termvectors) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/update/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/update/request.go index 3783b9f0d..bfe453352 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/update/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/update/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package update @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package update // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/update/UpdateRequest.ts#L38-L151 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/update/UpdateRequest.ts#L38-L151 type Request struct { // DetectNoop Set to false to disable setting 'result' in the response diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/update/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/update/response.go index d3d7226dd..21b2cb50b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/update/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/update/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package update @@ -27,7 +27,7 @@ import ( // Response holds the response body struct for the package update // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/update/UpdateResponse.ts#L27-L29 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/update/UpdateResponse.ts#L27-L29 type Response struct { ForcedRefresh *bool `json:"forced_refresh,omitempty"` Get *types.InlineGet `json:"get,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/update/update.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/update/update.go index 6d119498f..39f6e8d9e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/update/update.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/update/update.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Updates a document with a script or partial document. package update @@ -54,16 +54,20 @@ type Update struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int id string index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewUpdate type alias for index. @@ -91,11 +95,18 @@ func New(tp elastictransport.Interface) *Update { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -132,9 +143,7 @@ func (r *Update) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -146,17 +155,27 @@ func (r *Update) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { case r.paramSet == indexMask|idMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_update") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodPost @@ -170,15 +189,15 @@ func (r *Update) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -195,27 +214,66 @@ func (r *Update) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Update) Perform(ctx context.Context) (*http.Response, error) { +func (r Update) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "update") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "update") + if reader := instrument.RecordRequestBody(ctx, "update", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "update") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Update query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Update query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a update.Response -func (r Update) Do(ctx context.Context) (*Response, error) { +func (r Update) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "update") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -223,6 +281,9 @@ func (r Update) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -232,6 +293,9 @@ func (r Update) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -239,6 +303,9 @@ func (r Update) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/updatebyquery/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/updatebyquery/request.go index 690870a2d..dedfd428f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/updatebyquery/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/updatebyquery/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package updatebyquery @@ -30,7 +30,7 @@ import ( // Request holds the request body struct for the package updatebyquery // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/update_by_query/UpdateByQueryRequest.ts#L37-L221 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/update_by_query/UpdateByQueryRequest.ts#L37-L221 type Request struct { // Conflicts What to do if update by query hits version conflicts: `abort` or `proceed`. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/updatebyquery/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/updatebyquery/response.go index baa8ced72..970f83544 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/updatebyquery/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/updatebyquery/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package updatebyquery @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package updatebyquery // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/update_by_query/UpdateByQueryResponse.ts#L26-L45 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/update_by_query/UpdateByQueryResponse.ts#L26-L45 type Response struct { Batches *int64 `json:"batches,omitempty"` Deleted *int64 `json:"deleted,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/updatebyquery/update_by_query.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/updatebyquery/update_by_query.go index ada82f564..3dad5f0d4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/updatebyquery/update_by_query.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/updatebyquery/update_by_query.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Performs an update on every document in the index without changing the // source, @@ -57,15 +57,19 @@ type UpdateByQuery struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewUpdateByQuery type alias for index. @@ -93,11 +97,18 @@ func New(tp elastictransport.Interface) *UpdateByQuery { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -134,9 +145,7 @@ func (r *UpdateByQuery) HttpRequest(ctx context.Context) (*http.Request, error) } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -148,12 +157,19 @@ func (r *UpdateByQuery) HttpRequest(ctx context.Context) (*http.Request, error) } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_update_by_query") @@ -169,15 +185,15 @@ func (r *UpdateByQuery) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -194,27 +210,66 @@ func (r *UpdateByQuery) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r UpdateByQuery) Perform(ctx context.Context) (*http.Response, error) { +func (r UpdateByQuery) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "update_by_query") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "update_by_query") + if reader := instrument.RecordRequestBody(ctx, "update_by_query", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "update_by_query") + } if err != nil { - return nil, fmt.Errorf("an error happened during the UpdateByQuery query execution: %w", err) + localErr := fmt.Errorf("an error happened during the UpdateByQuery query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a updatebyquery.Response -func (r UpdateByQuery) Do(ctx context.Context) (*Response, error) { +func (r UpdateByQuery) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "update_by_query") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -222,6 +277,9 @@ func (r UpdateByQuery) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -231,6 +289,9 @@ func (r UpdateByQuery) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -238,6 +299,9 @@ func (r UpdateByQuery) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/updatebyqueryrethrottle/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/updatebyqueryrethrottle/response.go index 164847d69..07fa7f9ef 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/updatebyqueryrethrottle/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/updatebyqueryrethrottle/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package updatebyqueryrethrottle @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package updatebyqueryrethrottle // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/update_by_query_rethrottle/UpdateByQueryRethrottleResponse.ts#L23-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/update_by_query_rethrottle/UpdateByQueryRethrottleResponse.ts#L23-L25 type Response struct { Nodes map[string]types.UpdateByQueryRethrottleNode `json:"nodes"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/updatebyqueryrethrottle/update_by_query_rethrottle.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/updatebyqueryrethrottle/update_by_query_rethrottle.go index 6b4a1ff6b..56f44a961 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/updatebyqueryrethrottle/update_by_query_rethrottle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/core/updatebyqueryrethrottle/update_by_query_rethrottle.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Changes the number of requests per second for a particular Update By Query // operation. package updatebyqueryrethrottle import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type UpdateByQueryRethrottle struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int taskid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewUpdateByQueryRethrottle type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *UpdateByQueryRethrottle { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *UpdateByQueryRethrottle) HttpRequest(ctx context.Context) (*http.Reques path.WriteString("_update_by_query") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "taskid", r.taskid) + } path.WriteString(r.taskid) path.WriteString("/") path.WriteString("_rethrottle") @@ -121,9 +132,9 @@ func (r *UpdateByQueryRethrottle) HttpRequest(ctx context.Context) (*http.Reques } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -140,27 +151,66 @@ func (r *UpdateByQueryRethrottle) HttpRequest(ctx context.Context) (*http.Reques } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r UpdateByQueryRethrottle) Perform(ctx context.Context) (*http.Response, error) { +func (r UpdateByQueryRethrottle) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "update_by_query_rethrottle") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "update_by_query_rethrottle") + if reader := instrument.RecordRequestBody(ctx, "update_by_query_rethrottle", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "update_by_query_rethrottle") + } if err != nil { - return nil, fmt.Errorf("an error happened during the UpdateByQueryRethrottle query execution: %w", err) + localErr := fmt.Errorf("an error happened during the UpdateByQueryRethrottle query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a updatebyqueryrethrottle.Response -func (r UpdateByQueryRethrottle) Do(ctx context.Context) (*Response, error) { +func (r UpdateByQueryRethrottle) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "update_by_query_rethrottle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -168,6 +218,9 @@ func (r UpdateByQueryRethrottle) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -177,6 +230,9 @@ func (r UpdateByQueryRethrottle) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,12 +240,25 @@ func (r UpdateByQueryRethrottle) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r UpdateByQueryRethrottle) IsSuccess(ctx context.Context) (bool, error) { +func (r UpdateByQueryRethrottle) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "update_by_query_rethrottle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -205,6 +274,14 @@ func (r UpdateByQueryRethrottle) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the UpdateByQueryRethrottle query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/danglingindices/deletedanglingindex/delete_dangling_index.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/danglingindices/deletedanglingindex/delete_dangling_index.go index 4af497c60..5e014959e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/danglingindices/deletedanglingindex/delete_dangling_index.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/danglingindices/deletedanglingindex/delete_dangling_index.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes the specified dangling index package deletedanglingindex import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type DeleteDanglingIndex struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int indexuuid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteDanglingIndex type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *DeleteDanglingIndex { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -105,6 +113,9 @@ func (r *DeleteDanglingIndex) HttpRequest(ctx context.Context) (*http.Request, e path.WriteString("_dangling") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "indexuuid", r.indexuuid) + } path.WriteString(r.indexuuid) method = http.MethodDelete @@ -118,9 +129,9 @@ func (r *DeleteDanglingIndex) HttpRequest(ctx context.Context) (*http.Request, e } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -137,27 +148,66 @@ func (r *DeleteDanglingIndex) HttpRequest(ctx context.Context) (*http.Request, e } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteDanglingIndex) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteDanglingIndex) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "dangling_indices.delete_dangling_index") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "dangling_indices.delete_dangling_index") + if reader := instrument.RecordRequestBody(ctx, "dangling_indices.delete_dangling_index", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "dangling_indices.delete_dangling_index") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteDanglingIndex query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteDanglingIndex query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deletedanglingindex.Response -func (r DeleteDanglingIndex) Do(ctx context.Context) (*Response, error) { +func (r DeleteDanglingIndex) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "dangling_indices.delete_dangling_index") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -165,6 +215,9 @@ func (r DeleteDanglingIndex) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -174,6 +227,9 @@ func (r DeleteDanglingIndex) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -181,12 +237,25 @@ func (r DeleteDanglingIndex) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteDanglingIndex) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteDanglingIndex) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "dangling_indices.delete_dangling_index") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -202,6 +271,14 @@ func (r DeleteDanglingIndex) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteDanglingIndex query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/danglingindices/deletedanglingindex/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/danglingindices/deletedanglingindex/response.go index 95d895f9f..e3ef220de 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/danglingindices/deletedanglingindex/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/danglingindices/deletedanglingindex/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deletedanglingindex // Response holds the response body struct for the package deletedanglingindex // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/dangling_indices/delete_dangling_index/DeleteDanglingIndexResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/dangling_indices/delete_dangling_index/DeleteDanglingIndexResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/danglingindices/importdanglingindex/import_dangling_index.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/danglingindices/importdanglingindex/import_dangling_index.go index 797ac1a6e..1f688bdb3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/danglingindices/importdanglingindex/import_dangling_index.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/danglingindices/importdanglingindex/import_dangling_index.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Imports the specified dangling index package importdanglingindex import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type ImportDanglingIndex struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int indexuuid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewImportDanglingIndex type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *ImportDanglingIndex { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -105,6 +113,9 @@ func (r *ImportDanglingIndex) HttpRequest(ctx context.Context) (*http.Request, e path.WriteString("_dangling") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "indexuuid", r.indexuuid) + } path.WriteString(r.indexuuid) method = http.MethodPost @@ -118,9 +129,9 @@ func (r *ImportDanglingIndex) HttpRequest(ctx context.Context) (*http.Request, e } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -137,27 +148,66 @@ func (r *ImportDanglingIndex) HttpRequest(ctx context.Context) (*http.Request, e } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ImportDanglingIndex) Perform(ctx context.Context) (*http.Response, error) { +func (r ImportDanglingIndex) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "dangling_indices.import_dangling_index") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "dangling_indices.import_dangling_index") + if reader := instrument.RecordRequestBody(ctx, "dangling_indices.import_dangling_index", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "dangling_indices.import_dangling_index") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ImportDanglingIndex query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ImportDanglingIndex query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a importdanglingindex.Response -func (r ImportDanglingIndex) Do(ctx context.Context) (*Response, error) { +func (r ImportDanglingIndex) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "dangling_indices.import_dangling_index") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -165,6 +215,9 @@ func (r ImportDanglingIndex) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -174,6 +227,9 @@ func (r ImportDanglingIndex) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -181,12 +237,25 @@ func (r ImportDanglingIndex) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ImportDanglingIndex) IsSuccess(ctx context.Context) (bool, error) { +func (r ImportDanglingIndex) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "dangling_indices.import_dangling_index") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -202,6 +271,14 @@ func (r ImportDanglingIndex) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ImportDanglingIndex query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/danglingindices/importdanglingindex/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/danglingindices/importdanglingindex/response.go index 53c97ec06..43ad09d64 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/danglingindices/importdanglingindex/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/danglingindices/importdanglingindex/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package importdanglingindex // Response holds the response body struct for the package importdanglingindex // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/dangling_indices/import_dangling_index/ImportDanglingIndexResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/dangling_indices/import_dangling_index/ImportDanglingIndexResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/danglingindices/listdanglingindices/list_dangling_indices.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/danglingindices/listdanglingindices/list_dangling_indices.go index 3bc9b278f..700cb7706 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/danglingindices/listdanglingindices/list_dangling_indices.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/danglingindices/listdanglingindices/list_dangling_indices.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns all dangling indices. package listdanglingindices import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -47,9 +46,13 @@ type ListDanglingIndices struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewListDanglingIndices type alias for index. @@ -73,7 +76,12 @@ func New(tp elastictransport.Interface) *ListDanglingIndices { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,9 +114,9 @@ func (r *ListDanglingIndices) HttpRequest(ctx context.Context) (*http.Request, e } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -125,27 +133,66 @@ func (r *ListDanglingIndices) HttpRequest(ctx context.Context) (*http.Request, e } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ListDanglingIndices) Perform(ctx context.Context) (*http.Response, error) { +func (r ListDanglingIndices) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "dangling_indices.list_dangling_indices") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "dangling_indices.list_dangling_indices") + if reader := instrument.RecordRequestBody(ctx, "dangling_indices.list_dangling_indices", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "dangling_indices.list_dangling_indices") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ListDanglingIndices query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ListDanglingIndices query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a listdanglingindices.Response -func (r ListDanglingIndices) Do(ctx context.Context) (*Response, error) { +func (r ListDanglingIndices) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "dangling_indices.list_dangling_indices") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -153,6 +200,9 @@ func (r ListDanglingIndices) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -162,6 +212,9 @@ func (r ListDanglingIndices) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -169,12 +222,25 @@ func (r ListDanglingIndices) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ListDanglingIndices) IsSuccess(ctx context.Context) (bool, error) { +func (r ListDanglingIndices) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "dangling_indices.list_dangling_indices") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -190,6 +256,14 @@ func (r ListDanglingIndices) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ListDanglingIndices query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/danglingindices/listdanglingindices/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/danglingindices/listdanglingindices/response.go index 420ed9a9b..bf472d1ae 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/danglingindices/listdanglingindices/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/danglingindices/listdanglingindices/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package listdanglingindices @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package listdanglingindices // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/dangling_indices/list_dangling_indices/ListDanglingIndicesResponse.ts#L23-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/dangling_indices/list_dangling_indices/ListDanglingIndicesResponse.ts#L23-L27 type Response struct { DanglingIndices []types.DanglingIndex `json:"dangling_indices"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/deletepolicy/delete_policy.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/deletepolicy/delete_policy.go index 6377937c3..7e5b8304b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/deletepolicy/delete_policy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/deletepolicy/delete_policy.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes an existing enrich policy and its enrich index. package deletepolicy import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type DeletePolicy struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeletePolicy type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *DeletePolicy { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *DeletePolicy) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("policy") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodDelete @@ -119,9 +130,9 @@ func (r *DeletePolicy) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -138,27 +149,66 @@ func (r *DeletePolicy) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeletePolicy) Perform(ctx context.Context) (*http.Response, error) { +func (r DeletePolicy) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "enrich.delete_policy") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "enrich.delete_policy") + if reader := instrument.RecordRequestBody(ctx, "enrich.delete_policy", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "enrich.delete_policy") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeletePolicy query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeletePolicy query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deletepolicy.Response -func (r DeletePolicy) Do(ctx context.Context) (*Response, error) { +func (r DeletePolicy) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "enrich.delete_policy") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -166,6 +216,9 @@ func (r DeletePolicy) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,6 +228,9 @@ func (r DeletePolicy) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,12 +238,25 @@ func (r DeletePolicy) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeletePolicy) IsSuccess(ctx context.Context) (bool, error) { +func (r DeletePolicy) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "enrich.delete_policy") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -203,6 +272,14 @@ func (r DeletePolicy) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeletePolicy query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/deletepolicy/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/deletepolicy/response.go index 9da90f7b1..92e414182 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/deletepolicy/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/deletepolicy/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deletepolicy // Response holds the response body struct for the package deletepolicy // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/enrich/delete_policy/DeleteEnrichPolicyResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/enrich/delete_policy/DeleteEnrichPolicyResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/executepolicy/execute_policy.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/executepolicy/execute_policy.go index 8d145fda4..61c8cf275 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/executepolicy/execute_policy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/executepolicy/execute_policy.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates the enrich index for an existing enrich policy. package executepolicy import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type ExecutePolicy struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewExecutePolicy type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *ExecutePolicy { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -107,6 +115,9 @@ func (r *ExecutePolicy) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("policy") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) path.WriteString("/") path.WriteString("_execute") @@ -122,9 +133,9 @@ func (r *ExecutePolicy) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -141,27 +152,66 @@ func (r *ExecutePolicy) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ExecutePolicy) Perform(ctx context.Context) (*http.Response, error) { +func (r ExecutePolicy) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "enrich.execute_policy") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "enrich.execute_policy") + if reader := instrument.RecordRequestBody(ctx, "enrich.execute_policy", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "enrich.execute_policy") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ExecutePolicy query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ExecutePolicy query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a executepolicy.Response -func (r ExecutePolicy) Do(ctx context.Context) (*Response, error) { +func (r ExecutePolicy) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "enrich.execute_policy") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -169,6 +219,9 @@ func (r ExecutePolicy) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -178,6 +231,9 @@ func (r ExecutePolicy) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -185,12 +241,25 @@ func (r ExecutePolicy) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ExecutePolicy) IsSuccess(ctx context.Context) (bool, error) { +func (r ExecutePolicy) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "enrich.execute_policy") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -206,6 +275,14 @@ func (r ExecutePolicy) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ExecutePolicy query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/executepolicy/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/executepolicy/response.go index fd9c4195c..f528d736d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/executepolicy/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/executepolicy/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package executepolicy @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package executepolicy // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/enrich/execute_policy/ExecuteEnrichPolicyResponse.ts#L23-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/enrich/execute_policy/ExecuteEnrichPolicyResponse.ts#L23-L28 type Response struct { Status types.ExecuteEnrichPolicyStatus `json:"status"` TaskId types.TaskId `json:"task_id,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/getpolicy/get_policy.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/getpolicy/get_policy.go index 62ba396f1..57119debd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/getpolicy/get_policy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/getpolicy/get_policy.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Gets information about an enrich policy. package getpolicy import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type GetPolicy struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetPolicy type alias for index. @@ -79,7 +82,12 @@ func New(tp elastictransport.Interface) *GetPolicy { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *GetPolicy) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("policy") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodGet @@ -124,9 +135,9 @@ func (r *GetPolicy) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -143,27 +154,66 @@ func (r *GetPolicy) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetPolicy) Perform(ctx context.Context) (*http.Response, error) { +func (r GetPolicy) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "enrich.get_policy") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "enrich.get_policy") + if reader := instrument.RecordRequestBody(ctx, "enrich.get_policy", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "enrich.get_policy") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetPolicy query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetPolicy query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getpolicy.Response -func (r GetPolicy) Do(ctx context.Context) (*Response, error) { +func (r GetPolicy) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "enrich.get_policy") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -171,6 +221,9 @@ func (r GetPolicy) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -180,6 +233,9 @@ func (r GetPolicy) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -187,12 +243,25 @@ func (r GetPolicy) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetPolicy) IsSuccess(ctx context.Context) (bool, error) { +func (r GetPolicy) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "enrich.get_policy") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -208,6 +277,14 @@ func (r GetPolicy) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetPolicy query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/getpolicy/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/getpolicy/response.go index 628853f39..9479e36f5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/getpolicy/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/getpolicy/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getpolicy @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getpolicy // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/enrich/get_policy/GetEnrichPolicyResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/enrich/get_policy/GetEnrichPolicyResponse.ts#L22-L24 type Response struct { Policies []types.Summary `json:"policies"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/putpolicy/put_policy.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/putpolicy/put_policy.go index ef027bc99..137477817 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/putpolicy/put_policy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/putpolicy/put_policy.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates a new enrich policy. package putpolicy @@ -50,15 +50,19 @@ type PutPolicy struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutPolicy type alias for index. @@ -84,11 +88,18 @@ func New(tp elastictransport.Interface) *PutPolicy { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -125,9 +136,7 @@ func (r *PutPolicy) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -139,6 +148,10 @@ func (r *PutPolicy) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -149,6 +162,9 @@ func (r *PutPolicy) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("policy") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodPut @@ -162,15 +178,15 @@ func (r *PutPolicy) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -187,27 +203,66 @@ func (r *PutPolicy) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutPolicy) Perform(ctx context.Context) (*http.Response, error) { +func (r PutPolicy) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "enrich.put_policy") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "enrich.put_policy") + if reader := instrument.RecordRequestBody(ctx, "enrich.put_policy", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "enrich.put_policy") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutPolicy query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutPolicy query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a putpolicy.Response -func (r PutPolicy) Do(ctx context.Context) (*Response, error) { +func (r PutPolicy) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "enrich.put_policy") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -215,6 +270,9 @@ func (r PutPolicy) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -224,6 +282,9 @@ func (r PutPolicy) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -231,6 +292,9 @@ func (r PutPolicy) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/putpolicy/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/putpolicy/request.go index d2e631474..fbce3d749 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/putpolicy/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/putpolicy/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putpolicy @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package putpolicy // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/enrich/put_policy/PutEnrichPolicyRequest.ts#L24-L52 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/enrich/put_policy/PutEnrichPolicyRequest.ts#L24-L52 type Request struct { // GeoMatch Matches enrich data to incoming documents based on a `geo_shape` query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/putpolicy/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/putpolicy/response.go index 2f540a1e9..df4504a8c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/putpolicy/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/putpolicy/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putpolicy // Response holds the response body struct for the package putpolicy // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/enrich/put_policy/PutEnrichPolicyResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/enrich/put_policy/PutEnrichPolicyResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/stats/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/stats/response.go index 06ad104ba..fc2c8a870 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/stats/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/stats/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package stats @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package stats // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/enrich/stats/EnrichStatsResponse.ts#L22-L39 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/enrich/stats/EnrichStatsResponse.ts#L22-L39 type Response struct { // CacheStats Objects containing information about the enrich cache stats on each ingest diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/stats/stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/stats/stats.go index 1bf37763b..12052863a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/stats/stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/enrich/stats/stats.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Gets enrich coordinator statistics and information about enrich policies that // are currently executing. package stats import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -48,9 +47,13 @@ type Stats struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewStats type alias for index. @@ -75,7 +78,12 @@ func New(tp elastictransport.Interface) *Stats { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -110,9 +118,9 @@ func (r *Stats) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -129,27 +137,66 @@ func (r *Stats) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Stats) Perform(ctx context.Context) (*http.Response, error) { +func (r Stats) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "enrich.stats") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "enrich.stats") + if reader := instrument.RecordRequestBody(ctx, "enrich.stats", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "enrich.stats") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Stats query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Stats query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a stats.Response -func (r Stats) Do(ctx context.Context) (*Response, error) { +func (r Stats) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "enrich.stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -157,6 +204,9 @@ func (r Stats) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -166,6 +216,9 @@ func (r Stats) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -173,12 +226,25 @@ func (r Stats) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Stats) IsSuccess(ctx context.Context) (bool, error) { +func (r Stats) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "enrich.stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -194,6 +260,14 @@ func (r Stats) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Stats query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/delete/delete.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/delete/delete.go index c087643be..5922744b7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/delete/delete.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/delete/delete.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes an async EQL search by ID. If the search is still running, the search // request will be cancelled. Otherwise, the saved search results are deleted. package delete import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type Delete struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDelete type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *Delete { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,6 +116,9 @@ func (r *Delete) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("search") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodDelete @@ -121,9 +132,9 @@ func (r *Delete) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -140,27 +151,66 @@ func (r *Delete) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Delete) Perform(ctx context.Context) (*http.Response, error) { +func (r Delete) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "eql.delete") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "eql.delete") + if reader := instrument.RecordRequestBody(ctx, "eql.delete", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "eql.delete") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Delete query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Delete query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a delete.Response -func (r Delete) Do(ctx context.Context) (*Response, error) { +func (r Delete) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "eql.delete") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -168,6 +218,9 @@ func (r Delete) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -177,6 +230,9 @@ func (r Delete) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,12 +240,25 @@ func (r Delete) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Delete) IsSuccess(ctx context.Context) (bool, error) { +func (r Delete) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "eql.delete") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -205,6 +274,14 @@ func (r Delete) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Delete query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/delete/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/delete/response.go index 5131e7944..b9253d47a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/delete/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/delete/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package delete // Response holds the response body struct for the package delete // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/eql/delete/EqlDeleteResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/eql/delete/EqlDeleteResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/get/get.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/get/get.go index 977de65a7..d1f372849 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/get/get.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/get/get.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns async results from previously executed Event Query Language (EQL) // search package get import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type Get struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGet type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *Get { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,6 +116,9 @@ func (r *Get) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("search") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodGet @@ -121,9 +132,9 @@ func (r *Get) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -140,27 +151,66 @@ func (r *Get) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Get) Perform(ctx context.Context) (*http.Response, error) { +func (r Get) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "eql.get") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "eql.get") + if reader := instrument.RecordRequestBody(ctx, "eql.get", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "eql.get") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Get query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Get query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a get.Response -func (r Get) Do(ctx context.Context) (*Response, error) { +func (r Get) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "eql.get") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -168,6 +218,9 @@ func (r Get) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -177,6 +230,9 @@ func (r Get) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,12 +240,25 @@ func (r Get) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Get) IsSuccess(ctx context.Context) (bool, error) { +func (r Get) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "eql.get") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -205,6 +274,14 @@ func (r Get) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Get query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/get/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/get/response.go index 715f758d5..ba3966b69 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/get/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/get/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package get @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package get // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/eql/get/EqlGetResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/eql/get/EqlGetResponse.ts#L22-L24 type Response struct { // Hits Contains matching events and sequences. Also contains related metadata. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/getstatus/get_status.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/getstatus/get_status.go index 7933196dd..24b57cb4a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/getstatus/get_status.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/getstatus/get_status.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns the status of a previously submitted async or stored Event Query // Language (EQL) search package getstatus import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type GetStatus struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetStatus type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *GetStatus { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -110,6 +118,9 @@ func (r *GetStatus) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("status") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodGet @@ -123,9 +134,9 @@ func (r *GetStatus) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -142,27 +153,66 @@ func (r *GetStatus) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetStatus) Perform(ctx context.Context) (*http.Response, error) { +func (r GetStatus) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "eql.get_status") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "eql.get_status") + if reader := instrument.RecordRequestBody(ctx, "eql.get_status", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "eql.get_status") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetStatus query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetStatus query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getstatus.Response -func (r GetStatus) Do(ctx context.Context) (*Response, error) { +func (r GetStatus) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "eql.get_status") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -170,6 +220,9 @@ func (r GetStatus) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -179,6 +232,9 @@ func (r GetStatus) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -186,12 +242,25 @@ func (r GetStatus) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetStatus) IsSuccess(ctx context.Context) (bool, error) { +func (r GetStatus) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "eql.get_status") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -207,6 +276,14 @@ func (r GetStatus) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetStatus query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/getstatus/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/getstatus/response.go index d1cf33fd4..f36eee4c6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/getstatus/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/getstatus/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getstatus // Response holds the response body struct for the package getstatus // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/eql/get_status/EqlGetStatusResponse.ts#L24-L51 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/eql/get_status/EqlGetStatusResponse.ts#L24-L51 type Response struct { // CompletionStatus For a completed search shows the http status code of the completed search. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/search/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/search/request.go index 5ebc98c68..be00fd17d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/search/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/search/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package search @@ -30,7 +30,7 @@ import ( // Request holds the request body struct for the package search // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/eql/search/EqlSearchRequest.ts#L28-L118 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/eql/search/EqlSearchRequest.ts#L28-L118 type Request struct { CaseSensitive *bool `json:"case_sensitive,omitempty"` // EventCategoryField Field containing the event classification, such as process, file, or network. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/search/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/search/response.go index 35f12fe8d..f9e8551d7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/search/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/search/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package search @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package search // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/eql/search/EqlSearchResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/eql/search/EqlSearchResponse.ts#L22-L24 type Response struct { // Hits Contains matching events and sequences. Also contains related metadata. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/search/search.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/search/search.go index 758177c31..543b6a21a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/search/search.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/eql/search/search.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns results matching a query expressed in Event Query Language (EQL) package search @@ -53,15 +53,19 @@ type Search struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewSearch type alias for index. @@ -87,11 +91,18 @@ func New(tp elastictransport.Interface) *Search { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -128,9 +139,7 @@ func (r *Search) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -142,12 +151,19 @@ func (r *Search) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_eql") @@ -165,15 +181,15 @@ func (r *Search) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -190,27 +206,66 @@ func (r *Search) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Search) Perform(ctx context.Context) (*http.Response, error) { +func (r Search) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "eql.search") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "eql.search") + if reader := instrument.RecordRequestBody(ctx, "eql.search", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "eql.search") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Search query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Search query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a search.Response -func (r Search) Do(ctx context.Context) (*Response, error) { +func (r Search) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "eql.search") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -218,6 +273,9 @@ func (r Search) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -227,6 +285,9 @@ func (r Search) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -234,6 +295,9 @@ func (r Search) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/esql/query/query.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/esql/query/query.go new file mode 100644 index 000000000..76c34814c --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/esql/query/query.go @@ -0,0 +1,356 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated from the elasticsearch-specification DO NOT EDIT. +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c + +// Executes an ESQL request +package query + +import ( + gobytes "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strings" + + "github.com/elastic/elastic-transport-go/v8/elastictransport" + "github.com/elastic/go-elasticsearch/v8/typedapi/types" +) + +// ErrBuildPath is returned in case of missing parameters within the build of the request. +var ErrBuildPath = errors.New("cannot build path, check for missing path parameters") + +type Query struct { + transport elastictransport.Interface + + headers http.Header + values url.Values + path url.URL + + raw io.Reader + + req *Request + deferred []func(request *Request) error + buf *gobytes.Buffer + + paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation +} + +// NewQuery type alias for index. +type NewQuery func() *Query + +// NewQueryFunc returns a new instance of Query with the provided transport. +// Used in the index of the library this allows to retrieve every apis in once place. +func NewQueryFunc(tp elastictransport.Interface) NewQuery { + return func() *Query { + n := New(tp) + + return n + } +} + +// Executes an ESQL request +// +// https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-rest.html +func New(tp elastictransport.Interface) *Query { + r := &Query{ + transport: tp, + values: make(url.Values), + headers: make(http.Header), + + buf: gobytes.NewBuffer(nil), + + req: NewRequest(), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + + return r +} + +// Raw takes a json payload as input which is then passed to the http.Request +// If specified Raw takes precedence on Request method. +func (r *Query) Raw(raw io.Reader) *Query { + r.raw = raw + + return r +} + +// Request allows to set the request property with the appropriate payload. +func (r *Query) Request(req *Request) *Query { + r.req = req + + return r +} + +// HttpRequest returns the http.Request object built from the +// given parameters. +func (r *Query) HttpRequest(ctx context.Context) (*http.Request, error) { + var path strings.Builder + var method string + var req *http.Request + + var err error + + if len(r.deferred) > 0 { + for _, f := range r.deferred { + deferredErr := f(r.req) + if deferredErr != nil { + return nil, deferredErr + } + } + } + + if r.raw == nil && r.req != nil { + + data, err := json.Marshal(r.req) + + if err != nil { + return nil, fmt.Errorf("could not serialise request for Query: %w", err) + } + + r.buf.Write(data) + + } + + if r.buf.Len() > 0 { + r.raw = r.buf + } + + r.path.Scheme = "http" + + switch { + case r.paramSet == 0: + path.WriteString("/") + path.WriteString("_query") + + method = http.MethodPost + } + + r.path.Path = path.String() + r.path.RawQuery = r.values.Encode() + + if r.path.Path == "" { + return nil, ErrBuildPath + } + + if ctx != nil { + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) + } else { + req, err = http.NewRequest(method, r.path.String(), r.raw) + } + + req.Header = r.headers.Clone() + + if req.Header.Get("Content-Type") == "" { + if r.raw != nil { + req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") + } + } + + if req.Header.Get("Accept") == "" { + req.Header.Set("Accept", "application/vnd.elasticsearch+json;compatible-with=8") + } + + if err != nil { + return req, fmt.Errorf("could not build http.Request: %w", err) + } + + return req, nil +} + +// Perform runs the http.Request through the provided transport and returns an http.Response. +func (r Query) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "esql.query") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + + req, err := r.HttpRequest(ctx) + if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "esql.query") + if reader := instrument.RecordRequestBody(ctx, "esql.query", r.raw); reader != nil { + req.Body = reader + } + } + res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "esql.query") + } + if err != nil { + localErr := fmt.Errorf("an error happened during the Query query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr + } + + return res, nil +} + +// Do runs the request through the transport, handle the response and returns a query.Response +func (r Query) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "esql.query") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + response := NewResponse() + + res, err := r.Perform(ctx) + if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + defer res.Body.Close() + + if res.StatusCode < 299 { + err = json.NewDecoder(res.Body).Decode(&response) + if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + return response, nil + } + + errorResponse := types.NewElasticsearchError() + err = json.NewDecoder(res.Body).Decode(errorResponse) + if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if errorResponse.Status == 0 { + errorResponse.Status = res.StatusCode + } + + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } + return nil, errorResponse +} + +// Header set a key, value pair in the Query headers map. +func (r *Query) Header(key, value string) *Query { + r.headers.Set(key, value) + + return r +} + +// Format A short version of the Accept header, e.g. json, yaml. +// API name: format +func (r *Query) Format(format string) *Query { + r.values.Set("format", format) + + return r +} + +// Delimiter The character to use between values within a CSV row. Only valid for the CSV +// format. +// API name: delimiter +func (r *Query) Delimiter(delimiter string) *Query { + r.values.Set("delimiter", delimiter) + + return r +} + +// Columnar By default, ES|QL returns results as rows. For example, FROM returns each +// individual document as one row. For the JSON, YAML, CBOR and smile formats, +// ES|QL can return the results in a columnar fashion where one row represents +// all the values of a certain column in the results. +// API name: columnar +func (r *Query) Columnar(columnar bool) *Query { + r.req.Columnar = &columnar + + return r +} + +// Filter Specify a Query DSL query in the filter parameter to filter the set of +// documents that an ES|QL query runs on. +// API name: filter +func (r *Query) Filter(filter *types.Query) *Query { + + r.req.Filter = filter + + return r +} + +// API name: locale +func (r *Query) Locale(locale string) *Query { + + r.req.Locale = &locale + + return r +} + +// Params To avoid any attempts of hacking or code injection, extract the values in a +// separate list of parameters. Use question mark placeholders (?) in the query +// string for each of the parameters. +// API name: params +func (r *Query) Params(params ...types.ScalarValue) *Query { + r.req.Params = params + + return r +} + +// Query The ES|QL query API accepts an ES|QL query string in the query parameter, +// runs it, and returns the results. +// API name: query +func (r *Query) Query(query string) *Query { + + r.req.Query = query + + return r +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/esql/query/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/esql/query/request.go new file mode 100644 index 000000000..424ce3890 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/esql/query/request.go @@ -0,0 +1,69 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated from the elasticsearch-specification DO NOT EDIT. +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c + +package query + +import ( + "encoding/json" + "fmt" + + "github.com/elastic/go-elasticsearch/v8/typedapi/types" +) + +// Request holds the request body struct for the package query +// +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/esql/query/QueryRequest.ts#L24-L64 +type Request struct { + + // Columnar By default, ES|QL returns results as rows. For example, FROM returns each + // individual document as one row. For the JSON, YAML, CBOR and smile formats, + // ES|QL can return the results in a columnar fashion where one row represents + // all the values of a certain column in the results. + Columnar *bool `json:"columnar,omitempty"` + // Filter Specify a Query DSL query in the filter parameter to filter the set of + // documents that an ES|QL query runs on. + Filter *types.Query `json:"filter,omitempty"` + Locale *string `json:"locale,omitempty"` + // Params To avoid any attempts of hacking or code injection, extract the values in a + // separate list of parameters. Use question mark placeholders (?) in the query + // string for each of the parameters. + Params []types.ScalarValue `json:"params,omitempty"` + // Query The ES|QL query API accepts an ES|QL query string in the query parameter, + // runs it, and returns the results. + Query string `json:"query"` +} + +// NewRequest returns a Request +func NewRequest() *Request { + r := &Request{} + return r +} + +// FromJSON allows to load an arbitrary json into the request structure +func (r *Request) FromJSON(data string) (*Request, error) { + var req Request + err := json.Unmarshal([]byte(data), &req) + + if err != nil { + return nil, fmt.Errorf("could not deserialise json into Query request: %w", err) + } + + return &req, nil +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/esql/query/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/esql/query/response.go new file mode 100644 index 000000000..e131cf877 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/esql/query/response.go @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated from the elasticsearch-specification DO NOT EDIT. +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c + +package query + +// Response holds the response body struct for the package query +// +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/esql/query/QueryResponse.ts#L22-L24 + +type Response = []byte + +// NewResponse returns a Response +func NewResponse() Response { + r := Response{} + return r +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/features/getfeatures/get_features.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/features/getfeatures/get_features.go index 284c65620..ba41597bd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/features/getfeatures/get_features.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/features/getfeatures/get_features.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Gets a list of features which can be included in snapshots using the // feature_states field when creating a snapshot package getfeatures import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -48,9 +47,13 @@ type GetFeatures struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetFeatures type alias for index. @@ -75,7 +78,12 @@ func New(tp elastictransport.Interface) *GetFeatures { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,9 +116,9 @@ func (r *GetFeatures) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -127,27 +135,66 @@ func (r *GetFeatures) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetFeatures) Perform(ctx context.Context) (*http.Response, error) { +func (r GetFeatures) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "features.get_features") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "features.get_features") + if reader := instrument.RecordRequestBody(ctx, "features.get_features", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "features.get_features") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetFeatures query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetFeatures query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getfeatures.Response -func (r GetFeatures) Do(ctx context.Context) (*Response, error) { +func (r GetFeatures) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "features.get_features") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -155,6 +202,9 @@ func (r GetFeatures) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -164,6 +214,9 @@ func (r GetFeatures) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -171,12 +224,25 @@ func (r GetFeatures) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetFeatures) IsSuccess(ctx context.Context) (bool, error) { +func (r GetFeatures) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "features.get_features") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -192,6 +258,14 @@ func (r GetFeatures) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetFeatures query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/features/getfeatures/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/features/getfeatures/response.go index 728c3269d..6114f67c0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/features/getfeatures/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/features/getfeatures/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getfeatures @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getfeatures // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/features/get_features/GetFeaturesResponse.ts#L22-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/features/get_features/GetFeaturesResponse.ts#L22-L26 type Response struct { Features []types.Feature `json:"features"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/features/resetfeatures/reset_features.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/features/resetfeatures/reset_features.go index 0a3ed69c9..ffa49e51f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/features/resetfeatures/reset_features.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/features/resetfeatures/reset_features.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Resets the internal state of features, usually by deleting system indices package resetfeatures import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -47,9 +46,13 @@ type ResetFeatures struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewResetFeatures type alias for index. @@ -73,7 +76,12 @@ func New(tp elastictransport.Interface) *ResetFeatures { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,9 +116,9 @@ func (r *ResetFeatures) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -127,27 +135,66 @@ func (r *ResetFeatures) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ResetFeatures) Perform(ctx context.Context) (*http.Response, error) { +func (r ResetFeatures) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "features.reset_features") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "features.reset_features") + if reader := instrument.RecordRequestBody(ctx, "features.reset_features", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "features.reset_features") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ResetFeatures query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ResetFeatures query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a resetfeatures.Response -func (r ResetFeatures) Do(ctx context.Context) (*Response, error) { +func (r ResetFeatures) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "features.reset_features") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -155,6 +202,9 @@ func (r ResetFeatures) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -164,6 +214,9 @@ func (r ResetFeatures) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -171,12 +224,25 @@ func (r ResetFeatures) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ResetFeatures) IsSuccess(ctx context.Context) (bool, error) { +func (r ResetFeatures) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "features.reset_features") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -192,6 +258,14 @@ func (r ResetFeatures) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ResetFeatures query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/features/resetfeatures/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/features/resetfeatures/response.go index 5a23d1abd..c16b7e0ad 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/features/resetfeatures/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/features/resetfeatures/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package resetfeatures @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package resetfeatures // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/features/reset_features/ResetFeaturesResponse.ts#L22-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/features/reset_features/ResetFeaturesResponse.ts#L22-L26 type Response struct { Features []types.Feature `json:"features"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/globalcheckpoints/global_checkpoints.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/globalcheckpoints/global_checkpoints.go index ccd9783b0..9b5fce918 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/globalcheckpoints/global_checkpoints.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/globalcheckpoints/global_checkpoints.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns the current global checkpoints for an index. This API is design for // internal use by the fleet server project. package globalcheckpoints import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,11 +52,15 @@ type GlobalCheckpoints struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGlobalCheckpoints type alias for index. @@ -84,7 +87,12 @@ func New(tp elastictransport.Interface) *GlobalCheckpoints { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -105,6 +113,9 @@ func (r *GlobalCheckpoints) HttpRequest(ctx context.Context) (*http.Request, err case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_fleet") @@ -122,15 +133,15 @@ func (r *GlobalCheckpoints) HttpRequest(ctx context.Context) (*http.Request, err } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -147,27 +158,66 @@ func (r *GlobalCheckpoints) HttpRequest(ctx context.Context) (*http.Request, err } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GlobalCheckpoints) Perform(ctx context.Context) (*http.Response, error) { +func (r GlobalCheckpoints) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "fleet.global_checkpoints") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "fleet.global_checkpoints") + if reader := instrument.RecordRequestBody(ctx, "fleet.global_checkpoints", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "fleet.global_checkpoints") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GlobalCheckpoints query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GlobalCheckpoints query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a globalcheckpoints.Response -func (r GlobalCheckpoints) Do(ctx context.Context) (*Response, error) { +func (r GlobalCheckpoints) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "fleet.global_checkpoints") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -175,6 +225,9 @@ func (r GlobalCheckpoints) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,6 +237,9 @@ func (r GlobalCheckpoints) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -191,12 +247,25 @@ func (r GlobalCheckpoints) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GlobalCheckpoints) IsSuccess(ctx context.Context) (bool, error) { +func (r GlobalCheckpoints) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "fleet.global_checkpoints") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -212,6 +281,14 @@ func (r GlobalCheckpoints) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GlobalCheckpoints query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/globalcheckpoints/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/globalcheckpoints/response.go index 430b8e84a..a317131e7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/globalcheckpoints/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/globalcheckpoints/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package globalcheckpoints // Response holds the response body struct for the package globalcheckpoints // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/fleet/global_checkpoints/GlobalCheckpointsResponse.ts#L22-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/fleet/global_checkpoints/GlobalCheckpointsResponse.ts#L22-L27 type Response struct { GlobalCheckpoints []int64 `json:"global_checkpoints"` TimedOut bool `json:"timed_out"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/msearch/msearch.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/msearch/msearch.go index 18416340f..b0027467a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/msearch/msearch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/msearch/msearch.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Multi Search API where the search will only be executed after specified // checkpoints are available due to a refresh. This API is designed for internal @@ -55,15 +55,19 @@ type Msearch struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewMsearch type alias for index. @@ -89,7 +93,14 @@ func New(tp elastictransport.Interface) *Msearch { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -128,9 +139,7 @@ func (r *Msearch) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { for _, elem := range *r.req { data, err := json.Marshal(elem) @@ -147,6 +156,10 @@ func (r *Msearch) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -160,6 +173,9 @@ func (r *Msearch) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_fleet") @@ -177,15 +193,15 @@ func (r *Msearch) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+x-ndjson;compatible-with=8") } } @@ -202,22 +218,58 @@ func (r *Msearch) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Msearch) Perform(ctx context.Context) (*http.Response, error) { +func (r Msearch) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "fleet.msearch") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "fleet.msearch") + if reader := instrument.RecordRequestBody(ctx, "fleet.msearch", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "fleet.msearch") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Msearch query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Msearch query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a msearch.Response -func (r Msearch) Do(ctx context.Context) (*Response, error) { +func (r Msearch) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "fleet.msearch") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() @@ -225,6 +277,9 @@ func (r Msearch) Do(ctx context.Context) (*Response, error) { res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -232,6 +287,9 @@ func (r Msearch) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -241,6 +299,9 @@ func (r Msearch) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -248,6 +309,9 @@ func (r Msearch) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/msearch/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/msearch/request.go index 0ed8ea0e9..2cf06ea39 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/msearch/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/msearch/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package msearch @@ -26,5 +26,5 @@ import ( // Request holds the request body struct for the package msearch // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/fleet/msearch/MultiSearchRequest.ts#L32-L115 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/fleet/msearch/MultiSearchRequest.ts#L32-L115 type Request = []types.MsearchRequestItem diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/msearch/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/msearch/response.go index a10637f75..2eda83155 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/msearch/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/msearch/response.go @@ -16,17 +16,22 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package msearch import ( + "bytes" + "encoding/json" + "errors" + "io" + "github.com/elastic/go-elasticsearch/v8/typedapi/types" ) // Response holds the response body struct for the package msearch // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/fleet/msearch/MultiSearchResponse.ts#L25-L29 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/fleet/msearch/MultiSearchResponse.ts#L25-L29 type Response struct { Docs []types.MsearchResponseItem `json:"docs"` } @@ -36,3 +41,63 @@ func NewResponse() *Response { r := &Response{} return r } + +func (s *Response) UnmarshalJSON(data []byte) error { + dec := json.NewDecoder(bytes.NewReader(data)) + + for { + t, err := dec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "docs": + messageArray := []json.RawMessage{} + if err := dec.Decode(&messageArray); err != nil { + return err + } + docs: + for _, message := range messageArray { + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "aggregations", "_clusters", "fields", "hits", "max_score", "num_reduce_phases", "pit_id", "profile", "_scroll_id", "_shards", "suggest", "terminated_early", "timed_out", "took": + o := types.NewMultiSearchItem() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Docs = append(s.Docs, o) + continue docs + + case "error": + o := types.NewErrorResponseBase() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Docs = append(s.Docs, o) + continue docs + + } + } + } + + } + } + return nil +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/postsecret/post_secret.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/postsecret/post_secret.go new file mode 100644 index 000000000..84d9742ac --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/postsecret/post_secret.go @@ -0,0 +1,226 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated from the elasticsearch-specification DO NOT EDIT. +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c + +// Creates a secret stored by Fleet. +package postsecret + +import ( + "context" + "errors" + "fmt" + "io" + "io/ioutil" + "net/http" + "net/url" + "strings" + + "github.com/elastic/elastic-transport-go/v8/elastictransport" +) + +// ErrBuildPath is returned in case of missing parameters within the build of the request. +var ErrBuildPath = errors.New("cannot build path, check for missing path parameters") + +type PostSecret struct { + transport elastictransport.Interface + + headers http.Header + values url.Values + path url.URL + + raw io.Reader + + paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation +} + +// NewPostSecret type alias for index. +type NewPostSecret func() *PostSecret + +// NewPostSecretFunc returns a new instance of PostSecret with the provided transport. +// Used in the index of the library this allows to retrieve every apis in once place. +func NewPostSecretFunc(tp elastictransport.Interface) NewPostSecret { + return func() *PostSecret { + n := New(tp) + + return n + } +} + +// Creates a secret stored by Fleet. +// +// +func New(tp elastictransport.Interface) *PostSecret { + r := &PostSecret{ + transport: tp, + values: make(url.Values), + headers: make(http.Header), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + + return r +} + +// HttpRequest returns the http.Request object built from the +// given parameters. +func (r *PostSecret) HttpRequest(ctx context.Context) (*http.Request, error) { + var path strings.Builder + var method string + var req *http.Request + + var err error + + r.path.Scheme = "http" + + switch { + case r.paramSet == 0: + path.WriteString("/") + path.WriteString("_fleet") + path.WriteString("/") + path.WriteString("secret") + + method = http.MethodPost + } + + r.path.Path = path.String() + r.path.RawQuery = r.values.Encode() + + if r.path.Path == "" { + return nil, ErrBuildPath + } + + if ctx != nil { + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) + } else { + req, err = http.NewRequest(method, r.path.String(), r.raw) + } + + req.Header = r.headers.Clone() + + if req.Header.Get("Accept") == "" { + req.Header.Set("Accept", "application/vnd.elasticsearch+json;compatible-with=8") + } + + if err != nil { + return req, fmt.Errorf("could not build http.Request: %w", err) + } + + return req, nil +} + +// Perform runs the http.Request through the provided transport and returns an http.Response. +func (r PostSecret) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "fleet.post_secret") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + + req, err := r.HttpRequest(ctx) + if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "fleet.post_secret") + if reader := instrument.RecordRequestBody(ctx, "fleet.post_secret", r.raw); reader != nil { + req.Body = reader + } + } + res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "fleet.post_secret") + } + if err != nil { + localErr := fmt.Errorf("an error happened during the PostSecret query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr + } + + return res, nil +} + +// Do runs the request through the transport, handle the response and returns a postsecret.Response +func (r PostSecret) Do(ctx context.Context) (bool, error) { + return r.IsSuccess(ctx) +} + +// IsSuccess allows to run a query with a context and retrieve the result as a boolean. +// This only exists for endpoints without a request payload and allows for quick control flow. +func (r PostSecret) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "fleet.post_secret") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + res, err := r.Perform(ctx) + + if err != nil { + return false, err + } + io.Copy(ioutil.Discard, res.Body) + err = res.Body.Close() + if err != nil { + return false, err + } + + if res.StatusCode >= 200 && res.StatusCode < 300 { + return true, nil + } + + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the PostSecret query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + + return false, nil +} + +// Header set a key, value pair in the PostSecret headers map. +func (r *PostSecret) Header(key, value string) *PostSecret { + r.headers.Set(key, value) + + return r +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/search/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/search/request.go index c2ee4e987..960361ec2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/search/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/search/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package search @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package search // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/fleet/search/SearchRequest.ts#L55-L260 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/fleet/search/SearchRequest.ts#L55-L260 type Request struct { Aggregations map[string]types.Aggregations `json:"aggregations,omitempty"` Collapse *types.FieldCollapse `json:"collapse,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/search/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/search/response.go index 7bd44dc8e..8cd2ffd1e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/search/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/search/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package search @@ -33,7 +33,7 @@ import ( // Response holds the response body struct for the package search // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/fleet/search/SearchResponse.ts#L33-L50 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/fleet/search/SearchResponse.ts#L33-L50 type Response struct { Aggregations map[string]types.Aggregate `json:"aggregations,omitempty"` Clusters_ *types.ClusterStatistics `json:"_clusters,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/search/search.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/search/search.go index 085cf0280..b337704a7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/search/search.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/fleet/search/search.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Search API where the search will only be executed after specified checkpoints // are available due to a refresh. This API is designed for internal use by the @@ -57,15 +57,19 @@ type Search struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewSearch type alias for index. @@ -93,11 +97,18 @@ func New(tp elastictransport.Interface) *Search { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -134,9 +145,7 @@ func (r *Search) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -148,12 +157,19 @@ func (r *Search) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_fleet") @@ -171,15 +187,15 @@ func (r *Search) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -196,22 +212,58 @@ func (r *Search) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Search) Perform(ctx context.Context) (*http.Response, error) { +func (r Search) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "fleet.search") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "fleet.search") + if reader := instrument.RecordRequestBody(ctx, "fleet.search", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "fleet.search") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Search query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Search query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a search.Response -func (r Search) Do(ctx context.Context) (*Response, error) { +func (r Search) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "fleet.search") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() @@ -219,6 +271,9 @@ func (r Search) Do(ctx context.Context) (*Response, error) { res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -226,6 +281,9 @@ func (r Search) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -235,6 +293,9 @@ func (r Search) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -242,6 +303,9 @@ func (r Search) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/graph/explore/explore.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/graph/explore/explore.go index ee141a7b1..048eb13c4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/graph/explore/explore.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/graph/explore/explore.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Explore extracted and summarized information about the documents and terms in // an index. @@ -51,15 +51,19 @@ type Explore struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewExplore type alias for index. @@ -86,11 +90,18 @@ func New(tp elastictransport.Interface) *Explore { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -127,9 +138,7 @@ func (r *Explore) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -141,12 +150,19 @@ func (r *Explore) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_graph") @@ -164,15 +180,15 @@ func (r *Explore) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -189,27 +205,66 @@ func (r *Explore) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Explore) Perform(ctx context.Context) (*http.Response, error) { +func (r Explore) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "graph.explore") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "graph.explore") + if reader := instrument.RecordRequestBody(ctx, "graph.explore", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "graph.explore") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Explore query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Explore query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a explore.Response -func (r Explore) Do(ctx context.Context) (*Response, error) { +func (r Explore) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "graph.explore") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -217,6 +272,9 @@ func (r Explore) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -226,6 +284,9 @@ func (r Explore) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -233,6 +294,9 @@ func (r Explore) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/graph/explore/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/graph/explore/request.go index 5b66d285f..7ee04d74c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/graph/explore/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/graph/explore/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package explore @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package explore // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/graph/explore/GraphExploreRequest.ts#L28-L72 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/graph/explore/GraphExploreRequest.ts#L28-L72 type Request struct { // Connections Specifies or more fields from which you want to extract terms that are diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/graph/explore/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/graph/explore/response.go index b041c28d0..7ceb6c1d7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/graph/explore/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/graph/explore/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package explore @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package explore // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/graph/explore/GraphExploreResponse.ts#L25-L33 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/graph/explore/GraphExploreResponse.ts#L25-L33 type Response struct { Connections []types.Connection `json:"connections"` Failures []types.ShardFailure `json:"failures"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/deletelifecycle/delete_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/deletelifecycle/delete_lifecycle.go index 6c54b3549..75aa0bb28 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/deletelifecycle/delete_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/deletelifecycle/delete_lifecycle.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes the specified lifecycle policy definition. A currently used policy // cannot be deleted. package deletelifecycle import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type DeleteLifecycle struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int policy string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteLifecycle type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *DeleteLifecycle { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,6 +116,9 @@ func (r *DeleteLifecycle) HttpRequest(ctx context.Context) (*http.Request, error path.WriteString("policy") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "policy", r.policy) + } path.WriteString(r.policy) method = http.MethodDelete @@ -121,9 +132,9 @@ func (r *DeleteLifecycle) HttpRequest(ctx context.Context) (*http.Request, error } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -140,27 +151,66 @@ func (r *DeleteLifecycle) HttpRequest(ctx context.Context) (*http.Request, error } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteLifecycle) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteLifecycle) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ilm.delete_lifecycle") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ilm.delete_lifecycle") + if reader := instrument.RecordRequestBody(ctx, "ilm.delete_lifecycle", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ilm.delete_lifecycle") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteLifecycle query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteLifecycle query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deletelifecycle.Response -func (r DeleteLifecycle) Do(ctx context.Context) (*Response, error) { +func (r DeleteLifecycle) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ilm.delete_lifecycle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -168,6 +218,9 @@ func (r DeleteLifecycle) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -177,6 +230,9 @@ func (r DeleteLifecycle) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,12 +240,25 @@ func (r DeleteLifecycle) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteLifecycle) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteLifecycle) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ilm.delete_lifecycle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -205,6 +274,14 @@ func (r DeleteLifecycle) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteLifecycle query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/deletelifecycle/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/deletelifecycle/response.go index 0f9dd3ed3..7dcb0b63e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/deletelifecycle/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/deletelifecycle/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deletelifecycle // Response holds the response body struct for the package deletelifecycle // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ilm/delete_lifecycle/DeleteLifecycleResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ilm/delete_lifecycle/DeleteLifecycleResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/explainlifecycle/explain_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/explainlifecycle/explain_lifecycle.go index c722285e4..b12d4532c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/explainlifecycle/explain_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/explainlifecycle/explain_lifecycle.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves information about the index's current lifecycle state, such as the // currently executing phase, action, and step. package explainlifecycle import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,11 +52,15 @@ type ExplainLifecycle struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewExplainLifecycle type alias for index. @@ -84,7 +87,12 @@ func New(tp elastictransport.Interface) *ExplainLifecycle { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -105,6 +113,9 @@ func (r *ExplainLifecycle) HttpRequest(ctx context.Context) (*http.Request, erro case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_ilm") @@ -122,9 +133,9 @@ func (r *ExplainLifecycle) HttpRequest(ctx context.Context) (*http.Request, erro } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -141,27 +152,66 @@ func (r *ExplainLifecycle) HttpRequest(ctx context.Context) (*http.Request, erro } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ExplainLifecycle) Perform(ctx context.Context) (*http.Response, error) { +func (r ExplainLifecycle) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ilm.explain_lifecycle") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ilm.explain_lifecycle") + if reader := instrument.RecordRequestBody(ctx, "ilm.explain_lifecycle", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ilm.explain_lifecycle") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ExplainLifecycle query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ExplainLifecycle query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a explainlifecycle.Response -func (r ExplainLifecycle) Do(ctx context.Context) (*Response, error) { +func (r ExplainLifecycle) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ilm.explain_lifecycle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -169,6 +219,9 @@ func (r ExplainLifecycle) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -178,6 +231,9 @@ func (r ExplainLifecycle) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -185,12 +241,25 @@ func (r ExplainLifecycle) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ExplainLifecycle) IsSuccess(ctx context.Context) (bool, error) { +func (r ExplainLifecycle) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ilm.explain_lifecycle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -206,6 +275,14 @@ func (r ExplainLifecycle) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ExplainLifecycle query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/explainlifecycle/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/explainlifecycle/response.go index 1ebce73a8..6631936ae 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/explainlifecycle/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/explainlifecycle/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package explainlifecycle @@ -31,7 +31,7 @@ import ( // Response holds the response body struct for the package explainlifecycle // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ilm/explain_lifecycle/ExplainLifecycleResponse.ts#L24-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ilm/explain_lifecycle/ExplainLifecycleResponse.ts#L24-L28 type Response struct { Indices map[string]types.LifecycleExplain `json:"indices"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/getlifecycle/get_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/getlifecycle/get_lifecycle.go index cb49aa0ea..fd4f42b4e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/getlifecycle/get_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/getlifecycle/get_lifecycle.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns the specified policy definition. Includes the policy version and last // modified date. package getlifecycle import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type GetLifecycle struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int policy string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetLifecycle type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *GetLifecycle { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *GetLifecycle) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("policy") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "policy", r.policy) + } path.WriteString(r.policy) method = http.MethodGet @@ -126,9 +137,9 @@ func (r *GetLifecycle) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -145,27 +156,66 @@ func (r *GetLifecycle) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetLifecycle) Perform(ctx context.Context) (*http.Response, error) { +func (r GetLifecycle) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ilm.get_lifecycle") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ilm.get_lifecycle") + if reader := instrument.RecordRequestBody(ctx, "ilm.get_lifecycle", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ilm.get_lifecycle") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetLifecycle query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetLifecycle query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getlifecycle.Response -func (r GetLifecycle) Do(ctx context.Context) (Response, error) { +func (r GetLifecycle) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ilm.get_lifecycle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -173,6 +223,9 @@ func (r GetLifecycle) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,6 +235,9 @@ func (r GetLifecycle) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -189,12 +245,25 @@ func (r GetLifecycle) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetLifecycle) IsSuccess(ctx context.Context) (bool, error) { +func (r GetLifecycle) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ilm.get_lifecycle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -210,6 +279,14 @@ func (r GetLifecycle) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetLifecycle query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/getlifecycle/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/getlifecycle/response.go index fe5899d57..342e6167a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/getlifecycle/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/getlifecycle/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getlifecycle @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getlifecycle // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ilm/get_lifecycle/GetLifecycleResponse.ts#L23-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ilm/get_lifecycle/GetLifecycleResponse.ts#L23-L25 type Response map[string]types.Lifecycle diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/getstatus/get_status.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/getstatus/get_status.go index edc2528e3..bd7d3f540 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/getstatus/get_status.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/getstatus/get_status.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves the current index lifecycle management (ILM) status. package getstatus import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -47,9 +46,13 @@ type GetStatus struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetStatus type alias for index. @@ -73,7 +76,12 @@ func New(tp elastictransport.Interface) *GetStatus { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,9 +116,9 @@ func (r *GetStatus) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -127,27 +135,66 @@ func (r *GetStatus) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetStatus) Perform(ctx context.Context) (*http.Response, error) { +func (r GetStatus) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ilm.get_status") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ilm.get_status") + if reader := instrument.RecordRequestBody(ctx, "ilm.get_status", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ilm.get_status") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetStatus query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetStatus query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getstatus.Response -func (r GetStatus) Do(ctx context.Context) (*Response, error) { +func (r GetStatus) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ilm.get_status") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -155,6 +202,9 @@ func (r GetStatus) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -164,6 +214,9 @@ func (r GetStatus) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -171,12 +224,25 @@ func (r GetStatus) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetStatus) IsSuccess(ctx context.Context) (bool, error) { +func (r GetStatus) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ilm.get_status") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -192,6 +258,14 @@ func (r GetStatus) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetStatus query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/getstatus/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/getstatus/response.go index 15bf7641e..7e396e6f4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/getstatus/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/getstatus/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getstatus @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getstatus // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ilm/get_status/GetIlmStatusResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ilm/get_status/GetIlmStatusResponse.ts#L22-L24 type Response struct { OperationMode lifecycleoperationmode.LifecycleOperationMode `json:"operation_mode"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/migratetodatatiers/migrate_to_data_tiers.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/migratetodatatiers/migrate_to_data_tiers.go index 9efb7f79f..32075280c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/migratetodatatiers/migrate_to_data_tiers.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/migratetodatatiers/migrate_to_data_tiers.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Migrates the indices and ILM policies away from custom node attribute // allocation routing to data tiers routing @@ -48,13 +48,17 @@ type MigrateToDataTiers struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewMigrateToDataTiers type alias for index. @@ -79,11 +83,18 @@ func New(tp elastictransport.Interface) *MigrateToDataTiers { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -120,9 +131,7 @@ func (r *MigrateToDataTiers) HttpRequest(ctx context.Context) (*http.Request, er } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -134,6 +143,10 @@ func (r *MigrateToDataTiers) HttpRequest(ctx context.Context) (*http.Request, er } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -154,15 +167,15 @@ func (r *MigrateToDataTiers) HttpRequest(ctx context.Context) (*http.Request, er } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -179,27 +192,66 @@ func (r *MigrateToDataTiers) HttpRequest(ctx context.Context) (*http.Request, er } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r MigrateToDataTiers) Perform(ctx context.Context) (*http.Response, error) { +func (r MigrateToDataTiers) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ilm.migrate_to_data_tiers") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ilm.migrate_to_data_tiers") + if reader := instrument.RecordRequestBody(ctx, "ilm.migrate_to_data_tiers", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ilm.migrate_to_data_tiers") + } if err != nil { - return nil, fmt.Errorf("an error happened during the MigrateToDataTiers query execution: %w", err) + localErr := fmt.Errorf("an error happened during the MigrateToDataTiers query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a migratetodatatiers.Response -func (r MigrateToDataTiers) Do(ctx context.Context) (*Response, error) { +func (r MigrateToDataTiers) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ilm.migrate_to_data_tiers") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -207,6 +259,9 @@ func (r MigrateToDataTiers) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -216,6 +271,9 @@ func (r MigrateToDataTiers) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -223,6 +281,9 @@ func (r MigrateToDataTiers) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/migratetodatatiers/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/migratetodatatiers/request.go index 7ad9e6710..5c5033e4b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/migratetodatatiers/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/migratetodatatiers/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package migratetodatatiers @@ -27,7 +27,7 @@ import ( // Request holds the request body struct for the package migratetodatatiers // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ilm/migrate_to_data_tiers/Request.ts#L22-L43 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ilm/migrate_to_data_tiers/Request.ts#L22-L43 type Request struct { LegacyTemplateToDelete *string `json:"legacy_template_to_delete,omitempty"` NodeAttribute *string `json:"node_attribute,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/migratetodatatiers/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/migratetodatatiers/response.go index 0273c467c..7f0d5c028 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/migratetodatatiers/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/migratetodatatiers/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package migratetodatatiers @@ -30,7 +30,7 @@ import ( // Response holds the response body struct for the package migratetodatatiers // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ilm/migrate_to_data_tiers/Response.ts#L22-L32 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ilm/migrate_to_data_tiers/Response.ts#L22-L32 type Response struct { DryRun bool `json:"dry_run"` MigratedComponentTemplates []string `json:"migrated_component_templates"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/movetostep/move_to_step.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/movetostep/move_to_step.go index c8302b416..f607091b1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/movetostep/move_to_step.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/movetostep/move_to_step.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Manually moves an index into the specified step and executes that step. package movetostep @@ -50,15 +50,19 @@ type MoveToStep struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewMoveToStep type alias for index. @@ -84,11 +88,18 @@ func New(tp elastictransport.Interface) *MoveToStep { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -125,9 +136,7 @@ func (r *MoveToStep) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -139,6 +148,10 @@ func (r *MoveToStep) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -149,6 +162,9 @@ func (r *MoveToStep) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("move") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) method = http.MethodPost @@ -162,15 +178,15 @@ func (r *MoveToStep) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -187,27 +203,66 @@ func (r *MoveToStep) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r MoveToStep) Perform(ctx context.Context) (*http.Response, error) { +func (r MoveToStep) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ilm.move_to_step") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ilm.move_to_step") + if reader := instrument.RecordRequestBody(ctx, "ilm.move_to_step", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ilm.move_to_step") + } if err != nil { - return nil, fmt.Errorf("an error happened during the MoveToStep query execution: %w", err) + localErr := fmt.Errorf("an error happened during the MoveToStep query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a movetostep.Response -func (r MoveToStep) Do(ctx context.Context) (*Response, error) { +func (r MoveToStep) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ilm.move_to_step") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -215,6 +270,9 @@ func (r MoveToStep) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -224,6 +282,9 @@ func (r MoveToStep) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -231,6 +292,9 @@ func (r MoveToStep) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/movetostep/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/movetostep/request.go index 9dc92a1fd..1ab021a5a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/movetostep/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/movetostep/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package movetostep @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package movetostep // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ilm/move_to_step/MoveToStepRequest.ts#L24-L36 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ilm/move_to_step/MoveToStepRequest.ts#L24-L36 type Request struct { CurrentStep *types.StepKey `json:"current_step,omitempty"` NextStep *types.StepKey `json:"next_step,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/movetostep/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/movetostep/response.go index 5622740ea..b95b56973 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/movetostep/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/movetostep/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package movetostep // Response holds the response body struct for the package movetostep // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ilm/move_to_step/MoveToStepResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ilm/move_to_step/MoveToStepResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/putlifecycle/put_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/putlifecycle/put_lifecycle.go index b64216a56..62b635c29 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/putlifecycle/put_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/putlifecycle/put_lifecycle.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates a lifecycle policy package putlifecycle @@ -50,15 +50,19 @@ type PutLifecycle struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int policy string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutLifecycle type alias for index. @@ -84,11 +88,18 @@ func New(tp elastictransport.Interface) *PutLifecycle { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -125,9 +136,7 @@ func (r *PutLifecycle) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -139,6 +148,10 @@ func (r *PutLifecycle) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -149,6 +162,9 @@ func (r *PutLifecycle) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("policy") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "policy", r.policy) + } path.WriteString(r.policy) method = http.MethodPut @@ -162,15 +178,15 @@ func (r *PutLifecycle) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -187,27 +203,66 @@ func (r *PutLifecycle) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutLifecycle) Perform(ctx context.Context) (*http.Response, error) { +func (r PutLifecycle) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ilm.put_lifecycle") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ilm.put_lifecycle") + if reader := instrument.RecordRequestBody(ctx, "ilm.put_lifecycle", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ilm.put_lifecycle") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutLifecycle query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutLifecycle query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a putlifecycle.Response -func (r PutLifecycle) Do(ctx context.Context) (*Response, error) { +func (r PutLifecycle) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ilm.put_lifecycle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -215,6 +270,9 @@ func (r PutLifecycle) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -224,6 +282,9 @@ func (r PutLifecycle) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -231,6 +292,9 @@ func (r PutLifecycle) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/putlifecycle/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/putlifecycle/request.go index 062390906..ea530e205 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/putlifecycle/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/putlifecycle/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putlifecycle @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package putlifecycle // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ilm/put_lifecycle/PutLifecycleRequest.ts#L25-L55 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ilm/put_lifecycle/PutLifecycleRequest.ts#L25-L55 type Request struct { Policy *types.IlmPolicy `json:"policy,omitempty"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/putlifecycle/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/putlifecycle/response.go index cc192a970..80b511bf7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/putlifecycle/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/putlifecycle/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putlifecycle // Response holds the response body struct for the package putlifecycle // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ilm/put_lifecycle/PutLifecycleResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ilm/put_lifecycle/PutLifecycleResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/removepolicy/remove_policy.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/removepolicy/remove_policy.go index e2c712d56..d29fe6a1d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/removepolicy/remove_policy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/removepolicy/remove_policy.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Removes the assigned lifecycle policy and stops managing the specified index package removepolicy import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type RemovePolicy struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewRemovePolicy type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *RemovePolicy { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -102,6 +110,9 @@ func (r *RemovePolicy) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_ilm") @@ -119,9 +130,9 @@ func (r *RemovePolicy) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -138,27 +149,66 @@ func (r *RemovePolicy) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r RemovePolicy) Perform(ctx context.Context) (*http.Response, error) { +func (r RemovePolicy) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ilm.remove_policy") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ilm.remove_policy") + if reader := instrument.RecordRequestBody(ctx, "ilm.remove_policy", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ilm.remove_policy") + } if err != nil { - return nil, fmt.Errorf("an error happened during the RemovePolicy query execution: %w", err) + localErr := fmt.Errorf("an error happened during the RemovePolicy query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a removepolicy.Response -func (r RemovePolicy) Do(ctx context.Context) (*Response, error) { +func (r RemovePolicy) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ilm.remove_policy") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -166,6 +216,9 @@ func (r RemovePolicy) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,6 +228,9 @@ func (r RemovePolicy) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,12 +238,25 @@ func (r RemovePolicy) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r RemovePolicy) IsSuccess(ctx context.Context) (bool, error) { +func (r RemovePolicy) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ilm.remove_policy") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -203,6 +272,14 @@ func (r RemovePolicy) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the RemovePolicy query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/removepolicy/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/removepolicy/response.go index c00dfd107..81d117241 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/removepolicy/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/removepolicy/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package removepolicy // Response holds the response body struct for the package removepolicy // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ilm/remove_policy/RemovePolicyResponse.ts#L22-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ilm/remove_policy/RemovePolicyResponse.ts#L22-L27 type Response struct { FailedIndexes []string `json:"failed_indexes"` HasFailures bool `json:"has_failures"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/retry/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/retry/response.go index 8f57b8f51..4642f2f90 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/retry/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/retry/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package retry // Response holds the response body struct for the package retry // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ilm/retry/RetryIlmResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ilm/retry/RetryIlmResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/retry/retry.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/retry/retry.go index f505263e3..d855c912d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/retry/retry.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/retry/retry.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retries executing the policy for an index that is in the ERROR step. package retry import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type Retry struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewRetry type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *Retry { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -102,6 +110,9 @@ func (r *Retry) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_ilm") @@ -119,9 +130,9 @@ func (r *Retry) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -138,27 +149,66 @@ func (r *Retry) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Retry) Perform(ctx context.Context) (*http.Response, error) { +func (r Retry) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ilm.retry") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ilm.retry") + if reader := instrument.RecordRequestBody(ctx, "ilm.retry", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ilm.retry") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Retry query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Retry query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a retry.Response -func (r Retry) Do(ctx context.Context) (*Response, error) { +func (r Retry) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ilm.retry") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -166,6 +216,9 @@ func (r Retry) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,6 +228,9 @@ func (r Retry) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,12 +238,25 @@ func (r Retry) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Retry) IsSuccess(ctx context.Context) (bool, error) { +func (r Retry) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ilm.retry") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -203,6 +272,14 @@ func (r Retry) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Retry query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/start/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/start/response.go index 6b21478af..f58497c4d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/start/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/start/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package start // Response holds the response body struct for the package start // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ilm/start/StartIlmResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ilm/start/StartIlmResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/start/start.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/start/start.go index d173da9f3..994271a4d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/start/start.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/start/start.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Start the index lifecycle management (ILM) plugin. package start import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -47,9 +46,13 @@ type Start struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewStart type alias for index. @@ -73,7 +76,12 @@ func New(tp elastictransport.Interface) *Start { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,9 +116,9 @@ func (r *Start) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -127,27 +135,66 @@ func (r *Start) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Start) Perform(ctx context.Context) (*http.Response, error) { +func (r Start) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ilm.start") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ilm.start") + if reader := instrument.RecordRequestBody(ctx, "ilm.start", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ilm.start") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Start query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Start query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a start.Response -func (r Start) Do(ctx context.Context) (*Response, error) { +func (r Start) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ilm.start") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -155,6 +202,9 @@ func (r Start) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -164,6 +214,9 @@ func (r Start) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -171,12 +224,25 @@ func (r Start) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Start) IsSuccess(ctx context.Context) (bool, error) { +func (r Start) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ilm.start") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -192,6 +258,14 @@ func (r Start) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Start query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/stop/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/stop/response.go index 190cc817c..e7d4fe32b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/stop/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/stop/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package stop // Response holds the response body struct for the package stop // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ilm/stop/StopIlmResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ilm/stop/StopIlmResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/stop/stop.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/stop/stop.go index fedb7496c..010298c3a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/stop/stop.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ilm/stop/stop.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Halts all lifecycle management operations and stops the index lifecycle // management (ILM) plugin package stop import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -48,9 +47,13 @@ type Stop struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewStop type alias for index. @@ -75,7 +78,12 @@ func New(tp elastictransport.Interface) *Stop { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -110,9 +118,9 @@ func (r *Stop) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -129,27 +137,66 @@ func (r *Stop) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Stop) Perform(ctx context.Context) (*http.Response, error) { +func (r Stop) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ilm.stop") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ilm.stop") + if reader := instrument.RecordRequestBody(ctx, "ilm.stop", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ilm.stop") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Stop query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Stop query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a stop.Response -func (r Stop) Do(ctx context.Context) (*Response, error) { +func (r Stop) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ilm.stop") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -157,6 +204,9 @@ func (r Stop) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -166,6 +216,9 @@ func (r Stop) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -173,12 +226,25 @@ func (r Stop) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Stop) IsSuccess(ctx context.Context) (bool, error) { +func (r Stop) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ilm.stop") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -194,6 +260,14 @@ func (r Stop) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Stop query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/addblock/add_block.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/addblock/add_block.go index ae637e234..6e2e032e0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/addblock/add_block.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/addblock/add_block.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Adds a block to an index. package addblock import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -55,12 +54,16 @@ type AddBlock struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string block string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewAddBlock type alias for index. @@ -88,7 +91,12 @@ func New(tp elastictransport.Interface) *AddBlock { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -109,11 +117,17 @@ func (r *AddBlock) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask|blockMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_block") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "block", r.block) + } path.WriteString(r.block) method = http.MethodPut @@ -127,9 +141,9 @@ func (r *AddBlock) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -146,27 +160,66 @@ func (r *AddBlock) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r AddBlock) Perform(ctx context.Context) (*http.Response, error) { +func (r AddBlock) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.add_block") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.add_block") + if reader := instrument.RecordRequestBody(ctx, "indices.add_block", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.add_block") + } if err != nil { - return nil, fmt.Errorf("an error happened during the AddBlock query execution: %w", err) + localErr := fmt.Errorf("an error happened during the AddBlock query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a addblock.Response -func (r AddBlock) Do(ctx context.Context) (*Response, error) { +func (r AddBlock) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.add_block") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -174,6 +227,9 @@ func (r AddBlock) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -183,6 +239,9 @@ func (r AddBlock) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -190,12 +249,25 @@ func (r AddBlock) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r AddBlock) IsSuccess(ctx context.Context) (bool, error) { +func (r AddBlock) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.add_block") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -211,6 +283,14 @@ func (r AddBlock) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the AddBlock query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/addblock/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/addblock/response.go index 40b2a5500..5f7723673 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/addblock/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/addblock/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package addblock @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package addblock // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/add_block/IndicesAddBlockResponse.ts#L22-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/add_block/IndicesAddBlockResponse.ts#L22-L28 type Response struct { Acknowledged bool `json:"acknowledged"` Indices []types.IndicesBlockStatus `json:"indices"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/analyze/analyze.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/analyze/analyze.go index f4f9db56b..8303e3a98 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/analyze/analyze.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/analyze/analyze.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Performs the analysis process on a text and return the tokens breakdown of // the text. @@ -51,15 +51,19 @@ type Analyze struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewAnalyze type alias for index. @@ -84,11 +88,18 @@ func New(tp elastictransport.Interface) *Analyze { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -125,9 +136,7 @@ func (r *Analyze) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -139,6 +148,10 @@ func (r *Analyze) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -150,6 +163,9 @@ func (r *Analyze) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_analyze") @@ -165,15 +181,15 @@ func (r *Analyze) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -190,27 +206,66 @@ func (r *Analyze) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Analyze) Perform(ctx context.Context) (*http.Response, error) { +func (r Analyze) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.analyze") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.analyze") + if reader := instrument.RecordRequestBody(ctx, "indices.analyze", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.analyze") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Analyze query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Analyze query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a analyze.Response -func (r Analyze) Do(ctx context.Context) (*Response, error) { +func (r Analyze) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.analyze") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -218,6 +273,9 @@ func (r Analyze) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -227,6 +285,9 @@ func (r Analyze) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -234,6 +295,9 @@ func (r Analyze) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/analyze/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/analyze/request.go index 524c2ed95..fac825f5a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/analyze/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/analyze/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package analyze @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package analyze // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/analyze/IndicesAnalyzeRequest.ts#L27-L92 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/analyze/IndicesAnalyzeRequest.ts#L27-L92 type Request struct { // Analyzer The name of the analyzer that should be applied to the provided `text`. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/analyze/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/analyze/response.go index 7340a64cc..56dc9cb8f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/analyze/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/analyze/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package analyze @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package analyze // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/analyze/IndicesAnalyzeResponse.ts#L22-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/analyze/IndicesAnalyzeResponse.ts#L22-L27 type Response struct { Detail *types.AnalyzeDetail `json:"detail,omitempty"` Tokens []types.AnalyzeToken `json:"tokens,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/clearcache/clear_cache.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/clearcache/clear_cache.go index ce51674ec..87ff08a4a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/clearcache/clear_cache.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/clearcache/clear_cache.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Clears all or specific caches for one or more indices. package clearcache import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,11 +52,15 @@ type ClearCache struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewClearCache type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *ClearCache { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -109,6 +117,9 @@ func (r *ClearCache) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_cache") @@ -126,9 +137,9 @@ func (r *ClearCache) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -145,27 +156,66 @@ func (r *ClearCache) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ClearCache) Perform(ctx context.Context) (*http.Response, error) { +func (r ClearCache) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.clear_cache") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.clear_cache") + if reader := instrument.RecordRequestBody(ctx, "indices.clear_cache", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.clear_cache") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ClearCache query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ClearCache query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a clearcache.Response -func (r ClearCache) Do(ctx context.Context) (*Response, error) { +func (r ClearCache) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.clear_cache") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -173,6 +223,9 @@ func (r ClearCache) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,6 +235,9 @@ func (r ClearCache) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -189,12 +245,25 @@ func (r ClearCache) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ClearCache) IsSuccess(ctx context.Context) (bool, error) { +func (r ClearCache) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.clear_cache") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -210,6 +279,14 @@ func (r ClearCache) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ClearCache query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/clearcache/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/clearcache/response.go index 8ae109caf..062b74401 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/clearcache/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/clearcache/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package clearcache @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package clearcache // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/clear_cache/IndicesClearCacheResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/clear_cache/IndicesClearCacheResponse.ts#L22-L24 type Response struct { Shards_ types.ShardStatistics `json:"_shards"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/clone/clone.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/clone/clone.go index 09bb34894..b537541d9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/clone/clone.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/clone/clone.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Clones an index package clone @@ -52,16 +52,20 @@ type Clone struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string target string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewClone type alias for index. @@ -89,11 +93,18 @@ func New(tp elastictransport.Interface) *Clone { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -130,9 +141,7 @@ func (r *Clone) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -144,17 +153,27 @@ func (r *Clone) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { case r.paramSet == indexMask|targetMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_clone") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "target", r.target) + } path.WriteString(r.target) method = http.MethodPut @@ -168,15 +187,15 @@ func (r *Clone) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -193,27 +212,66 @@ func (r *Clone) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Clone) Perform(ctx context.Context) (*http.Response, error) { +func (r Clone) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.clone") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.clone") + if reader := instrument.RecordRequestBody(ctx, "indices.clone", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.clone") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Clone query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Clone query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a clone.Response -func (r Clone) Do(ctx context.Context) (*Response, error) { +func (r Clone) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.clone") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -221,6 +279,9 @@ func (r Clone) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -230,6 +291,9 @@ func (r Clone) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -237,6 +301,9 @@ func (r Clone) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/clone/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/clone/request.go index 60c0d0599..b929486a1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/clone/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/clone/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package clone @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package clone // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/clone/IndicesCloneRequest.ts#L27-L75 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/clone/IndicesCloneRequest.ts#L27-L75 type Request struct { // Aliases Aliases for the resulting index. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/clone/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/clone/response.go index 9990577cd..e3684c4f4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/clone/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/clone/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package clone // Response holds the response body struct for the package clone // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/clone/IndicesCloneResponse.ts#L22-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/clone/IndicesCloneResponse.ts#L22-L28 type Response struct { Acknowledged bool `json:"acknowledged"` Index string `json:"index"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/close/close.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/close/close.go index 8bcc7f207..6dcc061a2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/close/close.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/close/close.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Closes an index. package close import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,11 +52,15 @@ type Close struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewClose type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *Close { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *Close) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_close") @@ -119,9 +130,9 @@ func (r *Close) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -138,27 +149,66 @@ func (r *Close) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Close) Perform(ctx context.Context) (*http.Response, error) { +func (r Close) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.close") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.close") + if reader := instrument.RecordRequestBody(ctx, "indices.close", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.close") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Close query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Close query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a close.Response -func (r Close) Do(ctx context.Context) (*Response, error) { +func (r Close) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.close") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -166,6 +216,9 @@ func (r Close) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,6 +228,9 @@ func (r Close) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,12 +238,25 @@ func (r Close) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Close) IsSuccess(ctx context.Context) (bool, error) { +func (r Close) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.close") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -203,6 +272,14 @@ func (r Close) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Close query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/close/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/close/response.go index 1771b0923..da701901e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/close/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/close/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package close @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package close // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/close/CloseIndexResponse.ts#L24-L30 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/close/CloseIndexResponse.ts#L24-L30 type Response struct { Acknowledged bool `json:"acknowledged"` Indices map[string]types.CloseIndexResult `json:"indices"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/create/create.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/create/create.go index 853524141..00e3f68cf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/create/create.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/create/create.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates an index with optional settings and mappings. package create @@ -50,15 +50,19 @@ type Create struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewCreate type alias for index. @@ -84,11 +88,18 @@ func New(tp elastictransport.Interface) *Create { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -125,9 +136,7 @@ func (r *Create) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -139,12 +148,19 @@ func (r *Create) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) method = http.MethodPut @@ -158,15 +174,15 @@ func (r *Create) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -183,27 +199,66 @@ func (r *Create) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Create) Perform(ctx context.Context) (*http.Response, error) { +func (r Create) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.create") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.create") + if reader := instrument.RecordRequestBody(ctx, "indices.create", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.create") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Create query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Create query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a create.Response -func (r Create) Do(ctx context.Context) (*Response, error) { +func (r Create) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.create") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -211,6 +266,9 @@ func (r Create) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -220,6 +278,9 @@ func (r Create) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -227,6 +288,9 @@ func (r Create) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/create/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/create/request.go index 86e81eb66..58535e8fe 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/create/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/create/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package create @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package create // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/create/IndicesCreateRequest.ts#L28-L81 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/create/IndicesCreateRequest.ts#L28-L81 type Request struct { // Aliases Aliases for the index. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/create/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/create/response.go index 253345a65..37501153d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/create/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/create/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package create // Response holds the response body struct for the package create // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/create/IndicesCreateResponse.ts#L22-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/create/IndicesCreateResponse.ts#L22-L28 type Response struct { Acknowledged bool `json:"acknowledged"` Index string `json:"index"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/createdatastream/create_data_stream.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/createdatastream/create_data_stream.go index 21f69f05b..df70f07f5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/createdatastream/create_data_stream.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/createdatastream/create_data_stream.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates a data stream package createdatastream import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type CreateDataStream struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewCreateDataStream type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *CreateDataStream { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *CreateDataStream) HttpRequest(ctx context.Context) (*http.Request, erro path.WriteString("_data_stream") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodPut @@ -117,9 +128,9 @@ func (r *CreateDataStream) HttpRequest(ctx context.Context) (*http.Request, erro } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -136,27 +147,66 @@ func (r *CreateDataStream) HttpRequest(ctx context.Context) (*http.Request, erro } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r CreateDataStream) Perform(ctx context.Context) (*http.Response, error) { +func (r CreateDataStream) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.create_data_stream") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.create_data_stream") + if reader := instrument.RecordRequestBody(ctx, "indices.create_data_stream", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.create_data_stream") + } if err != nil { - return nil, fmt.Errorf("an error happened during the CreateDataStream query execution: %w", err) + localErr := fmt.Errorf("an error happened during the CreateDataStream query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a createdatastream.Response -func (r CreateDataStream) Do(ctx context.Context) (*Response, error) { +func (r CreateDataStream) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.create_data_stream") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -164,6 +214,9 @@ func (r CreateDataStream) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -173,6 +226,9 @@ func (r CreateDataStream) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -180,12 +236,25 @@ func (r CreateDataStream) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r CreateDataStream) IsSuccess(ctx context.Context) (bool, error) { +func (r CreateDataStream) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.create_data_stream") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -201,6 +270,14 @@ func (r CreateDataStream) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the CreateDataStream query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/createdatastream/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/createdatastream/response.go index 188f69a5c..54a76b584 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/createdatastream/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/createdatastream/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package createdatastream // Response holds the response body struct for the package createdatastream // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/create_data_stream/IndicesCreateDataStreamResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/create_data_stream/IndicesCreateDataStreamResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/datastreamsstats/data_streams_stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/datastreamsstats/data_streams_stats.go index a6e840da4..c40d55829 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/datastreamsstats/data_streams_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/datastreamsstats/data_streams_stats.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Provides statistics on operations happening in a data stream. package datastreamsstats import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type DataStreamsStats struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDataStreamsStats type alias for index. @@ -80,7 +83,12 @@ func New(tp elastictransport.Interface) *DataStreamsStats { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -110,6 +118,9 @@ func (r *DataStreamsStats) HttpRequest(ctx context.Context) (*http.Request, erro path.WriteString("_data_stream") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) path.WriteString("/") path.WriteString("_stats") @@ -125,9 +136,9 @@ func (r *DataStreamsStats) HttpRequest(ctx context.Context) (*http.Request, erro } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -144,27 +155,66 @@ func (r *DataStreamsStats) HttpRequest(ctx context.Context) (*http.Request, erro } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DataStreamsStats) Perform(ctx context.Context) (*http.Response, error) { +func (r DataStreamsStats) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.data_streams_stats") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.data_streams_stats") + if reader := instrument.RecordRequestBody(ctx, "indices.data_streams_stats", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.data_streams_stats") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DataStreamsStats query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DataStreamsStats query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a datastreamsstats.Response -func (r DataStreamsStats) Do(ctx context.Context) (*Response, error) { +func (r DataStreamsStats) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.data_streams_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -172,6 +222,9 @@ func (r DataStreamsStats) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -181,6 +234,9 @@ func (r DataStreamsStats) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -188,12 +244,25 @@ func (r DataStreamsStats) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DataStreamsStats) IsSuccess(ctx context.Context) (bool, error) { +func (r DataStreamsStats) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.data_streams_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -209,6 +278,14 @@ func (r DataStreamsStats) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DataStreamsStats query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/datastreamsstats/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/datastreamsstats/response.go index 68ba22eea..b1f08d91b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/datastreamsstats/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/datastreamsstats/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package datastreamsstats @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package datastreamsstats // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/data_streams_stats/IndicesDataStreamsStatsResponse.ts#L25-L43 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/data_streams_stats/IndicesDataStreamsStatsResponse.ts#L25-L43 type Response struct { // BackingIndices Total number of backing indices for the selected data streams. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/delete/delete.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/delete/delete.go index 2dda0676e..cc964df0e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/delete/delete.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/delete/delete.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes an index. package delete import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,11 +52,15 @@ type Delete struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDelete type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *Delete { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *Delete) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) method = http.MethodDelete @@ -117,9 +128,9 @@ func (r *Delete) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -136,27 +147,66 @@ func (r *Delete) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Delete) Perform(ctx context.Context) (*http.Response, error) { +func (r Delete) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.delete") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.delete") + if reader := instrument.RecordRequestBody(ctx, "indices.delete", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.delete") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Delete query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Delete query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a delete.Response -func (r Delete) Do(ctx context.Context) (*Response, error) { +func (r Delete) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.delete") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -164,6 +214,9 @@ func (r Delete) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -173,6 +226,9 @@ func (r Delete) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -180,12 +236,25 @@ func (r Delete) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Delete) IsSuccess(ctx context.Context) (bool, error) { +func (r Delete) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.delete") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -201,6 +270,14 @@ func (r Delete) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Delete query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/delete/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/delete/response.go index 297649ce9..397e6c651 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/delete/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/delete/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package delete @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package delete // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/delete/IndicesDeleteResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/delete/IndicesDeleteResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deletealias/delete_alias.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deletealias/delete_alias.go index c7c1b2c11..c3754a975 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deletealias/delete_alias.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deletealias/delete_alias.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes an alias. package deletealias import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,12 +52,16 @@ type DeleteAlias struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteAlias type alias for index. @@ -86,7 +89,12 @@ func New(tp elastictransport.Interface) *DeleteAlias { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -107,22 +115,34 @@ func (r *DeleteAlias) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask|nameMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_alias") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodDelete case r.paramSet == indexMask|nameMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_aliases") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodDelete @@ -136,9 +156,9 @@ func (r *DeleteAlias) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -155,27 +175,66 @@ func (r *DeleteAlias) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteAlias) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteAlias) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.delete_alias") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.delete_alias") + if reader := instrument.RecordRequestBody(ctx, "indices.delete_alias", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.delete_alias") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteAlias query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteAlias query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deletealias.Response -func (r DeleteAlias) Do(ctx context.Context) (*Response, error) { +func (r DeleteAlias) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.delete_alias") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -183,6 +242,9 @@ func (r DeleteAlias) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -192,6 +254,9 @@ func (r DeleteAlias) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -199,12 +264,25 @@ func (r DeleteAlias) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteAlias) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteAlias) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.delete_alias") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -220,6 +298,14 @@ func (r DeleteAlias) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteAlias query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deletealias/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deletealias/response.go index 1c293eaf5..f6a1aaabf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deletealias/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deletealias/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deletealias // Response holds the response body struct for the package deletealias // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/delete_alias/IndicesDeleteAliasResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/delete_alias/IndicesDeleteAliasResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deletedatalifecycle/delete_data_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deletedatalifecycle/delete_data_lifecycle.go index 515a40817..584f2eaad 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deletedatalifecycle/delete_data_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deletedatalifecycle/delete_data_lifecycle.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes the data stream lifecycle of the selected data streams. package deletedatalifecycle import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type DeleteDataLifecycle struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteDataLifecycle type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *DeleteDataLifecycle { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -105,6 +113,9 @@ func (r *DeleteDataLifecycle) HttpRequest(ctx context.Context) (*http.Request, e path.WriteString("_data_stream") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) path.WriteString("/") path.WriteString("_lifecycle") @@ -120,9 +131,9 @@ func (r *DeleteDataLifecycle) HttpRequest(ctx context.Context) (*http.Request, e } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -139,27 +150,66 @@ func (r *DeleteDataLifecycle) HttpRequest(ctx context.Context) (*http.Request, e } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteDataLifecycle) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteDataLifecycle) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.delete_data_lifecycle") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.delete_data_lifecycle") + if reader := instrument.RecordRequestBody(ctx, "indices.delete_data_lifecycle", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.delete_data_lifecycle") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteDataLifecycle query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteDataLifecycle query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deletedatalifecycle.Response -func (r DeleteDataLifecycle) Do(ctx context.Context) (*Response, error) { +func (r DeleteDataLifecycle) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.delete_data_lifecycle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -167,6 +217,9 @@ func (r DeleteDataLifecycle) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -176,6 +229,9 @@ func (r DeleteDataLifecycle) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -183,12 +239,25 @@ func (r DeleteDataLifecycle) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteDataLifecycle) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteDataLifecycle) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.delete_data_lifecycle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -204,6 +273,14 @@ func (r DeleteDataLifecycle) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteDataLifecycle query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deletedatalifecycle/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deletedatalifecycle/response.go index 2c6cf4e62..fe4e5941f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deletedatalifecycle/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deletedatalifecycle/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deletedatalifecycle // Response holds the response body struct for the package deletedatalifecycle // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/delete_data_lifecycle/IndicesDeleteDataLifecycleResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/delete_data_lifecycle/IndicesDeleteDataLifecycleResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deletedatastream/delete_data_stream.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deletedatastream/delete_data_stream.go index dfd494637..ed807a2f5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deletedatastream/delete_data_stream.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deletedatastream/delete_data_stream.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes a data stream. package deletedatastream import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type DeleteDataStream struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteDataStream type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *DeleteDataStream { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -105,6 +113,9 @@ func (r *DeleteDataStream) HttpRequest(ctx context.Context) (*http.Request, erro path.WriteString("_data_stream") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodDelete @@ -118,9 +129,9 @@ func (r *DeleteDataStream) HttpRequest(ctx context.Context) (*http.Request, erro } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -137,27 +148,66 @@ func (r *DeleteDataStream) HttpRequest(ctx context.Context) (*http.Request, erro } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteDataStream) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteDataStream) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.delete_data_stream") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.delete_data_stream") + if reader := instrument.RecordRequestBody(ctx, "indices.delete_data_stream", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.delete_data_stream") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteDataStream query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteDataStream query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deletedatastream.Response -func (r DeleteDataStream) Do(ctx context.Context) (*Response, error) { +func (r DeleteDataStream) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.delete_data_stream") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -165,6 +215,9 @@ func (r DeleteDataStream) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -174,6 +227,9 @@ func (r DeleteDataStream) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -181,12 +237,25 @@ func (r DeleteDataStream) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteDataStream) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteDataStream) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.delete_data_stream") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -202,6 +271,14 @@ func (r DeleteDataStream) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteDataStream query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deletedatastream/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deletedatastream/response.go index 4e8366a15..0fbb45183 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deletedatastream/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deletedatastream/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deletedatastream // Response holds the response body struct for the package deletedatastream // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/delete_data_stream/IndicesDeleteDataStreamResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/delete_data_stream/IndicesDeleteDataStreamResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deleteindextemplate/delete_index_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deleteindextemplate/delete_index_template.go index 7c0390db5..17a6fe3cf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deleteindextemplate/delete_index_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deleteindextemplate/delete_index_template.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes an index template. package deleteindextemplate import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type DeleteIndexTemplate struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteIndexTemplate type alias for index. @@ -75,13 +78,18 @@ func NewDeleteIndexTemplateFunc(tp elastictransport.Interface) NewDeleteIndexTem // Deletes an index template. // -// https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html +// https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-template.html func New(tp elastictransport.Interface) *DeleteIndexTemplate { r := &DeleteIndexTemplate{ transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *DeleteIndexTemplate) HttpRequest(ctx context.Context) (*http.Request, e path.WriteString("_index_template") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodDelete @@ -117,9 +128,9 @@ func (r *DeleteIndexTemplate) HttpRequest(ctx context.Context) (*http.Request, e } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -136,27 +147,66 @@ func (r *DeleteIndexTemplate) HttpRequest(ctx context.Context) (*http.Request, e } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteIndexTemplate) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteIndexTemplate) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.delete_index_template") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.delete_index_template") + if reader := instrument.RecordRequestBody(ctx, "indices.delete_index_template", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.delete_index_template") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteIndexTemplate query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteIndexTemplate query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deleteindextemplate.Response -func (r DeleteIndexTemplate) Do(ctx context.Context) (*Response, error) { +func (r DeleteIndexTemplate) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.delete_index_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -164,6 +214,9 @@ func (r DeleteIndexTemplate) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -173,6 +226,9 @@ func (r DeleteIndexTemplate) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -180,12 +236,25 @@ func (r DeleteIndexTemplate) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteIndexTemplate) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteIndexTemplate) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.delete_index_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -201,6 +270,14 @@ func (r DeleteIndexTemplate) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteIndexTemplate query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deleteindextemplate/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deleteindextemplate/response.go index 467facbba..37807e12e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deleteindextemplate/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deleteindextemplate/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deleteindextemplate // Response holds the response body struct for the package deleteindextemplate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/delete_index_template/IndicesDeleteIndexTemplateResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/delete_index_template/IndicesDeleteIndexTemplateResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deletetemplate/delete_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deletetemplate/delete_template.go index 65f81fdc8..f90a2e90a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deletetemplate/delete_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deletetemplate/delete_template.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes an index template. package deletetemplate import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type DeleteTemplate struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteTemplate type alias for index. @@ -75,13 +78,18 @@ func NewDeleteTemplateFunc(tp elastictransport.Interface) NewDeleteTemplate { // Deletes an index template. // -// https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html +// https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-template-v1.html func New(tp elastictransport.Interface) *DeleteTemplate { r := &DeleteTemplate{ transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *DeleteTemplate) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("_template") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodDelete @@ -117,9 +128,9 @@ func (r *DeleteTemplate) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -136,27 +147,66 @@ func (r *DeleteTemplate) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteTemplate) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteTemplate) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.delete_template") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.delete_template") + if reader := instrument.RecordRequestBody(ctx, "indices.delete_template", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.delete_template") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteTemplate query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteTemplate query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deletetemplate.Response -func (r DeleteTemplate) Do(ctx context.Context) (*Response, error) { +func (r DeleteTemplate) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.delete_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -164,6 +214,9 @@ func (r DeleteTemplate) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -173,6 +226,9 @@ func (r DeleteTemplate) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -180,12 +236,25 @@ func (r DeleteTemplate) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteTemplate) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteTemplate) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.delete_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -201,6 +270,14 @@ func (r DeleteTemplate) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteTemplate query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deletetemplate/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deletetemplate/response.go index 738d8c1b0..7ba27c46e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deletetemplate/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/deletetemplate/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deletetemplate // Response holds the response body struct for the package deletetemplate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/delete_template/IndicesDeleteTemplateResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/delete_template/IndicesDeleteTemplateResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/diskusage/disk_usage.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/diskusage/disk_usage.go index 18df3394e..3880fb7fb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/diskusage/disk_usage.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/diskusage/disk_usage.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Analyzes the disk usage of each field of an index or data stream package diskusage import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,11 +52,15 @@ type DiskUsage struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDiskUsage type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *DiskUsage { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *DiskUsage) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_disk_usage") @@ -119,9 +130,9 @@ func (r *DiskUsage) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -138,27 +149,66 @@ func (r *DiskUsage) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DiskUsage) Perform(ctx context.Context) (*http.Response, error) { +func (r DiskUsage) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.disk_usage") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.disk_usage") + if reader := instrument.RecordRequestBody(ctx, "indices.disk_usage", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.disk_usage") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DiskUsage query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DiskUsage query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a diskusage.Response -func (r DiskUsage) Do(ctx context.Context) (Response, error) { +func (r DiskUsage) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.disk_usage") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := new(Response) res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -166,6 +216,9 @@ func (r DiskUsage) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,6 +228,9 @@ func (r DiskUsage) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,12 +238,25 @@ func (r DiskUsage) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DiskUsage) IsSuccess(ctx context.Context) (bool, error) { +func (r DiskUsage) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.disk_usage") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -203,6 +272,14 @@ func (r DiskUsage) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DiskUsage query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/diskusage/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/diskusage/response.go index bc76354a4..d0a56a86c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/diskusage/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/diskusage/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package diskusage @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package diskusage // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/disk_usage/IndicesDiskUsageResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/disk_usage/IndicesDiskUsageResponse.ts#L22-L24 type Response = json.RawMessage diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/downsample/downsample.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/downsample/downsample.go index ea8da88d4..11ec62a77 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/downsample/downsample.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/downsample/downsample.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Downsample an index package downsample @@ -52,16 +52,20 @@ type Downsample struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string targetindex string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDownsample type alias for index. @@ -89,7 +93,14 @@ func New(tp elastictransport.Interface) *Downsample { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -128,9 +139,7 @@ func (r *Downsample) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -142,17 +151,27 @@ func (r *Downsample) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { case r.paramSet == indexMask|targetindexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_downsample") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "targetindex", r.targetindex) + } path.WriteString(r.targetindex) method = http.MethodPost @@ -166,15 +185,15 @@ func (r *Downsample) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -191,27 +210,66 @@ func (r *Downsample) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Downsample) Perform(ctx context.Context) (*http.Response, error) { +func (r Downsample) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.downsample") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.downsample") + if reader := instrument.RecordRequestBody(ctx, "indices.downsample", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.downsample") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Downsample query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Downsample query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a downsample.Response -func (r Downsample) Do(ctx context.Context) (Response, error) { +func (r Downsample) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.downsample") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := new(Response) res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -219,6 +277,9 @@ func (r Downsample) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -228,6 +289,9 @@ func (r Downsample) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -235,6 +299,9 @@ func (r Downsample) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/downsample/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/downsample/request.go index f3a0f8293..3919c1a40 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/downsample/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/downsample/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package downsample @@ -26,5 +26,5 @@ import ( // Request holds the request body struct for the package downsample // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/downsample/Request.ts#L24-L44 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/downsample/Request.ts#L24-L44 type Request = types.DownsampleConfig diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/downsample/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/downsample/response.go index 0f0bb46cf..eb4d60525 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/downsample/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/downsample/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package downsample @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package downsample // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/downsample/Response.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/downsample/Response.ts#L22-L24 type Response = json.RawMessage diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/exists/exists.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/exists/exists.go index 975e6c2a6..26508e240 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/exists/exists.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/exists/exists.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns information about whether a particular index exists. package exists import ( - gobytes "bytes" "context" "errors" "fmt" @@ -51,11 +50,15 @@ type Exists struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewExists type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *Exists { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -102,6 +110,9 @@ func (r *Exists) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) method = http.MethodHead @@ -115,9 +126,9 @@ func (r *Exists) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -134,15 +145,42 @@ func (r *Exists) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Exists) Perform(ctx context.Context) (*http.Response, error) { +func (r Exists) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.exists") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.exists") + if reader := instrument.RecordRequestBody(ctx, "indices.exists", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.exists") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Exists query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Exists query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil @@ -155,7 +193,17 @@ func (r Exists) Do(ctx context.Context) (bool, error) { // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Exists) IsSuccess(ctx context.Context) (bool, error) { +func (r Exists) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.exists") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -171,6 +219,14 @@ func (r Exists) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Exists query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/existsalias/exists_alias.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/existsalias/exists_alias.go index 4553126e3..055c04ef2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/existsalias/exists_alias.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/existsalias/exists_alias.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns information about whether a particular alias exists. package existsalias import ( - gobytes "bytes" "context" "errors" "fmt" @@ -53,12 +52,16 @@ type ExistsAlias struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewExistsAlias type alias for index. @@ -84,7 +87,12 @@ func New(tp elastictransport.Interface) *ExistsAlias { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -107,17 +115,26 @@ func (r *ExistsAlias) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_alias") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodHead case r.paramSet == indexMask|nameMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_alias") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodHead @@ -131,9 +148,9 @@ func (r *ExistsAlias) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -150,15 +167,42 @@ func (r *ExistsAlias) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ExistsAlias) Perform(ctx context.Context) (*http.Response, error) { +func (r ExistsAlias) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.exists_alias") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.exists_alias") + if reader := instrument.RecordRequestBody(ctx, "indices.exists_alias", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.exists_alias") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ExistsAlias query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ExistsAlias query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil @@ -171,7 +215,17 @@ func (r ExistsAlias) Do(ctx context.Context) (bool, error) { // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ExistsAlias) IsSuccess(ctx context.Context) (bool, error) { +func (r ExistsAlias) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.exists_alias") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -187,6 +241,14 @@ func (r ExistsAlias) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ExistsAlias query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/existsindextemplate/exists_index_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/existsindextemplate/exists_index_template.go index c4cb3b46d..b68ebe92a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/existsindextemplate/exists_index_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/existsindextemplate/exists_index_template.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns information about whether a particular index template exists. package existsindextemplate import ( - gobytes "bytes" "context" "errors" "fmt" @@ -49,11 +48,15 @@ type ExistsIndexTemplate struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewExistsIndexTemplate type alias for index. @@ -73,13 +76,18 @@ func NewExistsIndexTemplateFunc(tp elastictransport.Interface) NewExistsIndexTem // Returns information about whether a particular index template exists. // -// https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html +// https://www.elastic.co/guide/en/elasticsearch/reference/current/index-templates.html func New(tp elastictransport.Interface) *ExistsIndexTemplate { r := &ExistsIndexTemplate{ transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -102,6 +110,9 @@ func (r *ExistsIndexTemplate) HttpRequest(ctx context.Context) (*http.Request, e path.WriteString("_index_template") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodHead @@ -115,9 +126,9 @@ func (r *ExistsIndexTemplate) HttpRequest(ctx context.Context) (*http.Request, e } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -134,15 +145,42 @@ func (r *ExistsIndexTemplate) HttpRequest(ctx context.Context) (*http.Request, e } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ExistsIndexTemplate) Perform(ctx context.Context) (*http.Response, error) { +func (r ExistsIndexTemplate) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.exists_index_template") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.exists_index_template") + if reader := instrument.RecordRequestBody(ctx, "indices.exists_index_template", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.exists_index_template") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ExistsIndexTemplate query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ExistsIndexTemplate query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil @@ -155,7 +193,17 @@ func (r ExistsIndexTemplate) Do(ctx context.Context) (bool, error) { // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ExistsIndexTemplate) IsSuccess(ctx context.Context) (bool, error) { +func (r ExistsIndexTemplate) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.exists_index_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -171,6 +219,14 @@ func (r ExistsIndexTemplate) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ExistsIndexTemplate query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/existstemplate/exists_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/existstemplate/exists_template.go index 8ca5d9192..5a7698673 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/existstemplate/exists_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/existstemplate/exists_template.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns information about whether a particular index template exists. package existstemplate import ( - gobytes "bytes" "context" "errors" "fmt" @@ -50,11 +49,15 @@ type ExistsTemplate struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewExistsTemplate type alias for index. @@ -74,13 +77,18 @@ func NewExistsTemplateFunc(tp elastictransport.Interface) NewExistsTemplate { // Returns information about whether a particular index template exists. // -// https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html +// https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-template-exists-v1.html func New(tp elastictransport.Interface) *ExistsTemplate { r := &ExistsTemplate{ transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -103,6 +111,9 @@ func (r *ExistsTemplate) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("_template") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodHead @@ -116,9 +127,9 @@ func (r *ExistsTemplate) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -135,15 +146,42 @@ func (r *ExistsTemplate) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ExistsTemplate) Perform(ctx context.Context) (*http.Response, error) { +func (r ExistsTemplate) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.exists_template") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.exists_template") + if reader := instrument.RecordRequestBody(ctx, "indices.exists_template", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.exists_template") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ExistsTemplate query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ExistsTemplate query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil @@ -156,7 +194,17 @@ func (r ExistsTemplate) Do(ctx context.Context) (bool, error) { // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ExistsTemplate) IsSuccess(ctx context.Context) (bool, error) { +func (r ExistsTemplate) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.exists_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -172,6 +220,14 @@ func (r ExistsTemplate) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ExistsTemplate query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/explaindatalifecycle/explain_data_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/explaindatalifecycle/explain_data_lifecycle.go index b4b738aaa..1cc7f1aa7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/explaindatalifecycle/explain_data_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/explaindatalifecycle/explain_data_lifecycle.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves information about the index's current data stream lifecycle, such // as any potential encountered error, time since creation etc. package explaindatalifecycle import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,11 +52,15 @@ type ExplainDataLifecycle struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewExplainDataLifecycle type alias for index. @@ -84,7 +87,12 @@ func New(tp elastictransport.Interface) *ExplainDataLifecycle { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -105,6 +113,9 @@ func (r *ExplainDataLifecycle) HttpRequest(ctx context.Context) (*http.Request, case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_lifecycle") @@ -122,9 +133,9 @@ func (r *ExplainDataLifecycle) HttpRequest(ctx context.Context) (*http.Request, } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -141,27 +152,66 @@ func (r *ExplainDataLifecycle) HttpRequest(ctx context.Context) (*http.Request, } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ExplainDataLifecycle) Perform(ctx context.Context) (*http.Response, error) { +func (r ExplainDataLifecycle) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.explain_data_lifecycle") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.explain_data_lifecycle") + if reader := instrument.RecordRequestBody(ctx, "indices.explain_data_lifecycle", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.explain_data_lifecycle") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ExplainDataLifecycle query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ExplainDataLifecycle query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a explaindatalifecycle.Response -func (r ExplainDataLifecycle) Do(ctx context.Context) (*Response, error) { +func (r ExplainDataLifecycle) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.explain_data_lifecycle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -169,6 +219,9 @@ func (r ExplainDataLifecycle) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -178,6 +231,9 @@ func (r ExplainDataLifecycle) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -185,12 +241,25 @@ func (r ExplainDataLifecycle) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ExplainDataLifecycle) IsSuccess(ctx context.Context) (bool, error) { +func (r ExplainDataLifecycle) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.explain_data_lifecycle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -206,6 +275,14 @@ func (r ExplainDataLifecycle) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ExplainDataLifecycle query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/explaindatalifecycle/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/explaindatalifecycle/response.go index 4fca83d5f..f9395b546 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/explaindatalifecycle/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/explaindatalifecycle/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package explaindatalifecycle @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package explaindatalifecycle // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/explain_data_lifecycle/IndicesExplainDataLifecycleResponse.ts#L25-L29 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/explain_data_lifecycle/IndicesExplainDataLifecycleResponse.ts#L25-L29 type Response struct { Indices map[string]types.DataStreamLifecycleExplain `json:"indices"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/fieldusagestats/field_usage_stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/fieldusagestats/field_usage_stats.go index 841f4c6bb..304e4773f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/fieldusagestats/field_usage_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/fieldusagestats/field_usage_stats.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns the field usage stats for each field of an index package fieldusagestats import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,11 +52,15 @@ type FieldUsageStats struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewFieldUsageStats type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *FieldUsageStats { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *FieldUsageStats) HttpRequest(ctx context.Context) (*http.Request, error case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_field_usage_stats") @@ -119,9 +130,9 @@ func (r *FieldUsageStats) HttpRequest(ctx context.Context) (*http.Request, error } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -138,27 +149,66 @@ func (r *FieldUsageStats) HttpRequest(ctx context.Context) (*http.Request, error } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r FieldUsageStats) Perform(ctx context.Context) (*http.Response, error) { +func (r FieldUsageStats) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.field_usage_stats") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.field_usage_stats") + if reader := instrument.RecordRequestBody(ctx, "indices.field_usage_stats", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.field_usage_stats") + } if err != nil { - return nil, fmt.Errorf("an error happened during the FieldUsageStats query execution: %w", err) + localErr := fmt.Errorf("an error happened during the FieldUsageStats query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a fieldusagestats.Response -func (r FieldUsageStats) Do(ctx context.Context) (*Response, error) { +func (r FieldUsageStats) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.field_usage_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -166,6 +216,9 @@ func (r FieldUsageStats) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,6 +228,9 @@ func (r FieldUsageStats) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,12 +238,25 @@ func (r FieldUsageStats) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r FieldUsageStats) IsSuccess(ctx context.Context) (bool, error) { +func (r FieldUsageStats) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.field_usage_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -203,6 +272,14 @@ func (r FieldUsageStats) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the FieldUsageStats query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/fieldusagestats/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/fieldusagestats/response.go index 52883d09c..6e06d4302 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/fieldusagestats/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/fieldusagestats/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package fieldusagestats @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package fieldusagestats // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/field_usage_stats/IndicesFieldUsageStatsResponse.ts#L28-L30 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/field_usage_stats/IndicesFieldUsageStatsResponse.ts#L28-L30 type Response struct { FieldsUsageBody map[string]types.UsageStatsIndex `json:"-"` Shards_ types.ShardStatistics `json:"_shards"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/flush/flush.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/flush/flush.go index 45804ef41..d9a8159d8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/flush/flush.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/flush/flush.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Performs the flush operation on one or more indices. package flush import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,11 +52,15 @@ type Flush struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewFlush type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *Flush { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -107,6 +115,9 @@ func (r *Flush) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_flush") @@ -122,9 +133,9 @@ func (r *Flush) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -141,27 +152,66 @@ func (r *Flush) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Flush) Perform(ctx context.Context) (*http.Response, error) { +func (r Flush) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.flush") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.flush") + if reader := instrument.RecordRequestBody(ctx, "indices.flush", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.flush") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Flush query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Flush query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a flush.Response -func (r Flush) Do(ctx context.Context) (*Response, error) { +func (r Flush) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.flush") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -169,6 +219,9 @@ func (r Flush) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -178,6 +231,9 @@ func (r Flush) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -185,12 +241,25 @@ func (r Flush) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Flush) IsSuccess(ctx context.Context) (bool, error) { +func (r Flush) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.flush") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -206,6 +275,14 @@ func (r Flush) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Flush query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/flush/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/flush/response.go index a97e2ce58..4eb2ed1cd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/flush/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/flush/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package flush @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package flush // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/flush/IndicesFlushResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/flush/IndicesFlushResponse.ts#L22-L24 type Response struct { Shards_ types.ShardStatistics `json:"_shards"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/forcemerge/forcemerge.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/forcemerge/forcemerge.go index fec12b356..ccd1c063c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/forcemerge/forcemerge.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/forcemerge/forcemerge.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Performs the force merge operation on one or more indices. package forcemerge import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,11 +52,15 @@ type Forcemerge struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewForcemerge type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *Forcemerge { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -107,6 +115,9 @@ func (r *Forcemerge) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_forcemerge") @@ -122,9 +133,9 @@ func (r *Forcemerge) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -141,27 +152,66 @@ func (r *Forcemerge) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Forcemerge) Perform(ctx context.Context) (*http.Response, error) { +func (r Forcemerge) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.forcemerge") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.forcemerge") + if reader := instrument.RecordRequestBody(ctx, "indices.forcemerge", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.forcemerge") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Forcemerge query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Forcemerge query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a forcemerge.Response -func (r Forcemerge) Do(ctx context.Context) (*Response, error) { +func (r Forcemerge) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.forcemerge") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -169,6 +219,9 @@ func (r Forcemerge) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -178,6 +231,9 @@ func (r Forcemerge) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -185,12 +241,25 @@ func (r Forcemerge) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Forcemerge) IsSuccess(ctx context.Context) (bool, error) { +func (r Forcemerge) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.forcemerge") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -206,6 +275,14 @@ func (r Forcemerge) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Forcemerge query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/forcemerge/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/forcemerge/response.go index a32b11206..acc6b8a12 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/forcemerge/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/forcemerge/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package forcemerge @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package forcemerge // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/forcemerge/IndicesForceMergeResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/forcemerge/IndicesForceMergeResponse.ts#L22-L24 type Response struct { Shards_ types.ShardStatistics `json:"_shards"` // Task task contains a task id returned when wait_for_completion=false, diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/get/get.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/get/get.go index e6d7c4a4a..61e626d73 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/get/get.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/get/get.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns information about one or more indices. package get import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -54,11 +53,15 @@ type Get struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGet type alias for index. @@ -84,7 +87,12 @@ func New(tp elastictransport.Interface) *Get { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -105,6 +113,9 @@ func (r *Get) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) method = http.MethodGet @@ -118,9 +129,9 @@ func (r *Get) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -137,27 +148,66 @@ func (r *Get) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Get) Perform(ctx context.Context) (*http.Response, error) { +func (r Get) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.get") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.get") + if reader := instrument.RecordRequestBody(ctx, "indices.get", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.get") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Get query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Get query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a get.Response -func (r Get) Do(ctx context.Context) (Response, error) { +func (r Get) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.get") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -165,6 +215,9 @@ func (r Get) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -174,6 +227,9 @@ func (r Get) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -181,12 +237,25 @@ func (r Get) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Get) IsSuccess(ctx context.Context) (bool, error) { +func (r Get) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.get") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -202,6 +271,14 @@ func (r Get) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Get query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/get/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/get/response.go index 18f4e1633..e9258b0fa 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/get/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/get/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package get @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package get // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/get/IndicesGetResponse.ts#L24-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/get/IndicesGetResponse.ts#L24-L26 type Response map[string]types.IndexState diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getalias/get_alias.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getalias/get_alias.go index d6eb65263..906a4c9d3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getalias/get_alias.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getalias/get_alias.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns an alias. package getalias @@ -55,12 +55,16 @@ type GetAlias struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetAlias type alias for index. @@ -84,7 +88,12 @@ func New(tp elastictransport.Interface) *GetAlias { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -112,23 +121,35 @@ func (r *GetAlias) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_alias") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodGet case r.paramSet == indexMask|nameMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_alias") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodGet case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_alias") @@ -144,9 +165,9 @@ func (r *GetAlias) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -163,27 +184,66 @@ func (r *GetAlias) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetAlias) Perform(ctx context.Context) (*http.Response, error) { +func (r GetAlias) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.get_alias") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.get_alias") + if reader := instrument.RecordRequestBody(ctx, "indices.get_alias", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.get_alias") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetAlias query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetAlias query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getalias.Response -func (r GetAlias) Do(ctx context.Context) (Response, error) { +func (r GetAlias) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.get_alias") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -191,6 +251,9 @@ func (r GetAlias) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -200,30 +263,45 @@ func (r GetAlias) Do(ctx context.Context) (Response, error) { if res.StatusCode == 404 { data, err := ioutil.ReadAll(res.Body) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } errorResponse := types.NewElasticsearchError() err = json.NewDecoder(gobytes.NewReader(data)).Decode(&errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } if errorResponse.Status == 0 { err = json.NewDecoder(gobytes.NewReader(data)).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } return response, nil } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -231,12 +309,25 @@ func (r GetAlias) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetAlias) IsSuccess(ctx context.Context) (bool, error) { +func (r GetAlias) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.get_alias") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -252,6 +343,14 @@ func (r GetAlias) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetAlias query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getalias/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getalias/response.go index 63ce57ffe..eb20e3b36 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getalias/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getalias/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getalias @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getalias // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/get_alias/IndicesGetAliasResponse.ts#L26-L34 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/get_alias/IndicesGetAliasResponse.ts#L26-L34 type Response map[string]types.IndexAliases diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getdatalifecycle/get_data_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getdatalifecycle/get_data_lifecycle.go index 6730a5dbd..4cef80b9b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getdatalifecycle/get_data_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getdatalifecycle/get_data_lifecycle.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns the data stream lifecycle of the selected data streams. package getdatalifecycle import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,11 +52,15 @@ type GetDataLifecycle struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetDataLifecycle type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *GetDataLifecycle { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *GetDataLifecycle) HttpRequest(ctx context.Context) (*http.Request, erro path.WriteString("_data_stream") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) path.WriteString("/") path.WriteString("_lifecycle") @@ -121,9 +132,9 @@ func (r *GetDataLifecycle) HttpRequest(ctx context.Context) (*http.Request, erro } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -140,27 +151,66 @@ func (r *GetDataLifecycle) HttpRequest(ctx context.Context) (*http.Request, erro } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetDataLifecycle) Perform(ctx context.Context) (*http.Response, error) { +func (r GetDataLifecycle) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.get_data_lifecycle") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.get_data_lifecycle") + if reader := instrument.RecordRequestBody(ctx, "indices.get_data_lifecycle", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.get_data_lifecycle") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetDataLifecycle query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetDataLifecycle query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getdatalifecycle.Response -func (r GetDataLifecycle) Do(ctx context.Context) (*Response, error) { +func (r GetDataLifecycle) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.get_data_lifecycle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -168,6 +218,9 @@ func (r GetDataLifecycle) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -177,6 +230,9 @@ func (r GetDataLifecycle) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,12 +240,25 @@ func (r GetDataLifecycle) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetDataLifecycle) IsSuccess(ctx context.Context) (bool, error) { +func (r GetDataLifecycle) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.get_data_lifecycle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -205,6 +274,14 @@ func (r GetDataLifecycle) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetDataLifecycle query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getdatalifecycle/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getdatalifecycle/response.go index 2cf928c44..30d7c4263 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getdatalifecycle/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getdatalifecycle/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getdatalifecycle @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getdatalifecycle // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/get_data_lifecycle/IndicesGetDataLifecycleResponse.ts#L23-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/get_data_lifecycle/IndicesGetDataLifecycleResponse.ts#L23-L25 type Response struct { DataStreams []types.DataStreamWithLifecycle `json:"data_streams"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getdatastream/get_data_stream.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getdatastream/get_data_stream.go index 32d6ce01b..effe9e22f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getdatastream/get_data_stream.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getdatastream/get_data_stream.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns data streams. package getdatastream import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,11 +52,15 @@ type GetDataStream struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetDataStream type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *GetDataStream { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -109,6 +117,9 @@ func (r *GetDataStream) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("_data_stream") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodGet @@ -122,9 +133,9 @@ func (r *GetDataStream) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -141,27 +152,66 @@ func (r *GetDataStream) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetDataStream) Perform(ctx context.Context) (*http.Response, error) { +func (r GetDataStream) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.get_data_stream") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.get_data_stream") + if reader := instrument.RecordRequestBody(ctx, "indices.get_data_stream", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.get_data_stream") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetDataStream query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetDataStream query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getdatastream.Response -func (r GetDataStream) Do(ctx context.Context) (*Response, error) { +func (r GetDataStream) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.get_data_stream") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -169,6 +219,9 @@ func (r GetDataStream) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -178,6 +231,9 @@ func (r GetDataStream) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -185,12 +241,25 @@ func (r GetDataStream) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetDataStream) IsSuccess(ctx context.Context) (bool, error) { +func (r GetDataStream) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.get_data_stream") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -206,6 +275,14 @@ func (r GetDataStream) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetDataStream query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getdatastream/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getdatastream/response.go index d9a3e8214..99cb203ec 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getdatastream/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getdatastream/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getdatastream @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getdatastream // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/get_data_stream/IndicesGetDataStreamResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/get_data_stream/IndicesGetDataStreamResponse.ts#L22-L24 type Response struct { DataStreams []types.DataStream `json:"data_streams"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getfieldmapping/get_field_mapping.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getfieldmapping/get_field_mapping.go index b1f963d64..59219552a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getfieldmapping/get_field_mapping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getfieldmapping/get_field_mapping.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns mapping for one or more fields. package getfieldmapping import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -55,12 +54,16 @@ type GetFieldMapping struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int fields string index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetFieldMapping type alias for index. @@ -86,7 +89,12 @@ func New(tp elastictransport.Interface) *GetFieldMapping { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -111,12 +119,18 @@ func (r *GetFieldMapping) HttpRequest(ctx context.Context) (*http.Request, error path.WriteString("field") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "fields", r.fields) + } path.WriteString(r.fields) method = http.MethodGet case r.paramSet == indexMask|fieldsMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_mapping") @@ -124,6 +138,9 @@ func (r *GetFieldMapping) HttpRequest(ctx context.Context) (*http.Request, error path.WriteString("field") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "fields", r.fields) + } path.WriteString(r.fields) method = http.MethodGet @@ -137,9 +154,9 @@ func (r *GetFieldMapping) HttpRequest(ctx context.Context) (*http.Request, error } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -156,27 +173,66 @@ func (r *GetFieldMapping) HttpRequest(ctx context.Context) (*http.Request, error } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetFieldMapping) Perform(ctx context.Context) (*http.Response, error) { +func (r GetFieldMapping) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.get_field_mapping") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.get_field_mapping") + if reader := instrument.RecordRequestBody(ctx, "indices.get_field_mapping", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.get_field_mapping") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetFieldMapping query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetFieldMapping query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getfieldmapping.Response -func (r GetFieldMapping) Do(ctx context.Context) (Response, error) { +func (r GetFieldMapping) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.get_field_mapping") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -184,6 +240,9 @@ func (r GetFieldMapping) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -193,6 +252,9 @@ func (r GetFieldMapping) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -200,12 +262,25 @@ func (r GetFieldMapping) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetFieldMapping) IsSuccess(ctx context.Context) (bool, error) { +func (r GetFieldMapping) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.get_field_mapping") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -221,6 +296,14 @@ func (r GetFieldMapping) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetFieldMapping query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getfieldmapping/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getfieldmapping/response.go index c63d3cea3..0380ba2b5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getfieldmapping/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getfieldmapping/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getfieldmapping @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getfieldmapping // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/get_field_mapping/IndicesGetFieldMappingResponse.ts#L24-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/get_field_mapping/IndicesGetFieldMappingResponse.ts#L24-L26 type Response map[string]types.TypeFieldMappings diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getindextemplate/get_index_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getindextemplate/get_index_template.go index 8b9970cd0..e2aea3d64 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getindextemplate/get_index_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getindextemplate/get_index_template.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns an index template. package getindextemplate import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type GetIndexTemplate struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetIndexTemplate type alias for index. @@ -74,13 +77,18 @@ func NewGetIndexTemplateFunc(tp elastictransport.Interface) NewGetIndexTemplate // Returns an index template. // -// https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html +// https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-template.html func New(tp elastictransport.Interface) *GetIndexTemplate { r := &GetIndexTemplate{ transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,6 +116,9 @@ func (r *GetIndexTemplate) HttpRequest(ctx context.Context) (*http.Request, erro path.WriteString("_index_template") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodGet @@ -121,9 +132,9 @@ func (r *GetIndexTemplate) HttpRequest(ctx context.Context) (*http.Request, erro } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -140,27 +151,66 @@ func (r *GetIndexTemplate) HttpRequest(ctx context.Context) (*http.Request, erro } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetIndexTemplate) Perform(ctx context.Context) (*http.Response, error) { +func (r GetIndexTemplate) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.get_index_template") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.get_index_template") + if reader := instrument.RecordRequestBody(ctx, "indices.get_index_template", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.get_index_template") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetIndexTemplate query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetIndexTemplate query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getindextemplate.Response -func (r GetIndexTemplate) Do(ctx context.Context) (*Response, error) { +func (r GetIndexTemplate) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.get_index_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -168,6 +218,9 @@ func (r GetIndexTemplate) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -177,6 +230,9 @@ func (r GetIndexTemplate) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,12 +240,25 @@ func (r GetIndexTemplate) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetIndexTemplate) IsSuccess(ctx context.Context) (bool, error) { +func (r GetIndexTemplate) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.get_index_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -205,6 +274,14 @@ func (r GetIndexTemplate) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetIndexTemplate query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getindextemplate/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getindextemplate/response.go index d32c33c7a..072e52935 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getindextemplate/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getindextemplate/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getindextemplate @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getindextemplate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/get_index_template/IndicesGetIndexTemplateResponse.ts#L23-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/get_index_template/IndicesGetIndexTemplateResponse.ts#L23-L27 type Response struct { IndexTemplates []types.IndexTemplateItem `json:"index_templates"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getmapping/get_mapping.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getmapping/get_mapping.go index 00083011f..3da74736c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getmapping/get_mapping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getmapping/get_mapping.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns mappings for one or more indices. package getmapping import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,11 +52,15 @@ type GetMapping struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetMapping type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *GetMapping { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -107,6 +115,9 @@ func (r *GetMapping) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_mapping") @@ -122,9 +133,9 @@ func (r *GetMapping) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -141,27 +152,66 @@ func (r *GetMapping) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetMapping) Perform(ctx context.Context) (*http.Response, error) { +func (r GetMapping) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.get_mapping") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.get_mapping") + if reader := instrument.RecordRequestBody(ctx, "indices.get_mapping", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.get_mapping") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetMapping query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetMapping query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getmapping.Response -func (r GetMapping) Do(ctx context.Context) (Response, error) { +func (r GetMapping) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.get_mapping") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -169,6 +219,9 @@ func (r GetMapping) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -178,6 +231,9 @@ func (r GetMapping) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -185,12 +241,25 @@ func (r GetMapping) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetMapping) IsSuccess(ctx context.Context) (bool, error) { +func (r GetMapping) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.get_mapping") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -206,6 +275,14 @@ func (r GetMapping) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetMapping query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getmapping/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getmapping/response.go index 3d62778de..472869bbc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getmapping/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getmapping/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getmapping @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getmapping // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/get_mapping/IndicesGetMappingResponse.ts#L24-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/get_mapping/IndicesGetMappingResponse.ts#L24-L26 type Response map[string]types.IndexMappingRecord diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getsettings/get_settings.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getsettings/get_settings.go index bc59f412c..03744a13a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getsettings/get_settings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getsettings/get_settings.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns settings for one or more indices. package getsettings import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -55,12 +54,16 @@ type GetSettings struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetSettings type alias for index. @@ -84,7 +87,12 @@ func New(tp elastictransport.Interface) *GetSettings { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -110,6 +118,9 @@ func (r *GetSettings) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_settings") @@ -118,11 +129,17 @@ func (r *GetSettings) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask|nameMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_settings") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodGet @@ -131,6 +148,9 @@ func (r *GetSettings) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_settings") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodGet @@ -144,9 +164,9 @@ func (r *GetSettings) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -163,27 +183,66 @@ func (r *GetSettings) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetSettings) Perform(ctx context.Context) (*http.Response, error) { +func (r GetSettings) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.get_settings") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.get_settings") + if reader := instrument.RecordRequestBody(ctx, "indices.get_settings", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.get_settings") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetSettings query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetSettings query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getsettings.Response -func (r GetSettings) Do(ctx context.Context) (Response, error) { +func (r GetSettings) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.get_settings") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -191,6 +250,9 @@ func (r GetSettings) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -200,6 +262,9 @@ func (r GetSettings) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -207,12 +272,25 @@ func (r GetSettings) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetSettings) IsSuccess(ctx context.Context) (bool, error) { +func (r GetSettings) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.get_settings") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -228,6 +306,14 @@ func (r GetSettings) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetSettings query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getsettings/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getsettings/response.go index 2de2b2415..df357024c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getsettings/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/getsettings/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getsettings @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getsettings // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/get_settings/IndicesGetSettingsResponse.ts#L24-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/get_settings/IndicesGetSettingsResponse.ts#L24-L26 type Response map[string]types.IndexState diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/gettemplate/get_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/gettemplate/get_template.go index ee06e0f16..d55edd3c8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/gettemplate/get_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/gettemplate/get_template.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns an index template. package gettemplate import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type GetTemplate struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetTemplate type alias for index. @@ -74,13 +77,18 @@ func NewGetTemplateFunc(tp elastictransport.Interface) NewGetTemplate { // Returns an index template. // -// https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html +// https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-template-v1.html func New(tp elastictransport.Interface) *GetTemplate { r := &GetTemplate{ transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,6 +116,9 @@ func (r *GetTemplate) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_template") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodGet @@ -121,9 +132,9 @@ func (r *GetTemplate) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -140,27 +151,66 @@ func (r *GetTemplate) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetTemplate) Perform(ctx context.Context) (*http.Response, error) { +func (r GetTemplate) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.get_template") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.get_template") + if reader := instrument.RecordRequestBody(ctx, "indices.get_template", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.get_template") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetTemplate query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetTemplate query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a gettemplate.Response -func (r GetTemplate) Do(ctx context.Context) (Response, error) { +func (r GetTemplate) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.get_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -168,6 +218,9 @@ func (r GetTemplate) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -177,6 +230,9 @@ func (r GetTemplate) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,12 +240,25 @@ func (r GetTemplate) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetTemplate) IsSuccess(ctx context.Context) (bool, error) { +func (r GetTemplate) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.get_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -205,6 +274,14 @@ func (r GetTemplate) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetTemplate query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/gettemplate/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/gettemplate/response.go index ce7d89a57..ae7b97dcc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/gettemplate/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/gettemplate/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package gettemplate @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package gettemplate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/get_template/IndicesGetTemplateResponse.ts#L23-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/get_template/IndicesGetTemplateResponse.ts#L23-L25 type Response map[string]types.TemplateMapping diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/migratetodatastream/migrate_to_data_stream.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/migratetodatastream/migrate_to_data_stream.go index 53d5fd87d..5cef14d60 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/migratetodatastream/migrate_to_data_stream.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/migratetodatastream/migrate_to_data_stream.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Migrates an alias to a data stream package migratetodatastream import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type MigrateToDataStream struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewMigrateToDataStream type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *MigrateToDataStream { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *MigrateToDataStream) HttpRequest(ctx context.Context) (*http.Request, e path.WriteString("_migrate") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodPost @@ -119,9 +130,9 @@ func (r *MigrateToDataStream) HttpRequest(ctx context.Context) (*http.Request, e } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -138,27 +149,66 @@ func (r *MigrateToDataStream) HttpRequest(ctx context.Context) (*http.Request, e } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r MigrateToDataStream) Perform(ctx context.Context) (*http.Response, error) { +func (r MigrateToDataStream) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.migrate_to_data_stream") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.migrate_to_data_stream") + if reader := instrument.RecordRequestBody(ctx, "indices.migrate_to_data_stream", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.migrate_to_data_stream") + } if err != nil { - return nil, fmt.Errorf("an error happened during the MigrateToDataStream query execution: %w", err) + localErr := fmt.Errorf("an error happened during the MigrateToDataStream query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a migratetodatastream.Response -func (r MigrateToDataStream) Do(ctx context.Context) (*Response, error) { +func (r MigrateToDataStream) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.migrate_to_data_stream") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -166,6 +216,9 @@ func (r MigrateToDataStream) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,6 +228,9 @@ func (r MigrateToDataStream) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,12 +238,25 @@ func (r MigrateToDataStream) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r MigrateToDataStream) IsSuccess(ctx context.Context) (bool, error) { +func (r MigrateToDataStream) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.migrate_to_data_stream") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -203,6 +272,14 @@ func (r MigrateToDataStream) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the MigrateToDataStream query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/migratetodatastream/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/migratetodatastream/response.go index a97ae77bb..8e055549b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/migratetodatastream/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/migratetodatastream/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package migratetodatastream // Response holds the response body struct for the package migratetodatastream // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/migrate_to_data_stream/IndicesMigrateToDataStreamResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/migrate_to_data_stream/IndicesMigrateToDataStreamResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/modifydatastream/modify_data_stream.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/modifydatastream/modify_data_stream.go index a16119daa..8f1c0c67d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/modifydatastream/modify_data_stream.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/modifydatastream/modify_data_stream.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Modifies a data stream package modifydatastream @@ -46,13 +46,17 @@ type ModifyDataStream struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewModifyDataStream type alias for index. @@ -76,11 +80,18 @@ func New(tp elastictransport.Interface) *ModifyDataStream { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -117,9 +128,7 @@ func (r *ModifyDataStream) HttpRequest(ctx context.Context) (*http.Request, erro } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -131,6 +140,10 @@ func (r *ModifyDataStream) HttpRequest(ctx context.Context) (*http.Request, erro } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -151,15 +164,15 @@ func (r *ModifyDataStream) HttpRequest(ctx context.Context) (*http.Request, erro } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -176,27 +189,66 @@ func (r *ModifyDataStream) HttpRequest(ctx context.Context) (*http.Request, erro } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ModifyDataStream) Perform(ctx context.Context) (*http.Response, error) { +func (r ModifyDataStream) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.modify_data_stream") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.modify_data_stream") + if reader := instrument.RecordRequestBody(ctx, "indices.modify_data_stream", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.modify_data_stream") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ModifyDataStream query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ModifyDataStream query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a modifydatastream.Response -func (r ModifyDataStream) Do(ctx context.Context) (*Response, error) { +func (r ModifyDataStream) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.modify_data_stream") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -204,6 +256,9 @@ func (r ModifyDataStream) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -213,6 +268,9 @@ func (r ModifyDataStream) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -220,6 +278,9 @@ func (r ModifyDataStream) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/modifydatastream/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/modifydatastream/request.go index 3d4e2f0f0..85e0cdc9a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/modifydatastream/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/modifydatastream/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package modifydatastream @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package modifydatastream // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/modify_data_stream/IndicesModifyDataStreamRequest.ts#L23-L36 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/modify_data_stream/IndicesModifyDataStreamRequest.ts#L23-L36 type Request struct { // Actions Actions to perform. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/modifydatastream/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/modifydatastream/response.go index 1f74822b1..59ef812ad 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/modifydatastream/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/modifydatastream/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package modifydatastream // Response holds the response body struct for the package modifydatastream // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/modify_data_stream/IndicesModifyDataStreamResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/modify_data_stream/IndicesModifyDataStreamResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/open/open.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/open/open.go index aacfc40bf..f87cfb15f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/open/open.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/open/open.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Opens an index. package open import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,11 +52,15 @@ type Open struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewOpen type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *Open { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *Open) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_open") @@ -119,9 +130,9 @@ func (r *Open) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -138,27 +149,66 @@ func (r *Open) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Open) Perform(ctx context.Context) (*http.Response, error) { +func (r Open) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.open") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.open") + if reader := instrument.RecordRequestBody(ctx, "indices.open", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.open") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Open query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Open query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a open.Response -func (r Open) Do(ctx context.Context) (*Response, error) { +func (r Open) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.open") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -166,6 +216,9 @@ func (r Open) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,6 +228,9 @@ func (r Open) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,12 +238,25 @@ func (r Open) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Open) IsSuccess(ctx context.Context) (bool, error) { +func (r Open) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.open") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -203,6 +272,14 @@ func (r Open) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Open query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/open/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/open/response.go index 574630420..7cd185822 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/open/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/open/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package open // Response holds the response body struct for the package open // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/open/IndicesOpenResponse.ts#L20-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/open/IndicesOpenResponse.ts#L20-L25 type Response struct { Acknowledged bool `json:"acknowledged"` ShardsAcknowledged bool `json:"shards_acknowledged"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/promotedatastream/promote_data_stream.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/promotedatastream/promote_data_stream.go index fef560315..72ef39134 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/promotedatastream/promote_data_stream.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/promotedatastream/promote_data_stream.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Promotes a data stream from a replicated data stream managed by CCR to a // regular data stream package promotedatastream import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type PromoteDataStream struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPromoteDataStream type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *PromoteDataStream { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,6 +116,9 @@ func (r *PromoteDataStream) HttpRequest(ctx context.Context) (*http.Request, err path.WriteString("_promote") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodPost @@ -121,9 +132,9 @@ func (r *PromoteDataStream) HttpRequest(ctx context.Context) (*http.Request, err } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -140,27 +151,66 @@ func (r *PromoteDataStream) HttpRequest(ctx context.Context) (*http.Request, err } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PromoteDataStream) Perform(ctx context.Context) (*http.Response, error) { +func (r PromoteDataStream) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.promote_data_stream") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.promote_data_stream") + if reader := instrument.RecordRequestBody(ctx, "indices.promote_data_stream", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.promote_data_stream") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PromoteDataStream query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PromoteDataStream query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a promotedatastream.Response -func (r PromoteDataStream) Do(ctx context.Context) (Response, error) { +func (r PromoteDataStream) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.promote_data_stream") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := new(Response) res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -168,6 +218,9 @@ func (r PromoteDataStream) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -177,6 +230,9 @@ func (r PromoteDataStream) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,12 +240,25 @@ func (r PromoteDataStream) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r PromoteDataStream) IsSuccess(ctx context.Context) (bool, error) { +func (r PromoteDataStream) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.promote_data_stream") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -205,6 +274,14 @@ func (r PromoteDataStream) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the PromoteDataStream query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/promotedatastream/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/promotedatastream/response.go index 9d588d960..456753e50 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/promotedatastream/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/promotedatastream/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package promotedatastream @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package promotedatastream // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/promote_data_stream/IndicesPromoteDataStreamResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/promote_data_stream/IndicesPromoteDataStreamResponse.ts#L22-L24 type Response = json.RawMessage diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putalias/put_alias.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putalias/put_alias.go index ccb359cb2..2cda1ea8b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putalias/put_alias.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putalias/put_alias.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates or updates an alias. package putalias @@ -52,16 +52,20 @@ type PutAlias struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutAlias type alias for index. @@ -89,11 +93,18 @@ func New(tp elastictransport.Interface) *PutAlias { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -130,9 +141,7 @@ func (r *PutAlias) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -144,28 +153,44 @@ func (r *PutAlias) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { case r.paramSet == indexMask|nameMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_alias") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodPut case r.paramSet == indexMask|nameMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_aliases") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodPut @@ -179,15 +204,15 @@ func (r *PutAlias) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -204,27 +229,66 @@ func (r *PutAlias) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutAlias) Perform(ctx context.Context) (*http.Response, error) { +func (r PutAlias) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.put_alias") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.put_alias") + if reader := instrument.RecordRequestBody(ctx, "indices.put_alias", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.put_alias") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutAlias query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutAlias query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a putalias.Response -func (r PutAlias) Do(ctx context.Context) (*Response, error) { +func (r PutAlias) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.put_alias") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -232,6 +296,9 @@ func (r PutAlias) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -241,6 +308,9 @@ func (r PutAlias) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -248,6 +318,9 @@ func (r PutAlias) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putalias/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putalias/request.go index b38fe132f..d19e7c8a9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putalias/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putalias/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putalias @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package putalias // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/put_alias/IndicesPutAliasRequest.ts#L25-L91 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/put_alias/IndicesPutAliasRequest.ts#L25-L91 type Request struct { // Filter Query used to limit documents the alias can access. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putalias/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putalias/response.go index f06fe8a4e..28ffe4724 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putalias/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putalias/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putalias // Response holds the response body struct for the package putalias // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/put_alias/IndicesPutAliasResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/put_alias/IndicesPutAliasResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putdatalifecycle/put_data_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putdatalifecycle/put_data_lifecycle.go index 70d7a76a8..39587d97c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putdatalifecycle/put_data_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putdatalifecycle/put_data_lifecycle.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Updates the data stream lifecycle of the selected data streams. package putdatalifecycle @@ -51,15 +51,19 @@ type PutDataLifecycle struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutDataLifecycle type alias for index. @@ -85,11 +89,18 @@ func New(tp elastictransport.Interface) *PutDataLifecycle { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -126,9 +137,7 @@ func (r *PutDataLifecycle) HttpRequest(ctx context.Context) (*http.Request, erro } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -140,6 +149,10 @@ func (r *PutDataLifecycle) HttpRequest(ctx context.Context) (*http.Request, erro } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -148,6 +161,9 @@ func (r *PutDataLifecycle) HttpRequest(ctx context.Context) (*http.Request, erro path.WriteString("_data_stream") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) path.WriteString("/") path.WriteString("_lifecycle") @@ -163,9 +179,9 @@ func (r *PutDataLifecycle) HttpRequest(ctx context.Context) (*http.Request, erro } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -182,27 +198,66 @@ func (r *PutDataLifecycle) HttpRequest(ctx context.Context) (*http.Request, erro } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutDataLifecycle) Perform(ctx context.Context) (*http.Response, error) { +func (r PutDataLifecycle) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.put_data_lifecycle") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.put_data_lifecycle") + if reader := instrument.RecordRequestBody(ctx, "indices.put_data_lifecycle", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.put_data_lifecycle") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutDataLifecycle query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutDataLifecycle query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a putdatalifecycle.Response -func (r PutDataLifecycle) Do(ctx context.Context) (*Response, error) { +func (r PutDataLifecycle) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.put_data_lifecycle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -210,6 +265,9 @@ func (r PutDataLifecycle) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -219,6 +277,9 @@ func (r PutDataLifecycle) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -226,6 +287,9 @@ func (r PutDataLifecycle) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putdatalifecycle/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putdatalifecycle/request.go index 84abf268a..d1bc7a77f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putdatalifecycle/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putdatalifecycle/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putdatalifecycle @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package putdatalifecycle // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/put_data_lifecycle/IndicesPutDataLifecycleRequest.ts#L25-L75 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/put_data_lifecycle/IndicesPutDataLifecycleRequest.ts#L25-L75 type Request struct { // DataRetention If defined, every document added to this data stream will be stored at least diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putdatalifecycle/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putdatalifecycle/response.go index 813a93cea..ccb0ac7cb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putdatalifecycle/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putdatalifecycle/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putdatalifecycle // Response holds the response body struct for the package putdatalifecycle // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/put_data_lifecycle/IndicesPutDataLifecycleResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/put_data_lifecycle/IndicesPutDataLifecycleResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putindextemplate/put_index_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putindextemplate/put_index_template.go index b9298ff27..8deba3443 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putindextemplate/put_index_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putindextemplate/put_index_template.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates or updates an index template. package putindextemplate @@ -51,15 +51,19 @@ type PutIndexTemplate struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutIndexTemplate type alias for index. @@ -79,17 +83,24 @@ func NewPutIndexTemplateFunc(tp elastictransport.Interface) NewPutIndexTemplate // Creates or updates an index template. // -// https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html +// https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-template.html func New(tp elastictransport.Interface) *PutIndexTemplate { r := &PutIndexTemplate{ transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -126,9 +137,7 @@ func (r *PutIndexTemplate) HttpRequest(ctx context.Context) (*http.Request, erro } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -140,6 +149,10 @@ func (r *PutIndexTemplate) HttpRequest(ctx context.Context) (*http.Request, erro } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -148,6 +161,9 @@ func (r *PutIndexTemplate) HttpRequest(ctx context.Context) (*http.Request, erro path.WriteString("_index_template") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodPut @@ -161,15 +177,15 @@ func (r *PutIndexTemplate) HttpRequest(ctx context.Context) (*http.Request, erro } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -186,27 +202,66 @@ func (r *PutIndexTemplate) HttpRequest(ctx context.Context) (*http.Request, erro } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutIndexTemplate) Perform(ctx context.Context) (*http.Response, error) { +func (r PutIndexTemplate) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.put_index_template") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.put_index_template") + if reader := instrument.RecordRequestBody(ctx, "indices.put_index_template", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.put_index_template") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutIndexTemplate query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutIndexTemplate query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a putindextemplate.Response -func (r PutIndexTemplate) Do(ctx context.Context) (*Response, error) { +func (r PutIndexTemplate) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.put_index_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -214,6 +269,9 @@ func (r PutIndexTemplate) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -223,6 +281,9 @@ func (r PutIndexTemplate) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -230,6 +291,9 @@ func (r PutIndexTemplate) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putindextemplate/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putindextemplate/request.go index c22673ff9..a1b5279f1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putindextemplate/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putindextemplate/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putindextemplate @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package putindextemplate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/put_index_template/IndicesPutIndexTemplateRequest.ts#L36-L95 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/put_index_template/IndicesPutIndexTemplateRequest.ts#L36-L95 type Request struct { // ComposedOf An ordered list of component template names. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putindextemplate/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putindextemplate/response.go index 7a7233cf9..078cd18ca 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putindextemplate/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putindextemplate/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putindextemplate // Response holds the response body struct for the package putindextemplate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/put_index_template/IndicesPutIndexTemplateResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/put_index_template/IndicesPutIndexTemplateResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putmapping/put_mapping.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putmapping/put_mapping.go index ca2bb9764..a61078899 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putmapping/put_mapping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putmapping/put_mapping.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Updates the index mappings. package putmapping @@ -53,15 +53,19 @@ type PutMapping struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutMapping type alias for index. @@ -87,11 +91,18 @@ func New(tp elastictransport.Interface) *PutMapping { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -128,9 +139,7 @@ func (r *PutMapping) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -142,12 +151,19 @@ func (r *PutMapping) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_mapping") @@ -163,15 +179,15 @@ func (r *PutMapping) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -188,27 +204,66 @@ func (r *PutMapping) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutMapping) Perform(ctx context.Context) (*http.Response, error) { +func (r PutMapping) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.put_mapping") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.put_mapping") + if reader := instrument.RecordRequestBody(ctx, "indices.put_mapping", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.put_mapping") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutMapping query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutMapping query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a putmapping.Response -func (r PutMapping) Do(ctx context.Context) (*Response, error) { +func (r PutMapping) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.put_mapping") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -216,6 +271,9 @@ func (r PutMapping) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -225,6 +283,9 @@ func (r PutMapping) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -232,6 +293,9 @@ func (r PutMapping) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putmapping/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putmapping/request.go index 5e65125c0..a2bb0edbc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putmapping/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putmapping/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putmapping @@ -30,7 +30,7 @@ import ( // Request holds the request body struct for the package putmapping // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/put_mapping/IndicesPutMappingRequest.ts#L42-L149 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/put_mapping/IndicesPutMappingRequest.ts#L42-L149 type Request struct { // DateDetection Controls whether dynamic date detection is enabled. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putmapping/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putmapping/response.go index 28bf5f19b..588b81cc8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putmapping/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putmapping/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putmapping @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package putmapping // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/put_mapping/IndicesPutMappingResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/put_mapping/IndicesPutMappingResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putsettings/put_settings.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putsettings/put_settings.go index a29d5415e..bb8344a05 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putsettings/put_settings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putsettings/put_settings.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Updates the index settings. package putsettings @@ -53,15 +53,19 @@ type PutSettings struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutSettings type alias for index. @@ -85,7 +89,14 @@ func New(tp elastictransport.Interface) *PutSettings { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -124,9 +135,7 @@ func (r *PutSettings) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -138,6 +147,10 @@ func (r *PutSettings) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -149,6 +162,9 @@ func (r *PutSettings) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_settings") @@ -164,15 +180,15 @@ func (r *PutSettings) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -189,27 +205,66 @@ func (r *PutSettings) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutSettings) Perform(ctx context.Context) (*http.Response, error) { +func (r PutSettings) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.put_settings") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.put_settings") + if reader := instrument.RecordRequestBody(ctx, "indices.put_settings", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.put_settings") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutSettings query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutSettings query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a putsettings.Response -func (r PutSettings) Do(ctx context.Context) (*Response, error) { +func (r PutSettings) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.put_settings") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -217,6 +272,9 @@ func (r PutSettings) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -226,6 +284,9 @@ func (r PutSettings) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -233,6 +294,9 @@ func (r PutSettings) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putsettings/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putsettings/request.go index ecb5a8a71..d5a116040 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putsettings/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putsettings/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putsettings @@ -26,5 +26,5 @@ import ( // Request holds the request body struct for the package putsettings // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/put_settings/IndicesPutSettingsRequest.ts#L25-L92 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/put_settings/IndicesPutSettingsRequest.ts#L25-L92 type Request = types.IndexSettings diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putsettings/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putsettings/response.go index 4566965fb..02a79398e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putsettings/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/putsettings/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putsettings // Response holds the response body struct for the package putsettings // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/put_settings/IndicesPutSettingsResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/put_settings/IndicesPutSettingsResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/puttemplate/put_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/puttemplate/put_template.go index 9f010984e..31d829d6b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/puttemplate/put_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/puttemplate/put_template.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates or updates an index template. package puttemplate @@ -51,15 +51,19 @@ type PutTemplate struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutTemplate type alias for index. @@ -79,17 +83,24 @@ func NewPutTemplateFunc(tp elastictransport.Interface) NewPutTemplate { // Creates or updates an index template. // -// https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html +// https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates-v1.html func New(tp elastictransport.Interface) *PutTemplate { r := &PutTemplate{ transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -126,9 +137,7 @@ func (r *PutTemplate) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -140,6 +149,10 @@ func (r *PutTemplate) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -148,6 +161,9 @@ func (r *PutTemplate) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_template") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodPut @@ -161,15 +177,15 @@ func (r *PutTemplate) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -186,27 +202,66 @@ func (r *PutTemplate) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutTemplate) Perform(ctx context.Context) (*http.Response, error) { +func (r PutTemplate) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.put_template") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.put_template") + if reader := instrument.RecordRequestBody(ctx, "indices.put_template", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.put_template") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutTemplate query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutTemplate query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a puttemplate.Response -func (r PutTemplate) Do(ctx context.Context) (*Response, error) { +func (r PutTemplate) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.put_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -214,6 +269,9 @@ func (r PutTemplate) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -223,6 +281,9 @@ func (r PutTemplate) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -230,6 +291,9 @@ func (r PutTemplate) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/puttemplate/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/puttemplate/request.go index 97f5725cb..e7e519bc7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/puttemplate/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/puttemplate/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package puttemplate @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package puttemplate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/put_template/IndicesPutTemplateRequest.ts#L29-L105 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/put_template/IndicesPutTemplateRequest.ts#L29-L105 type Request struct { // Aliases Aliases for the index. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/puttemplate/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/puttemplate/response.go index 3dbbe50c4..0afc51cb3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/puttemplate/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/puttemplate/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package puttemplate // Response holds the response body struct for the package puttemplate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/put_template/IndicesPutTemplateResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/put_template/IndicesPutTemplateResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/recovery/recovery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/recovery/recovery.go index b3e1a0ebe..4c60ce6e3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/recovery/recovery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/recovery/recovery.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns information about ongoing index shard recoveries. package recovery import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type Recovery struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewRecovery type alias for index. @@ -80,7 +83,12 @@ func New(tp elastictransport.Interface) *Recovery { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *Recovery) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_recovery") @@ -121,9 +132,9 @@ func (r *Recovery) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -140,27 +151,66 @@ func (r *Recovery) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Recovery) Perform(ctx context.Context) (*http.Response, error) { +func (r Recovery) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.recovery") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.recovery") + if reader := instrument.RecordRequestBody(ctx, "indices.recovery", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.recovery") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Recovery query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Recovery query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a recovery.Response -func (r Recovery) Do(ctx context.Context) (Response, error) { +func (r Recovery) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.recovery") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -168,6 +218,9 @@ func (r Recovery) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -177,6 +230,9 @@ func (r Recovery) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,12 +240,25 @@ func (r Recovery) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Recovery) IsSuccess(ctx context.Context) (bool, error) { +func (r Recovery) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.recovery") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -205,6 +274,14 @@ func (r Recovery) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Recovery query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/recovery/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/recovery/response.go index 15438339d..52618a9c9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/recovery/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/recovery/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package recovery @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package recovery // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/recovery/IndicesRecoveryResponse.ts#L24-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/recovery/IndicesRecoveryResponse.ts#L24-L26 type Response map[string]types.RecoveryStatus diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/refresh/refresh.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/refresh/refresh.go index 976c6ac9d..a0f0a9c1c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/refresh/refresh.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/refresh/refresh.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Performs the refresh operation in one or more indices. package refresh import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,11 +52,15 @@ type Refresh struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewRefresh type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *Refresh { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -107,6 +115,9 @@ func (r *Refresh) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_refresh") @@ -122,9 +133,9 @@ func (r *Refresh) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -141,27 +152,66 @@ func (r *Refresh) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Refresh) Perform(ctx context.Context) (*http.Response, error) { +func (r Refresh) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.refresh") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.refresh") + if reader := instrument.RecordRequestBody(ctx, "indices.refresh", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.refresh") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Refresh query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Refresh query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a refresh.Response -func (r Refresh) Do(ctx context.Context) (*Response, error) { +func (r Refresh) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.refresh") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -169,6 +219,9 @@ func (r Refresh) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -178,6 +231,9 @@ func (r Refresh) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -185,12 +241,25 @@ func (r Refresh) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Refresh) IsSuccess(ctx context.Context) (bool, error) { +func (r Refresh) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.refresh") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -206,6 +275,14 @@ func (r Refresh) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Refresh query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/refresh/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/refresh/response.go index fd7e5ecb4..5204d8f2c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/refresh/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/refresh/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package refresh @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package refresh // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/refresh/IndicesRefreshResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/refresh/IndicesRefreshResponse.ts#L22-L24 type Response struct { Shards_ types.ShardStatistics `json:"_shards"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/reloadsearchanalyzers/reload_search_analyzers.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/reloadsearchanalyzers/reload_search_analyzers.go index 072702ce8..656a19f57 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/reloadsearchanalyzers/reload_search_analyzers.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/reloadsearchanalyzers/reload_search_analyzers.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Reloads an index's search analyzers and their resources. package reloadsearchanalyzers import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,11 +52,15 @@ type ReloadSearchAnalyzers struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewReloadSearchAnalyzers type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *ReloadSearchAnalyzers { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *ReloadSearchAnalyzers) HttpRequest(ctx context.Context) (*http.Request, case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_reload_search_analyzers") @@ -119,9 +130,9 @@ func (r *ReloadSearchAnalyzers) HttpRequest(ctx context.Context) (*http.Request, } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -138,27 +149,66 @@ func (r *ReloadSearchAnalyzers) HttpRequest(ctx context.Context) (*http.Request, } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ReloadSearchAnalyzers) Perform(ctx context.Context) (*http.Response, error) { +func (r ReloadSearchAnalyzers) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.reload_search_analyzers") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.reload_search_analyzers") + if reader := instrument.RecordRequestBody(ctx, "indices.reload_search_analyzers", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.reload_search_analyzers") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ReloadSearchAnalyzers query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ReloadSearchAnalyzers query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a reloadsearchanalyzers.Response -func (r ReloadSearchAnalyzers) Do(ctx context.Context) (*Response, error) { +func (r ReloadSearchAnalyzers) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.reload_search_analyzers") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -166,6 +216,9 @@ func (r ReloadSearchAnalyzers) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,6 +228,9 @@ func (r ReloadSearchAnalyzers) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,12 +238,25 @@ func (r ReloadSearchAnalyzers) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ReloadSearchAnalyzers) IsSuccess(ctx context.Context) (bool, error) { +func (r ReloadSearchAnalyzers) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.reload_search_analyzers") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -203,6 +272,14 @@ func (r ReloadSearchAnalyzers) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ReloadSearchAnalyzers query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/reloadsearchanalyzers/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/reloadsearchanalyzers/response.go index 59a287a98..881eac4e5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/reloadsearchanalyzers/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/reloadsearchanalyzers/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package reloadsearchanalyzers @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package reloadsearchanalyzers // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/reload_search_analyzers/ReloadSearchAnalyzersResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/reload_search_analyzers/ReloadSearchAnalyzersResponse.ts#L22-L24 type Response struct { ReloadDetails []types.ReloadDetails `json:"reload_details"` Shards_ types.ShardStatistics `json:"_shards"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/resolveindex/resolve_index.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/resolveindex/resolve_index.go index 4173011ee..ebd8d3f45 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/resolveindex/resolve_index.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/resolveindex/resolve_index.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns information about any matching indices, aliases, and data streams package resolveindex import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type ResolveIndex struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewResolveIndex type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *ResolveIndex { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -107,6 +115,9 @@ func (r *ResolveIndex) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("index") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodGet @@ -120,9 +131,9 @@ func (r *ResolveIndex) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -139,27 +150,66 @@ func (r *ResolveIndex) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ResolveIndex) Perform(ctx context.Context) (*http.Response, error) { +func (r ResolveIndex) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.resolve_index") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.resolve_index") + if reader := instrument.RecordRequestBody(ctx, "indices.resolve_index", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.resolve_index") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ResolveIndex query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ResolveIndex query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a resolveindex.Response -func (r ResolveIndex) Do(ctx context.Context) (*Response, error) { +func (r ResolveIndex) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.resolve_index") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -167,6 +217,9 @@ func (r ResolveIndex) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -176,6 +229,9 @@ func (r ResolveIndex) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -183,12 +239,25 @@ func (r ResolveIndex) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ResolveIndex) IsSuccess(ctx context.Context) (bool, error) { +func (r ResolveIndex) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.resolve_index") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -204,6 +273,14 @@ func (r ResolveIndex) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ResolveIndex query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/resolveindex/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/resolveindex/response.go index fe2883839..140465a24 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/resolveindex/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/resolveindex/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package resolveindex @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package resolveindex // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/resolve_index/ResolveIndexResponse.ts#L22-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/resolve_index/ResolveIndexResponse.ts#L22-L28 type Response struct { Aliases []types.ResolveIndexAliasItem `json:"aliases"` DataStreams []types.ResolveIndexDataStreamsItem `json:"data_streams"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/rollover/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/rollover/request.go index 79a6caede..fc5cf26a4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/rollover/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/rollover/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package rollover @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package rollover // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/rollover/IndicesRolloverRequest.ts#L29-L99 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/rollover/IndicesRolloverRequest.ts#L29-L99 type Request struct { // Aliases Aliases for the target index. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/rollover/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/rollover/response.go index 5d772b782..12997bafd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/rollover/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/rollover/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package rollover // Response holds the response body struct for the package rollover // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/rollover/IndicesRolloverResponse.ts#L22-L32 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/rollover/IndicesRolloverResponse.ts#L22-L32 type Response struct { Acknowledged bool `json:"acknowledged"` Conditions map[string]bool `json:"conditions"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/rollover/rollover.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/rollover/rollover.go index 7c5e76f3c..fcb650aab 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/rollover/rollover.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/rollover/rollover.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Updates an alias to point to a new index when the existing index // is considered to be too large or too old. @@ -54,16 +54,20 @@ type Rollover struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int alias string newindex string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewRollover type alias for index. @@ -90,11 +94,18 @@ func New(tp elastictransport.Interface) *Rollover { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -131,9 +142,7 @@ func (r *Rollover) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -145,12 +154,19 @@ func (r *Rollover) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { case r.paramSet == aliasMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "alias", r.alias) + } path.WriteString(r.alias) path.WriteString("/") path.WriteString("_rollover") @@ -159,11 +175,17 @@ func (r *Rollover) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == aliasMask|newindexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "alias", r.alias) + } path.WriteString(r.alias) path.WriteString("/") path.WriteString("_rollover") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "newindex", r.newindex) + } path.WriteString(r.newindex) method = http.MethodPost @@ -177,15 +199,15 @@ func (r *Rollover) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -202,27 +224,66 @@ func (r *Rollover) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Rollover) Perform(ctx context.Context) (*http.Response, error) { +func (r Rollover) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.rollover") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.rollover") + if reader := instrument.RecordRequestBody(ctx, "indices.rollover", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.rollover") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Rollover query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Rollover query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a rollover.Response -func (r Rollover) Do(ctx context.Context) (*Response, error) { +func (r Rollover) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.rollover") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -230,6 +291,9 @@ func (r Rollover) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -239,6 +303,9 @@ func (r Rollover) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -246,6 +313,9 @@ func (r Rollover) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/segments/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/segments/response.go index 616da134d..60e1a1209 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/segments/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/segments/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package segments @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package segments // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/segments/IndicesSegmentsResponse.ts#L24-L29 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/segments/IndicesSegmentsResponse.ts#L24-L29 type Response struct { Indices map[string]types.IndexSegment `json:"indices"` Shards_ types.ShardStatistics `json:"_shards"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/segments/segments.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/segments/segments.go index 9fd33a90a..7f3a84b22 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/segments/segments.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/segments/segments.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Provides low-level information about segments in a Lucene index. package segments import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,11 +52,15 @@ type Segments struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewSegments type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *Segments { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -107,6 +115,9 @@ func (r *Segments) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_segments") @@ -122,9 +133,9 @@ func (r *Segments) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -141,27 +152,66 @@ func (r *Segments) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Segments) Perform(ctx context.Context) (*http.Response, error) { +func (r Segments) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.segments") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.segments") + if reader := instrument.RecordRequestBody(ctx, "indices.segments", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.segments") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Segments query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Segments query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a segments.Response -func (r Segments) Do(ctx context.Context) (*Response, error) { +func (r Segments) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.segments") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -169,6 +219,9 @@ func (r Segments) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -178,6 +231,9 @@ func (r Segments) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -185,12 +241,25 @@ func (r Segments) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Segments) IsSuccess(ctx context.Context) (bool, error) { +func (r Segments) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.segments") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -206,6 +275,14 @@ func (r Segments) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Segments query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/shardstores/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/shardstores/response.go index f3fb38274..8b4f67a80 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/shardstores/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/shardstores/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package shardstores @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package shardstores // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/shard_stores/IndicesShardStoresResponse.ts#L24-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/shard_stores/IndicesShardStoresResponse.ts#L24-L26 type Response struct { Indices map[string]types.IndicesShardStores `json:"indices"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/shardstores/shard_stores.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/shardstores/shard_stores.go index c6b2d11a7..5ed7090cd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/shardstores/shard_stores.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/shardstores/shard_stores.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Provides store information for shard copies of indices. package shardstores import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -54,11 +53,15 @@ type ShardStores struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewShardStores type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *ShardStores { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,6 +116,9 @@ func (r *ShardStores) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_shard_stores") @@ -123,9 +134,9 @@ func (r *ShardStores) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -142,27 +153,66 @@ func (r *ShardStores) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ShardStores) Perform(ctx context.Context) (*http.Response, error) { +func (r ShardStores) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.shard_stores") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.shard_stores") + if reader := instrument.RecordRequestBody(ctx, "indices.shard_stores", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.shard_stores") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ShardStores query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ShardStores query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a shardstores.Response -func (r ShardStores) Do(ctx context.Context) (*Response, error) { +func (r ShardStores) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.shard_stores") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -170,6 +220,9 @@ func (r ShardStores) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -179,6 +232,9 @@ func (r ShardStores) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -186,12 +242,25 @@ func (r ShardStores) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ShardStores) IsSuccess(ctx context.Context) (bool, error) { +func (r ShardStores) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.shard_stores") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -207,6 +276,14 @@ func (r ShardStores) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ShardStores query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/shrink/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/shrink/request.go index a3921b027..2dde661ee 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/shrink/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/shrink/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package shrink @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package shrink // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/shrink/IndicesShrinkRequest.ts#L27-L75 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/shrink/IndicesShrinkRequest.ts#L27-L75 type Request struct { // Aliases The key is the alias name. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/shrink/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/shrink/response.go index 1def6e046..aaa9bacc3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/shrink/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/shrink/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package shrink // Response holds the response body struct for the package shrink // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/shrink/IndicesShrinkResponse.ts#L22-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/shrink/IndicesShrinkResponse.ts#L22-L28 type Response struct { Acknowledged bool `json:"acknowledged"` Index string `json:"index"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/shrink/shrink.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/shrink/shrink.go index 147c8bb71..1ce783a7d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/shrink/shrink.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/shrink/shrink.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Allow to shrink an existing index into a new index with fewer primary shards. package shrink @@ -52,16 +52,20 @@ type Shrink struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string target string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewShrink type alias for index. @@ -89,11 +93,18 @@ func New(tp elastictransport.Interface) *Shrink { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -130,9 +141,7 @@ func (r *Shrink) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -144,17 +153,27 @@ func (r *Shrink) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { case r.paramSet == indexMask|targetMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_shrink") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "target", r.target) + } path.WriteString(r.target) method = http.MethodPut @@ -168,15 +187,15 @@ func (r *Shrink) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -193,27 +212,66 @@ func (r *Shrink) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Shrink) Perform(ctx context.Context) (*http.Response, error) { +func (r Shrink) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.shrink") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.shrink") + if reader := instrument.RecordRequestBody(ctx, "indices.shrink", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.shrink") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Shrink query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Shrink query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a shrink.Response -func (r Shrink) Do(ctx context.Context) (*Response, error) { +func (r Shrink) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.shrink") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -221,6 +279,9 @@ func (r Shrink) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -230,6 +291,9 @@ func (r Shrink) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -237,6 +301,9 @@ func (r Shrink) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/simulateindextemplate/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/simulateindextemplate/request.go index 0374ba50d..7a9a983fa 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/simulateindextemplate/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/simulateindextemplate/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package simulateindextemplate @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package simulateindextemplate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/simulate_index_template/IndicesSimulateIndexTemplateRequest.ts#L33-L115 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/simulate_index_template/IndicesSimulateIndexTemplateRequest.ts#L33-L115 type Request struct { // AllowAutoCreate This setting overrides the value of the `action.auto_create_index` cluster diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/simulateindextemplate/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/simulateindextemplate/response.go index 2f4e6c31d..0eb99bdd2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/simulateindextemplate/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/simulateindextemplate/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package simulateindextemplate // Response holds the response body struct for the package simulateindextemplate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/simulate_index_template/IndicesSimulateIndexTemplateResponse.ts#L20-L22 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/simulate_index_template/IndicesSimulateIndexTemplateResponse.ts#L20-L22 type Response struct { } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/simulateindextemplate/simulate_index_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/simulateindextemplate/simulate_index_template.go index a7470e3c8..a06ffb517 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/simulateindextemplate/simulate_index_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/simulateindextemplate/simulate_index_template.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Simulate matching the given index name against the index templates in the // system @@ -52,15 +52,19 @@ type SimulateIndexTemplate struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewSimulateIndexTemplate type alias for index. @@ -81,17 +85,24 @@ func NewSimulateIndexTemplateFunc(tp elastictransport.Interface) NewSimulateInde // Simulate matching the given index name against the index templates in the // system // -// https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html +// https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-simulate-index.html func New(tp elastictransport.Interface) *SimulateIndexTemplate { r := &SimulateIndexTemplate{ transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -128,9 +139,7 @@ func (r *SimulateIndexTemplate) HttpRequest(ctx context.Context) (*http.Request, } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -142,6 +151,10 @@ func (r *SimulateIndexTemplate) HttpRequest(ctx context.Context) (*http.Request, } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -152,6 +165,9 @@ func (r *SimulateIndexTemplate) HttpRequest(ctx context.Context) (*http.Request, path.WriteString("_simulate_index") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodPost @@ -165,15 +181,15 @@ func (r *SimulateIndexTemplate) HttpRequest(ctx context.Context) (*http.Request, } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -190,27 +206,66 @@ func (r *SimulateIndexTemplate) HttpRequest(ctx context.Context) (*http.Request, } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r SimulateIndexTemplate) Perform(ctx context.Context) (*http.Response, error) { +func (r SimulateIndexTemplate) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.simulate_index_template") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.simulate_index_template") + if reader := instrument.RecordRequestBody(ctx, "indices.simulate_index_template", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.simulate_index_template") + } if err != nil { - return nil, fmt.Errorf("an error happened during the SimulateIndexTemplate query execution: %w", err) + localErr := fmt.Errorf("an error happened during the SimulateIndexTemplate query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a simulateindextemplate.Response -func (r SimulateIndexTemplate) Do(ctx context.Context) (*Response, error) { +func (r SimulateIndexTemplate) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.simulate_index_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -218,6 +273,9 @@ func (r SimulateIndexTemplate) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -227,6 +285,9 @@ func (r SimulateIndexTemplate) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -234,6 +295,9 @@ func (r SimulateIndexTemplate) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/simulatetemplate/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/simulatetemplate/request.go index e19216131..395104e4f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/simulatetemplate/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/simulatetemplate/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package simulatetemplate @@ -26,5 +26,5 @@ import ( // Request holds the request body struct for the package simulatetemplate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/simulate_template/IndicesSimulateTemplateRequest.ts#L25-L61 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/simulate_template/IndicesSimulateTemplateRequest.ts#L25-L61 type Request = types.IndexTemplate diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/simulatetemplate/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/simulatetemplate/response.go index 4811c9e2a..e9cd72df8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/simulatetemplate/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/simulatetemplate/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package simulatetemplate @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package simulatetemplate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/simulate_template/IndicesSimulateTemplateResponse.ts#L26-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/simulate_template/IndicesSimulateTemplateResponse.ts#L26-L31 type Response struct { Overlapping []types.Overlapping `json:"overlapping,omitempty"` Template types.Template `json:"template"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/simulatetemplate/simulate_template.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/simulatetemplate/simulate_template.go index e14f4fc52..d923fda7d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/simulatetemplate/simulate_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/simulatetemplate/simulate_template.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Simulate resolving the given template name or body package simulatetemplate @@ -51,15 +51,19 @@ type SimulateTemplate struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewSimulateTemplate type alias for index. @@ -77,13 +81,20 @@ func NewSimulateTemplateFunc(tp elastictransport.Interface) NewSimulateTemplate // Simulate resolving the given template name or body // -// https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html +// https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-simulate-template.html func New(tp elastictransport.Interface) *SimulateTemplate { r := &SimulateTemplate{ transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -122,9 +133,7 @@ func (r *SimulateTemplate) HttpRequest(ctx context.Context) (*http.Request, erro } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -136,6 +145,10 @@ func (r *SimulateTemplate) HttpRequest(ctx context.Context) (*http.Request, erro } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -153,6 +166,9 @@ func (r *SimulateTemplate) HttpRequest(ctx context.Context) (*http.Request, erro path.WriteString("_simulate") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodPost @@ -166,15 +182,15 @@ func (r *SimulateTemplate) HttpRequest(ctx context.Context) (*http.Request, erro } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -191,27 +207,66 @@ func (r *SimulateTemplate) HttpRequest(ctx context.Context) (*http.Request, erro } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r SimulateTemplate) Perform(ctx context.Context) (*http.Response, error) { +func (r SimulateTemplate) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.simulate_template") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.simulate_template") + if reader := instrument.RecordRequestBody(ctx, "indices.simulate_template", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.simulate_template") + } if err != nil { - return nil, fmt.Errorf("an error happened during the SimulateTemplate query execution: %w", err) + localErr := fmt.Errorf("an error happened during the SimulateTemplate query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a simulatetemplate.Response -func (r SimulateTemplate) Do(ctx context.Context) (*Response, error) { +func (r SimulateTemplate) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.simulate_template") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -219,6 +274,9 @@ func (r SimulateTemplate) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -228,6 +286,9 @@ func (r SimulateTemplate) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -235,6 +296,9 @@ func (r SimulateTemplate) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/split/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/split/request.go index ca72a9a3d..87375dbe6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/split/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/split/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package split @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package split // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/split/IndicesSplitRequest.ts#L27-L74 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/split/IndicesSplitRequest.ts#L27-L74 type Request struct { // Aliases Aliases for the resulting index. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/split/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/split/response.go index 71ba98aed..41abd0e41 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/split/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/split/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package split // Response holds the response body struct for the package split // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/split/IndicesSplitResponse.ts#L22-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/split/IndicesSplitResponse.ts#L22-L28 type Response struct { Acknowledged bool `json:"acknowledged"` Index string `json:"index"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/split/split.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/split/split.go index 8cdb21717..d96a0b584 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/split/split.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/split/split.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Allows you to split an existing index into a new index with more primary // shards. @@ -53,16 +53,20 @@ type Split struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string target string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewSplit type alias for index. @@ -91,11 +95,18 @@ func New(tp elastictransport.Interface) *Split { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -132,9 +143,7 @@ func (r *Split) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -146,17 +155,27 @@ func (r *Split) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { case r.paramSet == indexMask|targetMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_split") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "target", r.target) + } path.WriteString(r.target) method = http.MethodPut @@ -170,15 +189,15 @@ func (r *Split) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -195,27 +214,66 @@ func (r *Split) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Split) Perform(ctx context.Context) (*http.Response, error) { +func (r Split) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.split") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.split") + if reader := instrument.RecordRequestBody(ctx, "indices.split", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.split") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Split query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Split query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a split.Response -func (r Split) Do(ctx context.Context) (*Response, error) { +func (r Split) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.split") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -223,6 +281,9 @@ func (r Split) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -232,6 +293,9 @@ func (r Split) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -239,6 +303,9 @@ func (r Split) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/stats/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/stats/response.go index 1bc3709de..b49c8e18f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/stats/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/stats/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package stats @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package stats // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/stats/IndicesStatsResponse.ts#L24-L30 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/stats/IndicesStatsResponse.ts#L24-L30 type Response struct { All_ types.IndicesStats `json:"_all"` Indices map[string]types.IndicesStats `json:"indices,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/stats/stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/stats/stats.go index ed9f61e45..20748ee2e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/stats/stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/stats/stats.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Provides statistics on operations happening in an index. package stats import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -56,12 +55,16 @@ type Stats struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int metric string index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewStats type alias for index. @@ -85,7 +88,12 @@ func New(tp elastictransport.Interface) *Stats { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -113,12 +121,18 @@ func (r *Stats) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_stats") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "metric", r.metric) + } path.WriteString(r.metric) method = http.MethodGet case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_stats") @@ -127,11 +141,17 @@ func (r *Stats) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask|metricMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_stats") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "metric", r.metric) + } path.WriteString(r.metric) method = http.MethodGet @@ -145,9 +165,9 @@ func (r *Stats) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -164,27 +184,66 @@ func (r *Stats) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Stats) Perform(ctx context.Context) (*http.Response, error) { +func (r Stats) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.stats") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.stats") + if reader := instrument.RecordRequestBody(ctx, "indices.stats", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.stats") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Stats query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Stats query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a stats.Response -func (r Stats) Do(ctx context.Context) (*Response, error) { +func (r Stats) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -192,6 +251,9 @@ func (r Stats) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -201,6 +263,9 @@ func (r Stats) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -208,12 +273,25 @@ func (r Stats) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Stats) IsSuccess(ctx context.Context) (bool, error) { +func (r Stats) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -229,6 +307,14 @@ func (r Stats) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Stats query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/unfreeze/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/unfreeze/response.go index 9526b03c3..6bf73e45f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/unfreeze/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/unfreeze/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package unfreeze // Response holds the response body struct for the package unfreeze // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/unfreeze/IndicesUnfreezeResponse.ts#L20-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/unfreeze/IndicesUnfreezeResponse.ts#L20-L25 type Response struct { Acknowledged bool `json:"acknowledged"` ShardsAcknowledged bool `json:"shards_acknowledged"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/unfreeze/unfreeze.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/unfreeze/unfreeze.go index 73ff6f48a..f3d335bf5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/unfreeze/unfreeze.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/unfreeze/unfreeze.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Unfreezes an index. When a frozen index is unfrozen, the index goes through // the normal recovery process and becomes writeable again. package unfreeze import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -54,11 +53,15 @@ type Unfreeze struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewUnfreeze type alias for index. @@ -85,7 +88,12 @@ func New(tp elastictransport.Interface) *Unfreeze { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *Unfreeze) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_unfreeze") @@ -121,9 +132,9 @@ func (r *Unfreeze) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -140,27 +151,66 @@ func (r *Unfreeze) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Unfreeze) Perform(ctx context.Context) (*http.Response, error) { +func (r Unfreeze) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.unfreeze") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.unfreeze") + if reader := instrument.RecordRequestBody(ctx, "indices.unfreeze", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.unfreeze") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Unfreeze query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Unfreeze query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a unfreeze.Response -func (r Unfreeze) Do(ctx context.Context) (*Response, error) { +func (r Unfreeze) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.unfreeze") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -168,6 +218,9 @@ func (r Unfreeze) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -177,6 +230,9 @@ func (r Unfreeze) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,12 +240,25 @@ func (r Unfreeze) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Unfreeze) IsSuccess(ctx context.Context) (bool, error) { +func (r Unfreeze) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.unfreeze") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -205,6 +274,14 @@ func (r Unfreeze) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Unfreeze query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/updatealiases/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/updatealiases/request.go index 652d13426..b584f553e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/updatealiases/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/updatealiases/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package updatealiases @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package updatealiases // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/update_aliases/IndicesUpdateAliasesRequest.ts#L24-L51 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/update_aliases/IndicesUpdateAliasesRequest.ts#L24-L51 type Request struct { // Actions Actions to perform. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/updatealiases/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/updatealiases/response.go index 42ceec46d..8748f209f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/updatealiases/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/updatealiases/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package updatealiases // Response holds the response body struct for the package updatealiases // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/update_aliases/IndicesUpdateAliasesResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/update_aliases/IndicesUpdateAliasesResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/updatealiases/update_aliases.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/updatealiases/update_aliases.go index 9ae707352..d47f14b39 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/updatealiases/update_aliases.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/updatealiases/update_aliases.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Updates index aliases. package updatealiases @@ -46,13 +46,17 @@ type UpdateAliases struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewUpdateAliases type alias for index. @@ -76,11 +80,18 @@ func New(tp elastictransport.Interface) *UpdateAliases { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -117,9 +128,7 @@ func (r *UpdateAliases) HttpRequest(ctx context.Context) (*http.Request, error) } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -131,6 +140,10 @@ func (r *UpdateAliases) HttpRequest(ctx context.Context) (*http.Request, error) } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -149,15 +162,15 @@ func (r *UpdateAliases) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -174,27 +187,66 @@ func (r *UpdateAliases) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r UpdateAliases) Perform(ctx context.Context) (*http.Response, error) { +func (r UpdateAliases) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.update_aliases") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.update_aliases") + if reader := instrument.RecordRequestBody(ctx, "indices.update_aliases", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.update_aliases") + } if err != nil { - return nil, fmt.Errorf("an error happened during the UpdateAliases query execution: %w", err) + localErr := fmt.Errorf("an error happened during the UpdateAliases query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a updatealiases.Response -func (r UpdateAliases) Do(ctx context.Context) (*Response, error) { +func (r UpdateAliases) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.update_aliases") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -202,6 +254,9 @@ func (r UpdateAliases) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -211,6 +266,9 @@ func (r UpdateAliases) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -218,6 +276,9 @@ func (r UpdateAliases) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/validatequery/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/validatequery/request.go index 5dcbf2f8a..e4b3b0d23 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/validatequery/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/validatequery/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package validatequery @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package validatequery // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/validate_query/IndicesValidateQueryRequest.ts#L25-L111 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/validate_query/IndicesValidateQueryRequest.ts#L25-L111 type Request struct { // Query Query in the Lucene query string syntax. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/validatequery/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/validatequery/response.go index 25b2fd825..50aee6dc1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/validatequery/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/validatequery/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package validatequery @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package validatequery // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/validate_query/IndicesValidateQueryResponse.ts#L23-L30 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/validate_query/IndicesValidateQueryResponse.ts#L23-L30 type Response struct { Error *string `json:"error,omitempty"` Explanations []types.IndicesValidationExplanation `json:"explanations,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/validatequery/validate_query.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/validatequery/validate_query.go index be212a97c..6fd0fb7a1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/validatequery/validate_query.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/indices/validatequery/validate_query.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Allows a user to validate a potentially expensive query without executing it. package validatequery @@ -53,15 +53,19 @@ type ValidateQuery struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewValidateQuery type alias for index. @@ -85,11 +89,18 @@ func New(tp elastictransport.Interface) *ValidateQuery { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -126,9 +137,7 @@ func (r *ValidateQuery) HttpRequest(ctx context.Context) (*http.Request, error) } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -140,6 +149,10 @@ func (r *ValidateQuery) HttpRequest(ctx context.Context) (*http.Request, error) } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -153,6 +166,9 @@ func (r *ValidateQuery) HttpRequest(ctx context.Context) (*http.Request, error) case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_validate") @@ -170,15 +186,15 @@ func (r *ValidateQuery) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -195,27 +211,66 @@ func (r *ValidateQuery) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ValidateQuery) Perform(ctx context.Context) (*http.Response, error) { +func (r ValidateQuery) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "indices.validate_query") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "indices.validate_query") + if reader := instrument.RecordRequestBody(ctx, "indices.validate_query", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "indices.validate_query") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ValidateQuery query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ValidateQuery query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a validatequery.Response -func (r ValidateQuery) Do(ctx context.Context) (*Response, error) { +func (r ValidateQuery) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "indices.validate_query") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -223,6 +278,9 @@ func (r ValidateQuery) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -232,6 +290,9 @@ func (r ValidateQuery) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -239,6 +300,9 @@ func (r ValidateQuery) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/deletemodel/delete_model.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/deletemodel/delete_model.go new file mode 100644 index 000000000..cf4048f96 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/deletemodel/delete_model.go @@ -0,0 +1,318 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated from the elasticsearch-specification DO NOT EDIT. +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c + +// Delete model in the Inference API +package deletemodel + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "io" + "io/ioutil" + "net/http" + "net/url" + "strings" + + "github.com/elastic/elastic-transport-go/v8/elastictransport" + "github.com/elastic/go-elasticsearch/v8/typedapi/types" +) + +const ( + tasktypeMask = iota + 1 + + modelidMask +) + +// ErrBuildPath is returned in case of missing parameters within the build of the request. +var ErrBuildPath = errors.New("cannot build path, check for missing path parameters") + +type DeleteModel struct { + transport elastictransport.Interface + + headers http.Header + values url.Values + path url.URL + + raw io.Reader + + paramSet int + + tasktype string + modelid string + + spanStarted bool + + instrument elastictransport.Instrumentation +} + +// NewDeleteModel type alias for index. +type NewDeleteModel func(tasktype, modelid string) *DeleteModel + +// NewDeleteModelFunc returns a new instance of DeleteModel with the provided transport. +// Used in the index of the library this allows to retrieve every apis in once place. +func NewDeleteModelFunc(tp elastictransport.Interface) NewDeleteModel { + return func(tasktype, modelid string) *DeleteModel { + n := New(tp) + + n._tasktype(tasktype) + + n._modelid(modelid) + + return n + } +} + +// Delete model in the Inference API +// +// https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-inference-api.html +func New(tp elastictransport.Interface) *DeleteModel { + r := &DeleteModel{ + transport: tp, + values: make(url.Values), + headers: make(http.Header), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + + return r +} + +// HttpRequest returns the http.Request object built from the +// given parameters. +func (r *DeleteModel) HttpRequest(ctx context.Context) (*http.Request, error) { + var path strings.Builder + var method string + var req *http.Request + + var err error + + r.path.Scheme = "http" + + switch { + case r.paramSet == tasktypeMask|modelidMask: + path.WriteString("/") + path.WriteString("_inference") + path.WriteString("/") + + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "tasktype", r.tasktype) + } + path.WriteString(r.tasktype) + path.WriteString("/") + + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "modelid", r.modelid) + } + path.WriteString(r.modelid) + + method = http.MethodDelete + } + + r.path.Path = path.String() + r.path.RawQuery = r.values.Encode() + + if r.path.Path == "" { + return nil, ErrBuildPath + } + + if ctx != nil { + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) + } else { + req, err = http.NewRequest(method, r.path.String(), r.raw) + } + + req.Header = r.headers.Clone() + + if req.Header.Get("Accept") == "" { + req.Header.Set("Accept", "application/vnd.elasticsearch+json;compatible-with=8") + } + + if err != nil { + return req, fmt.Errorf("could not build http.Request: %w", err) + } + + return req, nil +} + +// Perform runs the http.Request through the provided transport and returns an http.Response. +func (r DeleteModel) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "inference.delete_model") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + + req, err := r.HttpRequest(ctx) + if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "inference.delete_model") + if reader := instrument.RecordRequestBody(ctx, "inference.delete_model", r.raw); reader != nil { + req.Body = reader + } + } + res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "inference.delete_model") + } + if err != nil { + localErr := fmt.Errorf("an error happened during the DeleteModel query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr + } + + return res, nil +} + +// Do runs the request through the transport, handle the response and returns a deletemodel.Response +func (r DeleteModel) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "inference.delete_model") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + response := NewResponse() + + res, err := r.Perform(ctx) + if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + defer res.Body.Close() + + if res.StatusCode < 299 { + err = json.NewDecoder(res.Body).Decode(response) + if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + return response, nil + } + + errorResponse := types.NewElasticsearchError() + err = json.NewDecoder(res.Body).Decode(errorResponse) + if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if errorResponse.Status == 0 { + errorResponse.Status = res.StatusCode + } + + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } + return nil, errorResponse +} + +// IsSuccess allows to run a query with a context and retrieve the result as a boolean. +// This only exists for endpoints without a request payload and allows for quick control flow. +func (r DeleteModel) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "inference.delete_model") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + res, err := r.Perform(ctx) + + if err != nil { + return false, err + } + io.Copy(ioutil.Discard, res.Body) + err = res.Body.Close() + if err != nil { + return false, err + } + + if res.StatusCode >= 200 && res.StatusCode < 300 { + return true, nil + } + + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteModel query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + + return false, nil +} + +// Header set a key, value pair in the DeleteModel headers map. +func (r *DeleteModel) Header(key, value string) *DeleteModel { + r.headers.Set(key, value) + + return r +} + +// TaskType The model task type +// API Name: tasktype +func (r *DeleteModel) _tasktype(tasktype string) *DeleteModel { + r.paramSet |= tasktypeMask + r.tasktype = tasktype + + return r +} + +// ModelId The unique identifier of the inference model. +// API Name: modelid +func (r *DeleteModel) _modelid(modelid string) *DeleteModel { + r.paramSet |= modelidMask + r.modelid = modelid + + return r +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/deletemodel/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/deletemodel/response.go new file mode 100644 index 000000000..a2a08bea8 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/deletemodel/response.go @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated from the elasticsearch-specification DO NOT EDIT. +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c + +package deletemodel + +// Response holds the response body struct for the package deletemodel +// +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/inference/delete_model/DeleteModelResponse.ts#L22-L24 +type Response struct { + + // Acknowledged For a successful response, this value is always true. On failure, an + // exception is returned instead. + Acknowledged bool `json:"acknowledged"` +} + +// NewResponse returns a Response +func NewResponse() *Response { + r := &Response{} + return r +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/getmodel/get_model.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/getmodel/get_model.go new file mode 100644 index 000000000..0280e36ed --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/getmodel/get_model.go @@ -0,0 +1,318 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated from the elasticsearch-specification DO NOT EDIT. +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c + +// Get a model in the Inference API +package getmodel + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "io" + "io/ioutil" + "net/http" + "net/url" + "strings" + + "github.com/elastic/elastic-transport-go/v8/elastictransport" + "github.com/elastic/go-elasticsearch/v8/typedapi/types" +) + +const ( + tasktypeMask = iota + 1 + + modelidMask +) + +// ErrBuildPath is returned in case of missing parameters within the build of the request. +var ErrBuildPath = errors.New("cannot build path, check for missing path parameters") + +type GetModel struct { + transport elastictransport.Interface + + headers http.Header + values url.Values + path url.URL + + raw io.Reader + + paramSet int + + tasktype string + modelid string + + spanStarted bool + + instrument elastictransport.Instrumentation +} + +// NewGetModel type alias for index. +type NewGetModel func(tasktype, modelid string) *GetModel + +// NewGetModelFunc returns a new instance of GetModel with the provided transport. +// Used in the index of the library this allows to retrieve every apis in once place. +func NewGetModelFunc(tp elastictransport.Interface) NewGetModel { + return func(tasktype, modelid string) *GetModel { + n := New(tp) + + n._tasktype(tasktype) + + n._modelid(modelid) + + return n + } +} + +// Get a model in the Inference API +// +// https://www.elastic.co/guide/en/elasticsearch/reference/current/get-inference-api.html +func New(tp elastictransport.Interface) *GetModel { + r := &GetModel{ + transport: tp, + values: make(url.Values), + headers: make(http.Header), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + + return r +} + +// HttpRequest returns the http.Request object built from the +// given parameters. +func (r *GetModel) HttpRequest(ctx context.Context) (*http.Request, error) { + var path strings.Builder + var method string + var req *http.Request + + var err error + + r.path.Scheme = "http" + + switch { + case r.paramSet == tasktypeMask|modelidMask: + path.WriteString("/") + path.WriteString("_inference") + path.WriteString("/") + + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "tasktype", r.tasktype) + } + path.WriteString(r.tasktype) + path.WriteString("/") + + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "modelid", r.modelid) + } + path.WriteString(r.modelid) + + method = http.MethodGet + } + + r.path.Path = path.String() + r.path.RawQuery = r.values.Encode() + + if r.path.Path == "" { + return nil, ErrBuildPath + } + + if ctx != nil { + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) + } else { + req, err = http.NewRequest(method, r.path.String(), r.raw) + } + + req.Header = r.headers.Clone() + + if req.Header.Get("Accept") == "" { + req.Header.Set("Accept", "application/vnd.elasticsearch+json;compatible-with=8") + } + + if err != nil { + return req, fmt.Errorf("could not build http.Request: %w", err) + } + + return req, nil +} + +// Perform runs the http.Request through the provided transport and returns an http.Response. +func (r GetModel) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "inference.get_model") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + + req, err := r.HttpRequest(ctx) + if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "inference.get_model") + if reader := instrument.RecordRequestBody(ctx, "inference.get_model", r.raw); reader != nil { + req.Body = reader + } + } + res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "inference.get_model") + } + if err != nil { + localErr := fmt.Errorf("an error happened during the GetModel query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr + } + + return res, nil +} + +// Do runs the request through the transport, handle the response and returns a getmodel.Response +func (r GetModel) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "inference.get_model") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + response := NewResponse() + + res, err := r.Perform(ctx) + if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + defer res.Body.Close() + + if res.StatusCode < 299 { + err = json.NewDecoder(res.Body).Decode(response) + if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + return response, nil + } + + errorResponse := types.NewElasticsearchError() + err = json.NewDecoder(res.Body).Decode(errorResponse) + if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if errorResponse.Status == 0 { + errorResponse.Status = res.StatusCode + } + + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } + return nil, errorResponse +} + +// IsSuccess allows to run a query with a context and retrieve the result as a boolean. +// This only exists for endpoints without a request payload and allows for quick control flow. +func (r GetModel) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "inference.get_model") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + res, err := r.Perform(ctx) + + if err != nil { + return false, err + } + io.Copy(ioutil.Discard, res.Body) + err = res.Body.Close() + if err != nil { + return false, err + } + + if res.StatusCode >= 200 && res.StatusCode < 300 { + return true, nil + } + + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetModel query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + + return false, nil +} + +// Header set a key, value pair in the GetModel headers map. +func (r *GetModel) Header(key, value string) *GetModel { + r.headers.Set(key, value) + + return r +} + +// TaskType The model task type +// API Name: tasktype +func (r *GetModel) _tasktype(tasktype string) *GetModel { + r.paramSet |= tasktypeMask + r.tasktype = tasktype + + return r +} + +// ModelId The unique identifier of the inference model. +// API Name: modelid +func (r *GetModel) _modelid(modelid string) *GetModel { + r.paramSet |= modelidMask + r.modelid = modelid + + return r +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/getmodel/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/getmodel/response.go new file mode 100644 index 000000000..3632b70bc --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/getmodel/response.go @@ -0,0 +1,38 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated from the elasticsearch-specification DO NOT EDIT. +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c + +package getmodel + +import ( + "github.com/elastic/go-elasticsearch/v8/typedapi/types" +) + +// Response holds the response body struct for the package getmodel +// +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/inference/get_model/GetModelResponse.ts#L22-L26 +type Response struct { + Models []types.ModelConfigContainer `json:"models"` +} + +// NewResponse returns a Response +func NewResponse() *Response { + r := &Response{} + return r +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/inference/inference.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/inference/inference.go new file mode 100644 index 000000000..ef3147703 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/inference/inference.go @@ -0,0 +1,344 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated from the elasticsearch-specification DO NOT EDIT. +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c + +// Perform inference on a model +package inference + +import ( + gobytes "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strings" + + "github.com/elastic/elastic-transport-go/v8/elastictransport" + "github.com/elastic/go-elasticsearch/v8/typedapi/types" +) + +const ( + tasktypeMask = iota + 1 + + modelidMask +) + +// ErrBuildPath is returned in case of missing parameters within the build of the request. +var ErrBuildPath = errors.New("cannot build path, check for missing path parameters") + +type Inference struct { + transport elastictransport.Interface + + headers http.Header + values url.Values + path url.URL + + raw io.Reader + + req *Request + deferred []func(request *Request) error + buf *gobytes.Buffer + + paramSet int + + tasktype string + modelid string + + spanStarted bool + + instrument elastictransport.Instrumentation +} + +// NewInference type alias for index. +type NewInference func(tasktype, modelid string) *Inference + +// NewInferenceFunc returns a new instance of Inference with the provided transport. +// Used in the index of the library this allows to retrieve every apis in once place. +func NewInferenceFunc(tp elastictransport.Interface) NewInference { + return func(tasktype, modelid string) *Inference { + n := New(tp) + + n._tasktype(tasktype) + + n._modelid(modelid) + + return n + } +} + +// Perform inference on a model +// +// https://www.elastic.co/guide/en/elasticsearch/reference/current/post-inference-api.html +func New(tp elastictransport.Interface) *Inference { + r := &Inference{ + transport: tp, + values: make(url.Values), + headers: make(http.Header), + + buf: gobytes.NewBuffer(nil), + + req: NewRequest(), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + + return r +} + +// Raw takes a json payload as input which is then passed to the http.Request +// If specified Raw takes precedence on Request method. +func (r *Inference) Raw(raw io.Reader) *Inference { + r.raw = raw + + return r +} + +// Request allows to set the request property with the appropriate payload. +func (r *Inference) Request(req *Request) *Inference { + r.req = req + + return r +} + +// HttpRequest returns the http.Request object built from the +// given parameters. +func (r *Inference) HttpRequest(ctx context.Context) (*http.Request, error) { + var path strings.Builder + var method string + var req *http.Request + + var err error + + if len(r.deferred) > 0 { + for _, f := range r.deferred { + deferredErr := f(r.req) + if deferredErr != nil { + return nil, deferredErr + } + } + } + + if r.raw == nil && r.req != nil { + + data, err := json.Marshal(r.req) + + if err != nil { + return nil, fmt.Errorf("could not serialise request for Inference: %w", err) + } + + r.buf.Write(data) + + } + + if r.buf.Len() > 0 { + r.raw = r.buf + } + + r.path.Scheme = "http" + + switch { + case r.paramSet == tasktypeMask|modelidMask: + path.WriteString("/") + path.WriteString("_inference") + path.WriteString("/") + + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "tasktype", r.tasktype) + } + path.WriteString(r.tasktype) + path.WriteString("/") + + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "modelid", r.modelid) + } + path.WriteString(r.modelid) + + method = http.MethodPost + } + + r.path.Path = path.String() + r.path.RawQuery = r.values.Encode() + + if r.path.Path == "" { + return nil, ErrBuildPath + } + + if ctx != nil { + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) + } else { + req, err = http.NewRequest(method, r.path.String(), r.raw) + } + + req.Header = r.headers.Clone() + + if req.Header.Get("Accept") == "" { + req.Header.Set("Accept", "application/vnd.elasticsearch+json;compatible-with=8") + } + + if err != nil { + return req, fmt.Errorf("could not build http.Request: %w", err) + } + + return req, nil +} + +// Perform runs the http.Request through the provided transport and returns an http.Response. +func (r Inference) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "inference.inference") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + + req, err := r.HttpRequest(ctx) + if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "inference.inference") + if reader := instrument.RecordRequestBody(ctx, "inference.inference", r.raw); reader != nil { + req.Body = reader + } + } + res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "inference.inference") + } + if err != nil { + localErr := fmt.Errorf("an error happened during the Inference query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr + } + + return res, nil +} + +// Do runs the request through the transport, handle the response and returns a inference.Response +func (r Inference) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "inference.inference") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + response := NewResponse() + + res, err := r.Perform(ctx) + if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + defer res.Body.Close() + + if res.StatusCode < 299 { + err = json.NewDecoder(res.Body).Decode(response) + if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + return response, nil + } + + errorResponse := types.NewElasticsearchError() + err = json.NewDecoder(res.Body).Decode(errorResponse) + if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if errorResponse.Status == 0 { + errorResponse.Status = res.StatusCode + } + + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } + return nil, errorResponse +} + +// Header set a key, value pair in the Inference headers map. +func (r *Inference) Header(key, value string) *Inference { + r.headers.Set(key, value) + + return r +} + +// TaskType The model task type +// API Name: tasktype +func (r *Inference) _tasktype(tasktype string) *Inference { + r.paramSet |= tasktypeMask + r.tasktype = tasktype + + return r +} + +// ModelId The unique identifier of the inference model. +// API Name: modelid +func (r *Inference) _modelid(modelid string) *Inference { + r.paramSet |= modelidMask + r.modelid = modelid + + return r +} + +// Input Text input to the model. +// Either a string or an array of strings. +// API name: input +func (r *Inference) Input(inputs ...string) *Inference { + r.req.Input = inputs + + return r +} + +// TaskSettings Optional task settings +// API name: task_settings +func (r *Inference) TaskSettings(tasksettings json.RawMessage) *Inference { + r.req.TaskSettings = tasksettings + + return r +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/inference/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/inference/request.go new file mode 100644 index 000000000..06b1f694c --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/inference/request.go @@ -0,0 +1,56 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated from the elasticsearch-specification DO NOT EDIT. +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c + +package inference + +import ( + "encoding/json" + "fmt" +) + +// Request holds the request body struct for the package inference +// +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/inference/inference/InferenceRequest.ts#L25-L53 +type Request struct { + + // Input Text input to the model. + // Either a string or an array of strings. + Input []string `json:"input"` + // TaskSettings Optional task settings + TaskSettings json.RawMessage `json:"task_settings,omitempty"` +} + +// NewRequest returns a Request +func NewRequest() *Request { + r := &Request{} + return r +} + +// FromJSON allows to load an arbitrary json into the request structure +func (r *Request) FromJSON(data string) (*Request, error) { + var req Request + err := json.Unmarshal([]byte(data), &req) + + if err != nil { + return nil, fmt.Errorf("could not deserialise json into Inference request: %w", err) + } + + return &req, nil +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/inference/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/inference/response.go new file mode 100644 index 000000000..da07cbb91 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/inference/response.go @@ -0,0 +1,39 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated from the elasticsearch-specification DO NOT EDIT. +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c + +package inference + +import ( + "github.com/elastic/go-elasticsearch/v8/typedapi/types" +) + +// Response holds the response body struct for the package inference +// +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/inference/inference/InferenceResponse.ts#L22-L24 +type Response struct { + SparseEmbedding []types.SparseEmbeddingResult `json:"sparse_embedding,omitempty"` + TextEmbedding []types.TextEmbeddingResult `json:"text_embedding,omitempty"` +} + +// NewResponse returns a Response +func NewResponse() *Response { + r := &Response{} + return r +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/putmodel/put_model.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/putmodel/put_model.go new file mode 100644 index 000000000..83abcf324 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/putmodel/put_model.go @@ -0,0 +1,350 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated from the elasticsearch-specification DO NOT EDIT. +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c + +// Configure a model for use in the Inference API +package putmodel + +import ( + gobytes "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strings" + + "github.com/elastic/elastic-transport-go/v8/elastictransport" + "github.com/elastic/go-elasticsearch/v8/typedapi/types" +) + +const ( + tasktypeMask = iota + 1 + + modelidMask +) + +// ErrBuildPath is returned in case of missing parameters within the build of the request. +var ErrBuildPath = errors.New("cannot build path, check for missing path parameters") + +type PutModel struct { + transport elastictransport.Interface + + headers http.Header + values url.Values + path url.URL + + raw io.Reader + + req *Request + deferred []func(request *Request) error + buf *gobytes.Buffer + + paramSet int + + tasktype string + modelid string + + spanStarted bool + + instrument elastictransport.Instrumentation +} + +// NewPutModel type alias for index. +type NewPutModel func(tasktype, modelid string) *PutModel + +// NewPutModelFunc returns a new instance of PutModel with the provided transport. +// Used in the index of the library this allows to retrieve every apis in once place. +func NewPutModelFunc(tp elastictransport.Interface) NewPutModel { + return func(tasktype, modelid string) *PutModel { + n := New(tp) + + n._tasktype(tasktype) + + n._modelid(modelid) + + return n + } +} + +// Configure a model for use in the Inference API +// +// https://www.elastic.co/guide/en/elasticsearch/reference/current/put-inference-api.html +func New(tp elastictransport.Interface) *PutModel { + r := &PutModel{ + transport: tp, + values: make(url.Values), + headers: make(http.Header), + + buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + + return r +} + +// Raw takes a json payload as input which is then passed to the http.Request +// If specified Raw takes precedence on Request method. +func (r *PutModel) Raw(raw io.Reader) *PutModel { + r.raw = raw + + return r +} + +// Request allows to set the request property with the appropriate payload. +func (r *PutModel) Request(req *Request) *PutModel { + r.req = req + + return r +} + +// HttpRequest returns the http.Request object built from the +// given parameters. +func (r *PutModel) HttpRequest(ctx context.Context) (*http.Request, error) { + var path strings.Builder + var method string + var req *http.Request + + var err error + + if len(r.deferred) > 0 { + for _, f := range r.deferred { + deferredErr := f(r.req) + if deferredErr != nil { + return nil, deferredErr + } + } + } + + if r.raw == nil && r.req != nil { + + data, err := json.Marshal(r.req) + + if err != nil { + return nil, fmt.Errorf("could not serialise request for PutModel: %w", err) + } + + r.buf.Write(data) + + } + + if r.buf.Len() > 0 { + r.raw = r.buf + } + + r.path.Scheme = "http" + + switch { + case r.paramSet == tasktypeMask|modelidMask: + path.WriteString("/") + path.WriteString("_inference") + path.WriteString("/") + + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "tasktype", r.tasktype) + } + path.WriteString(r.tasktype) + path.WriteString("/") + + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "modelid", r.modelid) + } + path.WriteString(r.modelid) + + method = http.MethodPut + } + + r.path.Path = path.String() + r.path.RawQuery = r.values.Encode() + + if r.path.Path == "" { + return nil, ErrBuildPath + } + + if ctx != nil { + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) + } else { + req, err = http.NewRequest(method, r.path.String(), r.raw) + } + + req.Header = r.headers.Clone() + + if req.Header.Get("Accept") == "" { + req.Header.Set("Accept", "application/vnd.elasticsearch+json;compatible-with=8") + } + + if err != nil { + return req, fmt.Errorf("could not build http.Request: %w", err) + } + + return req, nil +} + +// Perform runs the http.Request through the provided transport and returns an http.Response. +func (r PutModel) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "inference.put_model") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + + req, err := r.HttpRequest(ctx) + if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "inference.put_model") + if reader := instrument.RecordRequestBody(ctx, "inference.put_model", r.raw); reader != nil { + req.Body = reader + } + } + res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "inference.put_model") + } + if err != nil { + localErr := fmt.Errorf("an error happened during the PutModel query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr + } + + return res, nil +} + +// Do runs the request through the transport, handle the response and returns a putmodel.Response +func (r PutModel) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "inference.put_model") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + response := NewResponse() + + res, err := r.Perform(ctx) + if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + defer res.Body.Close() + + if res.StatusCode < 299 { + err = json.NewDecoder(res.Body).Decode(response) + if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + return response, nil + } + + errorResponse := types.NewElasticsearchError() + err = json.NewDecoder(res.Body).Decode(errorResponse) + if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if errorResponse.Status == 0 { + errorResponse.Status = res.StatusCode + } + + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } + return nil, errorResponse +} + +// Header set a key, value pair in the PutModel headers map. +func (r *PutModel) Header(key, value string) *PutModel { + r.headers.Set(key, value) + + return r +} + +// TaskType The model task type +// API Name: tasktype +func (r *PutModel) _tasktype(tasktype string) *PutModel { + r.paramSet |= tasktypeMask + r.tasktype = tasktype + + return r +} + +// ModelId The unique identifier of the inference model. +// API Name: modelid +func (r *PutModel) _modelid(modelid string) *PutModel { + r.paramSet |= modelidMask + r.modelid = modelid + + return r +} + +// Service The service type +// API name: service +func (r *PutModel) Service(service string) *PutModel { + + r.req.Service = service + + return r +} + +// ServiceSettings Settings specific to the service +// API name: service_settings +func (r *PutModel) ServiceSettings(servicesettings json.RawMessage) *PutModel { + r.req.ServiceSettings = servicesettings + + return r +} + +// TaskSettings Task settings specific to the service and model +// API name: task_settings +func (r *PutModel) TaskSettings(tasksettings json.RawMessage) *PutModel { + r.req.TaskSettings = tasksettings + + return r +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/putmodel/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/putmodel/request.go new file mode 100644 index 000000000..485b277cf --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/putmodel/request.go @@ -0,0 +1,30 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated from the elasticsearch-specification DO NOT EDIT. +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c + +package putmodel + +import ( + "github.com/elastic/go-elasticsearch/v8/typedapi/types" +) + +// Request holds the request body struct for the package putmodel +// +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/inference/put_model/PutModelRequest.ts#L25-L44 +type Request = types.ModelConfig diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/putmodel/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/putmodel/response.go new file mode 100644 index 000000000..81b1d2e28 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/inference/putmodel/response.go @@ -0,0 +1,50 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated from the elasticsearch-specification DO NOT EDIT. +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c + +package putmodel + +import ( + "encoding/json" + + "github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/tasktype" +) + +// Response holds the response body struct for the package putmodel +// +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/inference/put_model/PutModelResponse.ts#L22-L24 +type Response struct { + + // ModelId The model Id + ModelId string `json:"model_id"` + // Service The service type + Service string `json:"service"` + // ServiceSettings Settings specific to the service + ServiceSettings json.RawMessage `json:"service_settings"` + // TaskSettings Task settings specific to the service and model + TaskSettings json.RawMessage `json:"task_settings"` + // TaskType The model's task type + TaskType tasktype.TaskType `json:"task_type"` +} + +// NewResponse returns a Response +func NewResponse() *Response { + r := &Response{} + return r +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/deletepipeline/delete_pipeline.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/deletepipeline/delete_pipeline.go index 1c69a4ead..ee0370bc9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/deletepipeline/delete_pipeline.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/deletepipeline/delete_pipeline.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes a pipeline. package deletepipeline import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type DeletePipeline struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeletePipeline type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *DeletePipeline { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *DeletePipeline) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("pipeline") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodDelete @@ -119,9 +130,9 @@ func (r *DeletePipeline) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -138,27 +149,66 @@ func (r *DeletePipeline) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeletePipeline) Perform(ctx context.Context) (*http.Response, error) { +func (r DeletePipeline) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ingest.delete_pipeline") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ingest.delete_pipeline") + if reader := instrument.RecordRequestBody(ctx, "ingest.delete_pipeline", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ingest.delete_pipeline") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeletePipeline query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeletePipeline query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deletepipeline.Response -func (r DeletePipeline) Do(ctx context.Context) (*Response, error) { +func (r DeletePipeline) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ingest.delete_pipeline") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -166,6 +216,9 @@ func (r DeletePipeline) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,6 +228,9 @@ func (r DeletePipeline) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,12 +238,25 @@ func (r DeletePipeline) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeletePipeline) IsSuccess(ctx context.Context) (bool, error) { +func (r DeletePipeline) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ingest.delete_pipeline") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -203,6 +272,14 @@ func (r DeletePipeline) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeletePipeline query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/deletepipeline/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/deletepipeline/response.go index d385e72f6..95f6daee9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/deletepipeline/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/deletepipeline/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deletepipeline // Response holds the response body struct for the package deletepipeline // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/delete_pipeline/DeletePipelineResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/delete_pipeline/DeletePipelineResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/geoipstats/geo_ip_stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/geoipstats/geo_ip_stats.go index 22c396aa1..04c430fb7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/geoipstats/geo_ip_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/geoipstats/geo_ip_stats.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns statistical information about geoip databases package geoipstats import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -47,9 +46,13 @@ type GeoIpStats struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGeoIpStats type alias for index. @@ -73,7 +76,12 @@ func New(tp elastictransport.Interface) *GeoIpStats { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -110,9 +118,9 @@ func (r *GeoIpStats) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -129,27 +137,66 @@ func (r *GeoIpStats) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GeoIpStats) Perform(ctx context.Context) (*http.Response, error) { +func (r GeoIpStats) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ingest.geo_ip_stats") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ingest.geo_ip_stats") + if reader := instrument.RecordRequestBody(ctx, "ingest.geo_ip_stats", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ingest.geo_ip_stats") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GeoIpStats query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GeoIpStats query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a geoipstats.Response -func (r GeoIpStats) Do(ctx context.Context) (*Response, error) { +func (r GeoIpStats) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ingest.geo_ip_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -157,6 +204,9 @@ func (r GeoIpStats) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -166,6 +216,9 @@ func (r GeoIpStats) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -173,12 +226,25 @@ func (r GeoIpStats) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GeoIpStats) IsSuccess(ctx context.Context) (bool, error) { +func (r GeoIpStats) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ingest.geo_ip_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -194,6 +260,14 @@ func (r GeoIpStats) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GeoIpStats query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/geoipstats/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/geoipstats/response.go index 6cb9f97df..cb67e4fbc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/geoipstats/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/geoipstats/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package geoipstats @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package geoipstats // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/geo_ip_stats/IngestGeoIpStatsResponse.ts#L24-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/geo_ip_stats/IngestGeoIpStatsResponse.ts#L24-L31 type Response struct { // Nodes Downloaded GeoIP2 databases for each node. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/getpipeline/get_pipeline.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/getpipeline/get_pipeline.go index 6f15f16f8..d56034d9c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/getpipeline/get_pipeline.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/getpipeline/get_pipeline.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns a pipeline. package getpipeline import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type GetPipeline struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetPipeline type alias for index. @@ -80,7 +83,12 @@ func New(tp elastictransport.Interface) *GetPipeline { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -112,6 +120,9 @@ func (r *GetPipeline) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("pipeline") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodGet @@ -125,9 +136,9 @@ func (r *GetPipeline) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -144,27 +155,66 @@ func (r *GetPipeline) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetPipeline) Perform(ctx context.Context) (*http.Response, error) { +func (r GetPipeline) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ingest.get_pipeline") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ingest.get_pipeline") + if reader := instrument.RecordRequestBody(ctx, "ingest.get_pipeline", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ingest.get_pipeline") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetPipeline query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetPipeline query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getpipeline.Response -func (r GetPipeline) Do(ctx context.Context) (Response, error) { +func (r GetPipeline) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ingest.get_pipeline") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -172,6 +222,9 @@ func (r GetPipeline) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -181,6 +234,9 @@ func (r GetPipeline) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -188,12 +244,25 @@ func (r GetPipeline) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetPipeline) IsSuccess(ctx context.Context) (bool, error) { +func (r GetPipeline) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ingest.get_pipeline") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -209,6 +278,14 @@ func (r GetPipeline) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetPipeline query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/getpipeline/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/getpipeline/response.go index 51d64c1fa..56f32c77e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/getpipeline/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/getpipeline/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getpipeline @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getpipeline // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/get_pipeline/GetPipelineResponse.ts#L23-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/get_pipeline/GetPipelineResponse.ts#L23-L25 type Response map[string]types.IngestPipeline diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/processorgrok/processor_grok.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/processorgrok/processor_grok.go index 966438bbd..b15a923fb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/processorgrok/processor_grok.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/processorgrok/processor_grok.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns a list of the built-in patterns. package processorgrok import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -47,9 +46,13 @@ type ProcessorGrok struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewProcessorGrok type alias for index. @@ -73,7 +76,12 @@ func New(tp elastictransport.Interface) *ProcessorGrok { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -110,9 +118,9 @@ func (r *ProcessorGrok) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -129,27 +137,66 @@ func (r *ProcessorGrok) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ProcessorGrok) Perform(ctx context.Context) (*http.Response, error) { +func (r ProcessorGrok) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ingest.processor_grok") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ingest.processor_grok") + if reader := instrument.RecordRequestBody(ctx, "ingest.processor_grok", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ingest.processor_grok") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ProcessorGrok query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ProcessorGrok query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a processorgrok.Response -func (r ProcessorGrok) Do(ctx context.Context) (*Response, error) { +func (r ProcessorGrok) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ingest.processor_grok") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -157,6 +204,9 @@ func (r ProcessorGrok) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -166,6 +216,9 @@ func (r ProcessorGrok) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -173,12 +226,25 @@ func (r ProcessorGrok) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ProcessorGrok) IsSuccess(ctx context.Context) (bool, error) { +func (r ProcessorGrok) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ingest.processor_grok") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -194,6 +260,14 @@ func (r ProcessorGrok) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ProcessorGrok query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/processorgrok/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/processorgrok/response.go index 989524f07..5c6043699 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/processorgrok/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/processorgrok/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package processorgrok // Response holds the response body struct for the package processorgrok // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/processor_grok/GrokProcessorPatternsResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/processor_grok/GrokProcessorPatternsResponse.ts#L22-L24 type Response struct { Patterns map[string]string `json:"patterns"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/putpipeline/put_pipeline.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/putpipeline/put_pipeline.go index 4ea923d4f..45ad7833f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/putpipeline/put_pipeline.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/putpipeline/put_pipeline.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates or updates a pipeline. package putpipeline @@ -50,15 +50,19 @@ type PutPipeline struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutPipeline type alias for index. @@ -84,11 +88,18 @@ func New(tp elastictransport.Interface) *PutPipeline { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -125,9 +136,7 @@ func (r *PutPipeline) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -139,6 +148,10 @@ func (r *PutPipeline) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -149,6 +162,9 @@ func (r *PutPipeline) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("pipeline") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodPut @@ -162,15 +178,15 @@ func (r *PutPipeline) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -187,27 +203,66 @@ func (r *PutPipeline) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutPipeline) Perform(ctx context.Context) (*http.Response, error) { +func (r PutPipeline) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ingest.put_pipeline") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ingest.put_pipeline") + if reader := instrument.RecordRequestBody(ctx, "ingest.put_pipeline", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ingest.put_pipeline") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutPipeline query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutPipeline query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a putpipeline.Response -func (r PutPipeline) Do(ctx context.Context) (*Response, error) { +func (r PutPipeline) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ingest.put_pipeline") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -215,6 +270,9 @@ func (r PutPipeline) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -224,6 +282,9 @@ func (r PutPipeline) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -231,6 +292,9 @@ func (r PutPipeline) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/putpipeline/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/putpipeline/request.go index be39645ae..46dbd64e5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/putpipeline/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/putpipeline/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putpipeline @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package putpipeline // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/put_pipeline/PutPipelineRequest.ts#L25-L77 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/put_pipeline/PutPipelineRequest.ts#L25-L77 type Request struct { // Description Description of the ingest pipeline. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/putpipeline/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/putpipeline/response.go index bc425cf5f..3a9eaad86 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/putpipeline/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/putpipeline/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putpipeline // Response holds the response body struct for the package putpipeline // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/put_pipeline/PutPipelineResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/put_pipeline/PutPipelineResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/simulate/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/simulate/request.go index d5faf6786..788602e3d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/simulate/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/simulate/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package simulate @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package simulate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/simulate/SimulatePipelineRequest.ts#L25-L57 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/simulate/SimulatePipelineRequest.ts#L25-L57 type Request struct { // Docs Sample documents to test in the pipeline. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/simulate/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/simulate/response.go index d1fd22407..e64618bef 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/simulate/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/simulate/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package simulate @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package simulate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/simulate/SimulatePipelineResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/simulate/SimulatePipelineResponse.ts#L22-L24 type Response struct { Docs []types.PipelineSimulation `json:"docs"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/simulate/simulate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/simulate/simulate.go index 22ecb757f..b0f9703e4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/simulate/simulate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ingest/simulate/simulate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Allows to simulate a pipeline with example documents. package simulate @@ -51,15 +51,19 @@ type Simulate struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewSimulate type alias for index. @@ -83,11 +87,18 @@ func New(tp elastictransport.Interface) *Simulate { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -124,9 +135,7 @@ func (r *Simulate) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -138,6 +147,10 @@ func (r *Simulate) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -157,6 +170,9 @@ func (r *Simulate) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("pipeline") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) path.WriteString("/") path.WriteString("_simulate") @@ -172,15 +188,15 @@ func (r *Simulate) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -197,27 +213,66 @@ func (r *Simulate) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Simulate) Perform(ctx context.Context) (*http.Response, error) { +func (r Simulate) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ingest.simulate") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ingest.simulate") + if reader := instrument.RecordRequestBody(ctx, "ingest.simulate", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ingest.simulate") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Simulate query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Simulate query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a simulate.Response -func (r Simulate) Do(ctx context.Context) (*Response, error) { +func (r Simulate) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ingest.simulate") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -225,6 +280,9 @@ func (r Simulate) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -234,6 +292,9 @@ func (r Simulate) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -241,6 +302,9 @@ func (r Simulate) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/delete/delete.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/delete/delete.go index 3d8449343..519e1deca 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/delete/delete.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/delete/delete.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes licensing information for the cluster package delete import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -47,9 +46,13 @@ type Delete struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDelete type alias for index. @@ -73,7 +76,12 @@ func New(tp elastictransport.Interface) *Delete { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,9 +114,9 @@ func (r *Delete) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -125,27 +133,66 @@ func (r *Delete) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Delete) Perform(ctx context.Context) (*http.Response, error) { +func (r Delete) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "license.delete") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "license.delete") + if reader := instrument.RecordRequestBody(ctx, "license.delete", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "license.delete") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Delete query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Delete query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a delete.Response -func (r Delete) Do(ctx context.Context) (*Response, error) { +func (r Delete) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "license.delete") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -153,6 +200,9 @@ func (r Delete) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -162,6 +212,9 @@ func (r Delete) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -169,12 +222,25 @@ func (r Delete) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Delete) IsSuccess(ctx context.Context) (bool, error) { +func (r Delete) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "license.delete") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -190,6 +256,14 @@ func (r Delete) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Delete query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/delete/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/delete/response.go index 00c8fabdb..586ebf4d3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/delete/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/delete/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package delete // Response holds the response body struct for the package delete // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/license/delete/DeleteLicenseResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/license/delete/DeleteLicenseResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/get/get.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/get/get.go index 3e8a07d41..67b499cd3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/get/get.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/get/get.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves licensing information for the cluster package get import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -48,9 +47,13 @@ type Get struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGet type alias for index. @@ -74,7 +77,12 @@ func New(tp elastictransport.Interface) *Get { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -107,9 +115,9 @@ func (r *Get) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -126,27 +134,66 @@ func (r *Get) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Get) Perform(ctx context.Context) (*http.Response, error) { +func (r Get) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "license.get") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "license.get") + if reader := instrument.RecordRequestBody(ctx, "license.get", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "license.get") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Get query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Get query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a get.Response -func (r Get) Do(ctx context.Context) (*Response, error) { +func (r Get) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "license.get") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -154,6 +201,9 @@ func (r Get) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -163,6 +213,9 @@ func (r Get) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -170,12 +223,25 @@ func (r Get) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Get) IsSuccess(ctx context.Context) (bool, error) { +func (r Get) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "license.get") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -191,6 +257,14 @@ func (r Get) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Get query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/get/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/get/response.go index b5ef53a9e..f0c87c39a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/get/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/get/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package get @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package get // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/license/get/GetLicenseResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/license/get/GetLicenseResponse.ts#L22-L24 type Response struct { License types.LicenseInformation `json:"license"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/getbasicstatus/get_basic_status.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/getbasicstatus/get_basic_status.go index f67e0d633..224d0bd97 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/getbasicstatus/get_basic_status.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/getbasicstatus/get_basic_status.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves information about the status of the basic license. package getbasicstatus import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -47,9 +46,13 @@ type GetBasicStatus struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetBasicStatus type alias for index. @@ -73,7 +76,12 @@ func New(tp elastictransport.Interface) *GetBasicStatus { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,9 +116,9 @@ func (r *GetBasicStatus) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -127,27 +135,66 @@ func (r *GetBasicStatus) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetBasicStatus) Perform(ctx context.Context) (*http.Response, error) { +func (r GetBasicStatus) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "license.get_basic_status") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "license.get_basic_status") + if reader := instrument.RecordRequestBody(ctx, "license.get_basic_status", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "license.get_basic_status") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetBasicStatus query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetBasicStatus query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getbasicstatus.Response -func (r GetBasicStatus) Do(ctx context.Context) (*Response, error) { +func (r GetBasicStatus) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "license.get_basic_status") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -155,6 +202,9 @@ func (r GetBasicStatus) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -164,6 +214,9 @@ func (r GetBasicStatus) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -171,12 +224,25 @@ func (r GetBasicStatus) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetBasicStatus) IsSuccess(ctx context.Context) (bool, error) { +func (r GetBasicStatus) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "license.get_basic_status") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -192,6 +258,14 @@ func (r GetBasicStatus) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetBasicStatus query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/getbasicstatus/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/getbasicstatus/response.go index 8f3637601..1f5a6af0a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/getbasicstatus/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/getbasicstatus/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getbasicstatus // Response holds the response body struct for the package getbasicstatus // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/license/get_basic_status/GetBasicLicenseStatusResponse.ts#L20-L22 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/license/get_basic_status/GetBasicLicenseStatusResponse.ts#L20-L22 type Response struct { EligibleToStartBasic bool `json:"eligible_to_start_basic"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/gettrialstatus/get_trial_status.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/gettrialstatus/get_trial_status.go index b6945ad52..b15111830 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/gettrialstatus/get_trial_status.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/gettrialstatus/get_trial_status.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves information about the status of the trial license. package gettrialstatus import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -47,9 +46,13 @@ type GetTrialStatus struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetTrialStatus type alias for index. @@ -73,7 +76,12 @@ func New(tp elastictransport.Interface) *GetTrialStatus { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,9 +116,9 @@ func (r *GetTrialStatus) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -127,27 +135,66 @@ func (r *GetTrialStatus) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetTrialStatus) Perform(ctx context.Context) (*http.Response, error) { +func (r GetTrialStatus) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "license.get_trial_status") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "license.get_trial_status") + if reader := instrument.RecordRequestBody(ctx, "license.get_trial_status", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "license.get_trial_status") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetTrialStatus query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetTrialStatus query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a gettrialstatus.Response -func (r GetTrialStatus) Do(ctx context.Context) (*Response, error) { +func (r GetTrialStatus) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "license.get_trial_status") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -155,6 +202,9 @@ func (r GetTrialStatus) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -164,6 +214,9 @@ func (r GetTrialStatus) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -171,12 +224,25 @@ func (r GetTrialStatus) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetTrialStatus) IsSuccess(ctx context.Context) (bool, error) { +func (r GetTrialStatus) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "license.get_trial_status") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -192,6 +258,14 @@ func (r GetTrialStatus) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetTrialStatus query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/gettrialstatus/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/gettrialstatus/response.go index 96b22f1ad..7e897afce 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/gettrialstatus/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/gettrialstatus/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package gettrialstatus // Response holds the response body struct for the package gettrialstatus // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/license/get_trial_status/GetTrialLicenseStatusResponse.ts#L20-L22 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/license/get_trial_status/GetTrialLicenseStatusResponse.ts#L20-L22 type Response struct { EligibleToStartTrial bool `json:"eligible_to_start_trial"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/post/post.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/post/post.go index 7c8acac4c..67208521e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/post/post.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/post/post.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Updates the license for the cluster. package post @@ -47,13 +47,17 @@ type Post struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPost type alias for index. @@ -77,11 +81,18 @@ func New(tp elastictransport.Interface) *Post { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -118,9 +129,7 @@ func (r *Post) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -132,6 +141,10 @@ func (r *Post) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -150,15 +163,15 @@ func (r *Post) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -175,27 +188,66 @@ func (r *Post) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Post) Perform(ctx context.Context) (*http.Response, error) { +func (r Post) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "license.post") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "license.post") + if reader := instrument.RecordRequestBody(ctx, "license.post", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "license.post") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Post query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Post query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a post.Response -func (r Post) Do(ctx context.Context) (*Response, error) { +func (r Post) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "license.post") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -203,6 +255,9 @@ func (r Post) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -212,6 +267,9 @@ func (r Post) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -219,6 +277,9 @@ func (r Post) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/post/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/post/request.go index fafd7ac0e..efa4b78eb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/post/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/post/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package post @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package post // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/license/post/PostLicenseRequest.ts#L23-L43 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/license/post/PostLicenseRequest.ts#L23-L43 type Request struct { License *types.License `json:"license,omitempty"` // Licenses A sequence of one or more JSON documents containing the license information. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/post/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/post/response.go index 4528328be..a2294b181 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/post/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/post/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package post @@ -27,7 +27,7 @@ import ( // Response holds the response body struct for the package post // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/license/post/PostLicenseResponse.ts#L23-L29 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/license/post/PostLicenseResponse.ts#L23-L29 type Response struct { Acknowledge *types.Acknowledgement `json:"acknowledge,omitempty"` Acknowledged bool `json:"acknowledged"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/poststartbasic/post_start_basic.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/poststartbasic/post_start_basic.go index 3669398b0..b79159f12 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/poststartbasic/post_start_basic.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/poststartbasic/post_start_basic.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Starts an indefinite basic license. package poststartbasic import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -48,9 +47,13 @@ type PostStartBasic struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPostStartBasic type alias for index. @@ -74,7 +77,12 @@ func New(tp elastictransport.Interface) *PostStartBasic { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -109,9 +117,9 @@ func (r *PostStartBasic) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -128,27 +136,66 @@ func (r *PostStartBasic) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PostStartBasic) Perform(ctx context.Context) (*http.Response, error) { +func (r PostStartBasic) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "license.post_start_basic") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "license.post_start_basic") + if reader := instrument.RecordRequestBody(ctx, "license.post_start_basic", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "license.post_start_basic") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PostStartBasic query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PostStartBasic query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a poststartbasic.Response -func (r PostStartBasic) Do(ctx context.Context) (*Response, error) { +func (r PostStartBasic) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "license.post_start_basic") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -156,6 +203,9 @@ func (r PostStartBasic) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -165,6 +215,9 @@ func (r PostStartBasic) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -172,12 +225,25 @@ func (r PostStartBasic) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r PostStartBasic) IsSuccess(ctx context.Context) (bool, error) { +func (r PostStartBasic) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "license.post_start_basic") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -193,6 +259,14 @@ func (r PostStartBasic) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the PostStartBasic query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/poststartbasic/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/poststartbasic/response.go index 985e37bd3..9db62905f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/poststartbasic/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/poststartbasic/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package poststartbasic @@ -32,7 +32,7 @@ import ( // Response holds the response body struct for the package poststartbasic // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/license/post_start_basic/StartBasicLicenseResponse.ts#L23-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/license/post_start_basic/StartBasicLicenseResponse.ts#L23-L31 type Response struct { Acknowledge map[string][]string `json:"acknowledge,omitempty"` Acknowledged bool `json:"acknowledged"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/poststarttrial/post_start_trial.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/poststarttrial/post_start_trial.go index 2ec72df19..687650941 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/poststarttrial/post_start_trial.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/poststarttrial/post_start_trial.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // starts a limited time trial license. package poststarttrial import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -48,9 +47,13 @@ type PostStartTrial struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPostStartTrial type alias for index. @@ -74,7 +77,12 @@ func New(tp elastictransport.Interface) *PostStartTrial { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -109,9 +117,9 @@ func (r *PostStartTrial) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -128,27 +136,66 @@ func (r *PostStartTrial) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PostStartTrial) Perform(ctx context.Context) (*http.Response, error) { +func (r PostStartTrial) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "license.post_start_trial") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "license.post_start_trial") + if reader := instrument.RecordRequestBody(ctx, "license.post_start_trial", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "license.post_start_trial") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PostStartTrial query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PostStartTrial query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a poststarttrial.Response -func (r PostStartTrial) Do(ctx context.Context) (*Response, error) { +func (r PostStartTrial) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "license.post_start_trial") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -156,6 +203,9 @@ func (r PostStartTrial) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -165,6 +215,9 @@ func (r PostStartTrial) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -172,12 +225,25 @@ func (r PostStartTrial) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r PostStartTrial) IsSuccess(ctx context.Context) (bool, error) { +func (r PostStartTrial) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "license.post_start_trial") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -193,6 +259,14 @@ func (r PostStartTrial) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the PostStartTrial query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/poststarttrial/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/poststarttrial/response.go index 7ae51317f..b7251e049 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/poststarttrial/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/license/poststarttrial/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package poststarttrial @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package poststarttrial // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/license/post_start_trial/StartTrialLicenseResponse.ts#L22-L29 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/license/post_start_trial/StartTrialLicenseResponse.ts#L22-L29 type Response struct { Acknowledged bool `json:"acknowledged"` ErrorMessage *string `json:"error_message,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/logstash/deletepipeline/delete_pipeline.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/logstash/deletepipeline/delete_pipeline.go index 2ab11a3b7..7880e2363 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/logstash/deletepipeline/delete_pipeline.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/logstash/deletepipeline/delete_pipeline.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes Logstash Pipelines used by Central Management package deletepipeline import ( - gobytes "bytes" "context" "errors" "fmt" @@ -49,11 +48,15 @@ type DeletePipeline struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeletePipeline type alias for index. @@ -79,7 +82,12 @@ func New(tp elastictransport.Interface) *DeletePipeline { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *DeletePipeline) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("pipeline") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodDelete @@ -117,9 +128,9 @@ func (r *DeletePipeline) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -136,15 +147,42 @@ func (r *DeletePipeline) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeletePipeline) Perform(ctx context.Context) (*http.Response, error) { +func (r DeletePipeline) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "logstash.delete_pipeline") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "logstash.delete_pipeline") + if reader := instrument.RecordRequestBody(ctx, "logstash.delete_pipeline", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "logstash.delete_pipeline") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeletePipeline query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeletePipeline query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil @@ -157,7 +195,17 @@ func (r DeletePipeline) Do(ctx context.Context) (bool, error) { // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeletePipeline) IsSuccess(ctx context.Context) (bool, error) { +func (r DeletePipeline) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "logstash.delete_pipeline") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -173,6 +221,14 @@ func (r DeletePipeline) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeletePipeline query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/logstash/getpipeline/get_pipeline.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/logstash/getpipeline/get_pipeline.go index 9bc758801..3bce809aa 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/logstash/getpipeline/get_pipeline.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/logstash/getpipeline/get_pipeline.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves Logstash Pipelines used by Central Management package getpipeline import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,24 +50,26 @@ type GetPipeline struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetPipeline type alias for index. -type NewGetPipeline func(id string) *GetPipeline +type NewGetPipeline func() *GetPipeline // NewGetPipelineFunc returns a new instance of GetPipeline with the provided transport. // Used in the index of the library this allows to retrieve every apis in once place. func NewGetPipelineFunc(tp elastictransport.Interface) NewGetPipeline { - return func(id string) *GetPipeline { + return func() *GetPipeline { n := New(tp) - n._id(id) - return n } } @@ -81,7 +82,12 @@ func New(tp elastictransport.Interface) *GetPipeline { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -113,6 +119,9 @@ func (r *GetPipeline) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("pipeline") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodGet @@ -126,9 +135,9 @@ func (r *GetPipeline) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -145,27 +154,66 @@ func (r *GetPipeline) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetPipeline) Perform(ctx context.Context) (*http.Response, error) { +func (r GetPipeline) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "logstash.get_pipeline") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "logstash.get_pipeline") + if reader := instrument.RecordRequestBody(ctx, "logstash.get_pipeline", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "logstash.get_pipeline") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetPipeline query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetPipeline query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getpipeline.Response -func (r GetPipeline) Do(ctx context.Context) (Response, error) { +func (r GetPipeline) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "logstash.get_pipeline") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -173,6 +221,9 @@ func (r GetPipeline) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,6 +233,9 @@ func (r GetPipeline) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -189,12 +243,25 @@ func (r GetPipeline) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetPipeline) IsSuccess(ctx context.Context) (bool, error) { +func (r GetPipeline) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "logstash.get_pipeline") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -210,6 +277,14 @@ func (r GetPipeline) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetPipeline query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } @@ -222,7 +297,7 @@ func (r *GetPipeline) Header(key, value string) *GetPipeline { // Id Comma-separated list of pipeline identifiers. // API Name: id -func (r *GetPipeline) _id(id string) *GetPipeline { +func (r *GetPipeline) Id(id string) *GetPipeline { r.paramSet |= idMask r.id = id diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/logstash/getpipeline/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/logstash/getpipeline/response.go index 808c290e5..26d558010 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/logstash/getpipeline/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/logstash/getpipeline/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getpipeline @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getpipeline // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/logstash/get_pipeline/LogstashGetPipelineResponse.ts#L24-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/logstash/get_pipeline/LogstashGetPipelineResponse.ts#L24-L26 type Response map[string]types.LogstashPipeline diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/logstash/putpipeline/put_pipeline.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/logstash/putpipeline/put_pipeline.go index 19b7ecdc6..095e1b814 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/logstash/putpipeline/put_pipeline.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/logstash/putpipeline/put_pipeline.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Adds and updates Logstash Pipelines used for Central Management package putpipeline @@ -50,15 +50,19 @@ type PutPipeline struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutPipeline type alias for index. @@ -84,7 +88,14 @@ func New(tp elastictransport.Interface) *PutPipeline { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -123,9 +134,7 @@ func (r *PutPipeline) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -137,6 +146,10 @@ func (r *PutPipeline) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -147,6 +160,9 @@ func (r *PutPipeline) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("pipeline") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodPut @@ -160,15 +176,15 @@ func (r *PutPipeline) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -185,15 +201,42 @@ func (r *PutPipeline) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutPipeline) Perform(ctx context.Context) (*http.Response, error) { +func (r PutPipeline) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "logstash.put_pipeline") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "logstash.put_pipeline") + if reader := instrument.RecordRequestBody(ctx, "logstash.put_pipeline", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "logstash.put_pipeline") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutPipeline query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutPipeline query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/logstash/putpipeline/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/logstash/putpipeline/request.go index 9a4d35145..242624e33 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/logstash/putpipeline/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/logstash/putpipeline/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putpipeline @@ -26,5 +26,5 @@ import ( // Request holds the request body struct for the package putpipeline // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/logstash/put_pipeline/LogstashPutPipelineRequest.ts#L24-L39 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/logstash/put_pipeline/LogstashPutPipelineRequest.ts#L24-L39 type Request = types.LogstashPipeline diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/migration/deprecations/deprecations.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/migration/deprecations/deprecations.go index 10a8cdbfb..f4110a0a6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/migration/deprecations/deprecations.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/migration/deprecations/deprecations.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves information about different cluster, node, and index level settings // that use deprecated features that will be removed or changed in the next @@ -24,7 +24,6 @@ package deprecations import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,11 +52,15 @@ type Deprecations struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeprecations type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *Deprecations { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -111,6 +119,9 @@ func (r *Deprecations) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_migration") @@ -128,9 +139,9 @@ func (r *Deprecations) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -147,27 +158,66 @@ func (r *Deprecations) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Deprecations) Perform(ctx context.Context) (*http.Response, error) { +func (r Deprecations) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "migration.deprecations") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "migration.deprecations") + if reader := instrument.RecordRequestBody(ctx, "migration.deprecations", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "migration.deprecations") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Deprecations query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Deprecations query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deprecations.Response -func (r Deprecations) Do(ctx context.Context) (*Response, error) { +func (r Deprecations) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "migration.deprecations") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -175,6 +225,9 @@ func (r Deprecations) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,6 +237,9 @@ func (r Deprecations) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -191,12 +247,25 @@ func (r Deprecations) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Deprecations) IsSuccess(ctx context.Context) (bool, error) { +func (r Deprecations) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "migration.deprecations") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -212,6 +281,14 @@ func (r Deprecations) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Deprecations query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/migration/deprecations/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/migration/deprecations/response.go index e4edc4131..e3d5338e2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/migration/deprecations/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/migration/deprecations/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deprecations @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package deprecations // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/migration/deprecations/DeprecationInfoResponse.ts#L23-L30 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/migration/deprecations/DeprecationInfoResponse.ts#L23-L30 type Response struct { ClusterSettings []types.Deprecation `json:"cluster_settings"` IndexSettings map[string][]types.Deprecation `json:"index_settings"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/migration/getfeatureupgradestatus/get_feature_upgrade_status.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/migration/getfeatureupgradestatus/get_feature_upgrade_status.go index 2f21b17af..c80cb8249 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/migration/getfeatureupgradestatus/get_feature_upgrade_status.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/migration/getfeatureupgradestatus/get_feature_upgrade_status.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Find out whether system features need to be upgraded or not package getfeatureupgradestatus import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -47,9 +46,13 @@ type GetFeatureUpgradeStatus struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetFeatureUpgradeStatus type alias for index. @@ -73,7 +76,12 @@ func New(tp elastictransport.Interface) *GetFeatureUpgradeStatus { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,9 +116,9 @@ func (r *GetFeatureUpgradeStatus) HttpRequest(ctx context.Context) (*http.Reques } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -127,27 +135,66 @@ func (r *GetFeatureUpgradeStatus) HttpRequest(ctx context.Context) (*http.Reques } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetFeatureUpgradeStatus) Perform(ctx context.Context) (*http.Response, error) { +func (r GetFeatureUpgradeStatus) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "migration.get_feature_upgrade_status") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "migration.get_feature_upgrade_status") + if reader := instrument.RecordRequestBody(ctx, "migration.get_feature_upgrade_status", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "migration.get_feature_upgrade_status") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetFeatureUpgradeStatus query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetFeatureUpgradeStatus query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getfeatureupgradestatus.Response -func (r GetFeatureUpgradeStatus) Do(ctx context.Context) (*Response, error) { +func (r GetFeatureUpgradeStatus) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "migration.get_feature_upgrade_status") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -155,6 +202,9 @@ func (r GetFeatureUpgradeStatus) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -164,6 +214,9 @@ func (r GetFeatureUpgradeStatus) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -171,12 +224,25 @@ func (r GetFeatureUpgradeStatus) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetFeatureUpgradeStatus) IsSuccess(ctx context.Context) (bool, error) { +func (r GetFeatureUpgradeStatus) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "migration.get_feature_upgrade_status") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -192,6 +258,14 @@ func (r GetFeatureUpgradeStatus) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetFeatureUpgradeStatus query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/migration/getfeatureupgradestatus/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/migration/getfeatureupgradestatus/response.go index 8c8e09d24..f2cd6ef97 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/migration/getfeatureupgradestatus/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/migration/getfeatureupgradestatus/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getfeatureupgradestatus @@ -27,7 +27,7 @@ import ( // Response holds the response body struct for the package getfeatureupgradestatus // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/migration/get_feature_upgrade_status/GetFeatureUpgradeStatusResponse.ts#L23-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/migration/get_feature_upgrade_status/GetFeatureUpgradeStatusResponse.ts#L23-L28 type Response struct { Features []types.GetMigrationFeature `json:"features"` MigrationStatus migrationstatus.MigrationStatus `json:"migration_status"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/migration/postfeatureupgrade/post_feature_upgrade.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/migration/postfeatureupgrade/post_feature_upgrade.go index 1b9fa7591..dce12d205 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/migration/postfeatureupgrade/post_feature_upgrade.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/migration/postfeatureupgrade/post_feature_upgrade.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Begin upgrades for system features package postfeatureupgrade import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -47,9 +46,13 @@ type PostFeatureUpgrade struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPostFeatureUpgrade type alias for index. @@ -73,7 +76,12 @@ func New(tp elastictransport.Interface) *PostFeatureUpgrade { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,9 +116,9 @@ func (r *PostFeatureUpgrade) HttpRequest(ctx context.Context) (*http.Request, er } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -127,27 +135,66 @@ func (r *PostFeatureUpgrade) HttpRequest(ctx context.Context) (*http.Request, er } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PostFeatureUpgrade) Perform(ctx context.Context) (*http.Response, error) { +func (r PostFeatureUpgrade) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "migration.post_feature_upgrade") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "migration.post_feature_upgrade") + if reader := instrument.RecordRequestBody(ctx, "migration.post_feature_upgrade", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "migration.post_feature_upgrade") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PostFeatureUpgrade query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PostFeatureUpgrade query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a postfeatureupgrade.Response -func (r PostFeatureUpgrade) Do(ctx context.Context) (*Response, error) { +func (r PostFeatureUpgrade) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "migration.post_feature_upgrade") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -155,6 +202,9 @@ func (r PostFeatureUpgrade) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -164,6 +214,9 @@ func (r PostFeatureUpgrade) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -171,12 +224,25 @@ func (r PostFeatureUpgrade) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r PostFeatureUpgrade) IsSuccess(ctx context.Context) (bool, error) { +func (r PostFeatureUpgrade) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "migration.post_feature_upgrade") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -192,6 +258,14 @@ func (r PostFeatureUpgrade) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the PostFeatureUpgrade query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/migration/postfeatureupgrade/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/migration/postfeatureupgrade/response.go index d4a7fafb4..075d60a89 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/migration/postfeatureupgrade/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/migration/postfeatureupgrade/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package postfeatureupgrade @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package postfeatureupgrade // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/migration/post_feature_upgrade/PostFeatureUpgradeResponse.ts#L20-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/migration/post_feature_upgrade/PostFeatureUpgradeResponse.ts#L20-L25 type Response struct { Accepted bool `json:"accepted"` Features []types.PostMigrationFeature `json:"features"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/cleartrainedmodeldeploymentcache/clear_trained_model_deployment_cache.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/cleartrainedmodeldeploymentcache/clear_trained_model_deployment_cache.go index c978af6b3..6de1470ce 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/cleartrainedmodeldeploymentcache/clear_trained_model_deployment_cache.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/cleartrainedmodeldeploymentcache/clear_trained_model_deployment_cache.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Clear the cached results from a trained model deployment package cleartrainedmodeldeploymentcache import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type ClearTrainedModelDeploymentCache struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int modelid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewClearTrainedModelDeploymentCache type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *ClearTrainedModelDeploymentCache { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *ClearTrainedModelDeploymentCache) HttpRequest(ctx context.Context) (*ht path.WriteString("trained_models") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "modelid", r.modelid) + } path.WriteString(r.modelid) path.WriteString("/") path.WriteString("deployment") @@ -125,15 +136,15 @@ func (r *ClearTrainedModelDeploymentCache) HttpRequest(ctx context.Context) (*ht } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -150,27 +161,66 @@ func (r *ClearTrainedModelDeploymentCache) HttpRequest(ctx context.Context) (*ht } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ClearTrainedModelDeploymentCache) Perform(ctx context.Context) (*http.Response, error) { +func (r ClearTrainedModelDeploymentCache) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.clear_trained_model_deployment_cache") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.clear_trained_model_deployment_cache") + if reader := instrument.RecordRequestBody(ctx, "ml.clear_trained_model_deployment_cache", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.clear_trained_model_deployment_cache") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ClearTrainedModelDeploymentCache query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ClearTrainedModelDeploymentCache query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a cleartrainedmodeldeploymentcache.Response -func (r ClearTrainedModelDeploymentCache) Do(ctx context.Context) (*Response, error) { +func (r ClearTrainedModelDeploymentCache) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.clear_trained_model_deployment_cache") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -178,6 +228,9 @@ func (r ClearTrainedModelDeploymentCache) Do(ctx context.Context) (*Response, er if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -187,6 +240,9 @@ func (r ClearTrainedModelDeploymentCache) Do(ctx context.Context) (*Response, er errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -194,12 +250,25 @@ func (r ClearTrainedModelDeploymentCache) Do(ctx context.Context) (*Response, er errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ClearTrainedModelDeploymentCache) IsSuccess(ctx context.Context) (bool, error) { +func (r ClearTrainedModelDeploymentCache) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.clear_trained_model_deployment_cache") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -215,6 +284,14 @@ func (r ClearTrainedModelDeploymentCache) IsSuccess(ctx context.Context) (bool, return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ClearTrainedModelDeploymentCache query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/cleartrainedmodeldeploymentcache/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/cleartrainedmodeldeploymentcache/response.go index abc47a45c..013d85724 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/cleartrainedmodeldeploymentcache/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/cleartrainedmodeldeploymentcache/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package cleartrainedmodeldeploymentcache // Response holds the response body struct for the package cleartrainedmodeldeploymentcache // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/clear_trained_model_deployment_cache/MlClearTrainedModelDeploymentCacheResponse.ts#L20-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/clear_trained_model_deployment_cache/MlClearTrainedModelDeploymentCacheResponse.ts#L20-L24 type Response struct { Cleared bool `json:"cleared"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/closejob/close_job.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/closejob/close_job.go index 1bcaae1b5..26b2cbe2d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/closejob/close_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/closejob/close_job.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Closes one or more anomaly detection jobs. A job can be opened and closed // multiple times throughout its lifecycle. @@ -51,15 +51,19 @@ type CloseJob struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int jobid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewCloseJob type alias for index. @@ -86,11 +90,18 @@ func New(tp elastictransport.Interface) *CloseJob { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -127,9 +138,7 @@ func (r *CloseJob) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -141,6 +150,10 @@ func (r *CloseJob) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -151,6 +164,9 @@ func (r *CloseJob) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("anomaly_detectors") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "jobid", r.jobid) + } path.WriteString(r.jobid) path.WriteString("/") path.WriteString("_close") @@ -166,15 +182,15 @@ func (r *CloseJob) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -191,27 +207,66 @@ func (r *CloseJob) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r CloseJob) Perform(ctx context.Context) (*http.Response, error) { +func (r CloseJob) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.close_job") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.close_job") + if reader := instrument.RecordRequestBody(ctx, "ml.close_job", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.close_job") + } if err != nil { - return nil, fmt.Errorf("an error happened during the CloseJob query execution: %w", err) + localErr := fmt.Errorf("an error happened during the CloseJob query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a closejob.Response -func (r CloseJob) Do(ctx context.Context) (*Response, error) { +func (r CloseJob) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.close_job") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -219,6 +274,9 @@ func (r CloseJob) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -228,6 +286,9 @@ func (r CloseJob) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -235,6 +296,9 @@ func (r CloseJob) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/closejob/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/closejob/request.go index f77eb713f..d79924c13 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/closejob/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/closejob/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package closejob @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package closejob // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/close_job/MlCloseJobRequest.ts#L24-L77 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/close_job/MlCloseJobRequest.ts#L24-L77 type Request struct { // AllowNoMatch Refer to the description for the `allow_no_match` query parameter. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/closejob/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/closejob/response.go index bcede98dc..7167e2958 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/closejob/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/closejob/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package closejob // Response holds the response body struct for the package closejob // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/close_job/MlCloseJobResponse.ts#L20-L22 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/close_job/MlCloseJobResponse.ts#L20-L22 type Response struct { Closed bool `json:"closed"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletecalendar/delete_calendar.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletecalendar/delete_calendar.go index e75e809d6..c71ceb7a7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletecalendar/delete_calendar.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletecalendar/delete_calendar.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes a calendar. package deletecalendar import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type DeleteCalendar struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int calendarid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteCalendar type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *DeleteCalendar { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *DeleteCalendar) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("calendars") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "calendarid", r.calendarid) + } path.WriteString(r.calendarid) method = http.MethodDelete @@ -119,9 +130,9 @@ func (r *DeleteCalendar) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -138,27 +149,66 @@ func (r *DeleteCalendar) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteCalendar) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteCalendar) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.delete_calendar") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.delete_calendar") + if reader := instrument.RecordRequestBody(ctx, "ml.delete_calendar", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.delete_calendar") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteCalendar query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteCalendar query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deletecalendar.Response -func (r DeleteCalendar) Do(ctx context.Context) (*Response, error) { +func (r DeleteCalendar) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_calendar") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -166,6 +216,9 @@ func (r DeleteCalendar) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,6 +228,9 @@ func (r DeleteCalendar) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,12 +238,25 @@ func (r DeleteCalendar) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteCalendar) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteCalendar) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_calendar") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -203,6 +272,14 @@ func (r DeleteCalendar) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteCalendar query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletecalendar/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletecalendar/response.go index 3ca62514e..68992298c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletecalendar/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletecalendar/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deletecalendar // Response holds the response body struct for the package deletecalendar // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/delete_calendar/MlDeleteCalendarResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/delete_calendar/MlDeleteCalendarResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletecalendarevent/delete_calendar_event.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletecalendarevent/delete_calendar_event.go index c039e0b6a..2dae5c4fe 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletecalendarevent/delete_calendar_event.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletecalendarevent/delete_calendar_event.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes scheduled events from a calendar. package deletecalendarevent import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,12 +52,16 @@ type DeleteCalendarEvent struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int calendarid string eventid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteCalendarEvent type alias for index. @@ -86,7 +89,12 @@ func New(tp elastictransport.Interface) *DeleteCalendarEvent { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -111,11 +119,17 @@ func (r *DeleteCalendarEvent) HttpRequest(ctx context.Context) (*http.Request, e path.WriteString("calendars") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "calendarid", r.calendarid) + } path.WriteString(r.calendarid) path.WriteString("/") path.WriteString("events") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "eventid", r.eventid) + } path.WriteString(r.eventid) method = http.MethodDelete @@ -129,9 +143,9 @@ func (r *DeleteCalendarEvent) HttpRequest(ctx context.Context) (*http.Request, e } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -148,27 +162,66 @@ func (r *DeleteCalendarEvent) HttpRequest(ctx context.Context) (*http.Request, e } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteCalendarEvent) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteCalendarEvent) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.delete_calendar_event") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.delete_calendar_event") + if reader := instrument.RecordRequestBody(ctx, "ml.delete_calendar_event", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.delete_calendar_event") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteCalendarEvent query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteCalendarEvent query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deletecalendarevent.Response -func (r DeleteCalendarEvent) Do(ctx context.Context) (*Response, error) { +func (r DeleteCalendarEvent) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_calendar_event") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -176,6 +229,9 @@ func (r DeleteCalendarEvent) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -185,6 +241,9 @@ func (r DeleteCalendarEvent) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -192,12 +251,25 @@ func (r DeleteCalendarEvent) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteCalendarEvent) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteCalendarEvent) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_calendar_event") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -213,6 +285,14 @@ func (r DeleteCalendarEvent) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteCalendarEvent query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletecalendarevent/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletecalendarevent/response.go index 0c375f089..ec90c3036 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletecalendarevent/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletecalendarevent/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deletecalendarevent // Response holds the response body struct for the package deletecalendarevent // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/delete_calendar_event/MlDeleteCalendarEventResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/delete_calendar_event/MlDeleteCalendarEventResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletecalendarjob/delete_calendar_job.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletecalendarjob/delete_calendar_job.go index 11d2dfa09..0aff6bf06 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletecalendarjob/delete_calendar_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletecalendarjob/delete_calendar_job.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes anomaly detection jobs from a calendar. package deletecalendarjob import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,12 +52,16 @@ type DeleteCalendarJob struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int calendarid string jobid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteCalendarJob type alias for index. @@ -86,7 +89,12 @@ func New(tp elastictransport.Interface) *DeleteCalendarJob { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -111,11 +119,17 @@ func (r *DeleteCalendarJob) HttpRequest(ctx context.Context) (*http.Request, err path.WriteString("calendars") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "calendarid", r.calendarid) + } path.WriteString(r.calendarid) path.WriteString("/") path.WriteString("jobs") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "jobid", r.jobid) + } path.WriteString(r.jobid) method = http.MethodDelete @@ -129,9 +143,9 @@ func (r *DeleteCalendarJob) HttpRequest(ctx context.Context) (*http.Request, err } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -148,27 +162,66 @@ func (r *DeleteCalendarJob) HttpRequest(ctx context.Context) (*http.Request, err } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteCalendarJob) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteCalendarJob) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.delete_calendar_job") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.delete_calendar_job") + if reader := instrument.RecordRequestBody(ctx, "ml.delete_calendar_job", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.delete_calendar_job") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteCalendarJob query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteCalendarJob query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deletecalendarjob.Response -func (r DeleteCalendarJob) Do(ctx context.Context) (*Response, error) { +func (r DeleteCalendarJob) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_calendar_job") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -176,6 +229,9 @@ func (r DeleteCalendarJob) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -185,6 +241,9 @@ func (r DeleteCalendarJob) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -192,12 +251,25 @@ func (r DeleteCalendarJob) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteCalendarJob) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteCalendarJob) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_calendar_job") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -213,6 +285,14 @@ func (r DeleteCalendarJob) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteCalendarJob query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletecalendarjob/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletecalendarjob/response.go index 5b33be224..15bf53157 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletecalendarjob/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletecalendarjob/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deletecalendarjob @@ -30,7 +30,7 @@ import ( // Response holds the response body struct for the package deletecalendarjob // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/delete_calendar_job/MlDeleteCalendarJobResponse.ts#L22-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/delete_calendar_job/MlDeleteCalendarJobResponse.ts#L22-L31 type Response struct { // CalendarId A string that uniquely identifies a calendar. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletedatafeed/delete_datafeed.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletedatafeed/delete_datafeed.go index 92d3f1ee4..693fe9f93 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletedatafeed/delete_datafeed.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletedatafeed/delete_datafeed.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes an existing datafeed. package deletedatafeed import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type DeleteDatafeed struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int datafeedid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteDatafeed type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *DeleteDatafeed { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -107,6 +115,9 @@ func (r *DeleteDatafeed) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("datafeeds") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "datafeedid", r.datafeedid) + } path.WriteString(r.datafeedid) method = http.MethodDelete @@ -120,9 +131,9 @@ func (r *DeleteDatafeed) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -139,27 +150,66 @@ func (r *DeleteDatafeed) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteDatafeed) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteDatafeed) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.delete_datafeed") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.delete_datafeed") + if reader := instrument.RecordRequestBody(ctx, "ml.delete_datafeed", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.delete_datafeed") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteDatafeed query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteDatafeed query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deletedatafeed.Response -func (r DeleteDatafeed) Do(ctx context.Context) (*Response, error) { +func (r DeleteDatafeed) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_datafeed") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -167,6 +217,9 @@ func (r DeleteDatafeed) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -176,6 +229,9 @@ func (r DeleteDatafeed) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -183,12 +239,25 @@ func (r DeleteDatafeed) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteDatafeed) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteDatafeed) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_datafeed") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -204,6 +273,14 @@ func (r DeleteDatafeed) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteDatafeed query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletedatafeed/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletedatafeed/response.go index 027fb2edc..af3b506e7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletedatafeed/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletedatafeed/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deletedatafeed // Response holds the response body struct for the package deletedatafeed // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/delete_datafeed/MlDeleteDatafeedResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/delete_datafeed/MlDeleteDatafeedResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletedataframeanalytics/delete_data_frame_analytics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletedataframeanalytics/delete_data_frame_analytics.go index 736b331c3..98860bb5e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletedataframeanalytics/delete_data_frame_analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletedataframeanalytics/delete_data_frame_analytics.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes an existing data frame analytics job. package deletedataframeanalytics import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type DeleteDataFrameAnalytics struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteDataFrameAnalytics type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *DeleteDataFrameAnalytics { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -109,6 +117,9 @@ func (r *DeleteDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Reque path.WriteString("analytics") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodDelete @@ -122,9 +133,9 @@ func (r *DeleteDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Reque } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -141,27 +152,66 @@ func (r *DeleteDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Reque } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteDataFrameAnalytics) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteDataFrameAnalytics) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.delete_data_frame_analytics") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.delete_data_frame_analytics") + if reader := instrument.RecordRequestBody(ctx, "ml.delete_data_frame_analytics", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.delete_data_frame_analytics") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteDataFrameAnalytics query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteDataFrameAnalytics query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deletedataframeanalytics.Response -func (r DeleteDataFrameAnalytics) Do(ctx context.Context) (*Response, error) { +func (r DeleteDataFrameAnalytics) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_data_frame_analytics") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -169,6 +219,9 @@ func (r DeleteDataFrameAnalytics) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -178,6 +231,9 @@ func (r DeleteDataFrameAnalytics) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -185,12 +241,25 @@ func (r DeleteDataFrameAnalytics) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteDataFrameAnalytics) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteDataFrameAnalytics) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_data_frame_analytics") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -206,6 +275,14 @@ func (r DeleteDataFrameAnalytics) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteDataFrameAnalytics query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletedataframeanalytics/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletedataframeanalytics/response.go index e22572e9d..e7b260b53 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletedataframeanalytics/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletedataframeanalytics/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deletedataframeanalytics // Response holds the response body struct for the package deletedataframeanalytics // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/delete_data_frame_analytics/MlDeleteDataFrameAnalyticsResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/delete_data_frame_analytics/MlDeleteDataFrameAnalyticsResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deleteexpireddata/delete_expired_data.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deleteexpireddata/delete_expired_data.go index dbf4f5285..32292d559 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deleteexpireddata/delete_expired_data.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deleteexpireddata/delete_expired_data.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes expired and unused machine learning data. package deleteexpireddata @@ -50,15 +50,19 @@ type DeleteExpiredData struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int jobid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteExpiredData type alias for index. @@ -82,11 +86,18 @@ func New(tp elastictransport.Interface) *DeleteExpiredData { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -123,9 +134,7 @@ func (r *DeleteExpiredData) HttpRequest(ctx context.Context) (*http.Request, err } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -137,6 +146,10 @@ func (r *DeleteExpiredData) HttpRequest(ctx context.Context) (*http.Request, err } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -147,6 +160,9 @@ func (r *DeleteExpiredData) HttpRequest(ctx context.Context) (*http.Request, err path.WriteString("_delete_expired_data") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "jobid", r.jobid) + } path.WriteString(r.jobid) method = http.MethodDelete @@ -167,15 +183,15 @@ func (r *DeleteExpiredData) HttpRequest(ctx context.Context) (*http.Request, err } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -192,27 +208,66 @@ func (r *DeleteExpiredData) HttpRequest(ctx context.Context) (*http.Request, err } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteExpiredData) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteExpiredData) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.delete_expired_data") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.delete_expired_data") + if reader := instrument.RecordRequestBody(ctx, "ml.delete_expired_data", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.delete_expired_data") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteExpiredData query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteExpiredData query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deleteexpireddata.Response -func (r DeleteExpiredData) Do(ctx context.Context) (*Response, error) { +func (r DeleteExpiredData) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_expired_data") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -220,6 +275,9 @@ func (r DeleteExpiredData) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -229,6 +287,9 @@ func (r DeleteExpiredData) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -236,6 +297,9 @@ func (r DeleteExpiredData) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deleteexpireddata/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deleteexpireddata/request.go index 7cb90258f..f4129f362 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deleteexpireddata/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deleteexpireddata/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deleteexpireddata @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package deleteexpireddata // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/delete_expired_data/MlDeleteExpiredDataRequest.ts#L25-L72 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/delete_expired_data/MlDeleteExpiredDataRequest.ts#L25-L72 type Request struct { // RequestsPerSecond The desired requests per second for the deletion processes. The default diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deleteexpireddata/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deleteexpireddata/response.go index f25bc6e0d..dfc1ebe08 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deleteexpireddata/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deleteexpireddata/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deleteexpireddata // Response holds the response body struct for the package deleteexpireddata // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/delete_expired_data/MlDeleteExpiredDataResponse.ts#L20-L22 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/delete_expired_data/MlDeleteExpiredDataResponse.ts#L20-L22 type Response struct { Deleted bool `json:"deleted"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletefilter/delete_filter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletefilter/delete_filter.go index d438cb77b..e9204e07c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletefilter/delete_filter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletefilter/delete_filter.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes a filter. package deletefilter import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type DeleteFilter struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int filterid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteFilter type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *DeleteFilter { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *DeleteFilter) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("filters") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "filterid", r.filterid) + } path.WriteString(r.filterid) method = http.MethodDelete @@ -119,9 +130,9 @@ func (r *DeleteFilter) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -138,27 +149,66 @@ func (r *DeleteFilter) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteFilter) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteFilter) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.delete_filter") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.delete_filter") + if reader := instrument.RecordRequestBody(ctx, "ml.delete_filter", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.delete_filter") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteFilter query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteFilter query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deletefilter.Response -func (r DeleteFilter) Do(ctx context.Context) (*Response, error) { +func (r DeleteFilter) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_filter") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -166,6 +216,9 @@ func (r DeleteFilter) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,6 +228,9 @@ func (r DeleteFilter) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,12 +238,25 @@ func (r DeleteFilter) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteFilter) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteFilter) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_filter") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -203,6 +272,14 @@ func (r DeleteFilter) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteFilter query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletefilter/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletefilter/response.go index e6a3fd138..090bec8d4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletefilter/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletefilter/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deletefilter // Response holds the response body struct for the package deletefilter // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/delete_filter/MlDeleteFilterResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/delete_filter/MlDeleteFilterResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deleteforecast/delete_forecast.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deleteforecast/delete_forecast.go index 4307ac3cc..cc9c76613 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deleteforecast/delete_forecast.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deleteforecast/delete_forecast.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes forecasts from a machine learning job. package deleteforecast import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -54,12 +53,16 @@ type DeleteForecast struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int jobid string forecastid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteForecast type alias for index. @@ -85,7 +88,12 @@ func New(tp elastictransport.Interface) *DeleteForecast { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -110,6 +118,9 @@ func (r *DeleteForecast) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("anomaly_detectors") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "jobid", r.jobid) + } path.WriteString(r.jobid) path.WriteString("/") path.WriteString("_forecast") @@ -122,11 +133,17 @@ func (r *DeleteForecast) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("anomaly_detectors") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "jobid", r.jobid) + } path.WriteString(r.jobid) path.WriteString("/") path.WriteString("_forecast") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "forecastid", r.forecastid) + } path.WriteString(r.forecastid) method = http.MethodDelete @@ -140,9 +157,9 @@ func (r *DeleteForecast) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -159,27 +176,66 @@ func (r *DeleteForecast) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteForecast) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteForecast) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.delete_forecast") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.delete_forecast") + if reader := instrument.RecordRequestBody(ctx, "ml.delete_forecast", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.delete_forecast") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteForecast query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteForecast query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deleteforecast.Response -func (r DeleteForecast) Do(ctx context.Context) (*Response, error) { +func (r DeleteForecast) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_forecast") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -187,6 +243,9 @@ func (r DeleteForecast) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -196,6 +255,9 @@ func (r DeleteForecast) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -203,12 +265,25 @@ func (r DeleteForecast) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteForecast) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteForecast) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_forecast") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -224,6 +299,14 @@ func (r DeleteForecast) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteForecast query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deleteforecast/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deleteforecast/response.go index 56a5613c8..fa3474756 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deleteforecast/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deleteforecast/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deleteforecast // Response holds the response body struct for the package deleteforecast // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/delete_forecast/MlDeleteForecastResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/delete_forecast/MlDeleteForecastResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletejob/delete_job.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletejob/delete_job.go index ae8f02048..81bea6f43 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletejob/delete_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletejob/delete_job.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes an existing anomaly detection job. package deletejob import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type DeleteJob struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int jobid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteJob type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *DeleteJob { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -107,6 +115,9 @@ func (r *DeleteJob) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("anomaly_detectors") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "jobid", r.jobid) + } path.WriteString(r.jobid) method = http.MethodDelete @@ -120,9 +131,9 @@ func (r *DeleteJob) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -139,27 +150,66 @@ func (r *DeleteJob) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteJob) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteJob) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.delete_job") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.delete_job") + if reader := instrument.RecordRequestBody(ctx, "ml.delete_job", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.delete_job") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteJob query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteJob query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deletejob.Response -func (r DeleteJob) Do(ctx context.Context) (*Response, error) { +func (r DeleteJob) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_job") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -167,6 +217,9 @@ func (r DeleteJob) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -176,6 +229,9 @@ func (r DeleteJob) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -183,12 +239,25 @@ func (r DeleteJob) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteJob) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteJob) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_job") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -204,6 +273,14 @@ func (r DeleteJob) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteJob query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletejob/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletejob/response.go index 84d62d39d..15c867900 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletejob/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletejob/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deletejob // Response holds the response body struct for the package deletejob // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/delete_job/MlDeleteJobResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/delete_job/MlDeleteJobResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletemodelsnapshot/delete_model_snapshot.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletemodelsnapshot/delete_model_snapshot.go index e2574eec0..761a8a939 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletemodelsnapshot/delete_model_snapshot.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletemodelsnapshot/delete_model_snapshot.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes an existing model snapshot. package deletemodelsnapshot import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,12 +52,16 @@ type DeleteModelSnapshot struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int jobid string snapshotid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteModelSnapshot type alias for index. @@ -86,7 +89,12 @@ func New(tp elastictransport.Interface) *DeleteModelSnapshot { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -111,11 +119,17 @@ func (r *DeleteModelSnapshot) HttpRequest(ctx context.Context) (*http.Request, e path.WriteString("anomaly_detectors") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "jobid", r.jobid) + } path.WriteString(r.jobid) path.WriteString("/") path.WriteString("model_snapshots") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "snapshotid", r.snapshotid) + } path.WriteString(r.snapshotid) method = http.MethodDelete @@ -129,9 +143,9 @@ func (r *DeleteModelSnapshot) HttpRequest(ctx context.Context) (*http.Request, e } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -148,27 +162,66 @@ func (r *DeleteModelSnapshot) HttpRequest(ctx context.Context) (*http.Request, e } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteModelSnapshot) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteModelSnapshot) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.delete_model_snapshot") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.delete_model_snapshot") + if reader := instrument.RecordRequestBody(ctx, "ml.delete_model_snapshot", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.delete_model_snapshot") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteModelSnapshot query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteModelSnapshot query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deletemodelsnapshot.Response -func (r DeleteModelSnapshot) Do(ctx context.Context) (*Response, error) { +func (r DeleteModelSnapshot) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_model_snapshot") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -176,6 +229,9 @@ func (r DeleteModelSnapshot) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -185,6 +241,9 @@ func (r DeleteModelSnapshot) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -192,12 +251,25 @@ func (r DeleteModelSnapshot) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteModelSnapshot) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteModelSnapshot) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_model_snapshot") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -213,6 +285,14 @@ func (r DeleteModelSnapshot) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteModelSnapshot query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletemodelsnapshot/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletemodelsnapshot/response.go index f97ad12a4..c0f2a468e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletemodelsnapshot/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletemodelsnapshot/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deletemodelsnapshot // Response holds the response body struct for the package deletemodelsnapshot // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/delete_model_snapshot/MlDeleteModelSnapshotResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/delete_model_snapshot/MlDeleteModelSnapshotResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletetrainedmodel/delete_trained_model.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletetrainedmodel/delete_trained_model.go index d315189f9..65cad8c49 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletetrainedmodel/delete_trained_model.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletetrainedmodel/delete_trained_model.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes an existing trained inference model that is currently not referenced // by an ingest pipeline. package deletetrainedmodel import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,11 +52,15 @@ type DeleteTrainedModel struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int modelid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteTrainedModel type alias for index. @@ -84,7 +87,12 @@ func New(tp elastictransport.Interface) *DeleteTrainedModel { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -109,6 +117,9 @@ func (r *DeleteTrainedModel) HttpRequest(ctx context.Context) (*http.Request, er path.WriteString("trained_models") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "modelid", r.modelid) + } path.WriteString(r.modelid) method = http.MethodDelete @@ -122,9 +133,9 @@ func (r *DeleteTrainedModel) HttpRequest(ctx context.Context) (*http.Request, er } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -141,27 +152,66 @@ func (r *DeleteTrainedModel) HttpRequest(ctx context.Context) (*http.Request, er } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteTrainedModel) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteTrainedModel) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.delete_trained_model") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.delete_trained_model") + if reader := instrument.RecordRequestBody(ctx, "ml.delete_trained_model", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.delete_trained_model") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteTrainedModel query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteTrainedModel query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deletetrainedmodel.Response -func (r DeleteTrainedModel) Do(ctx context.Context) (*Response, error) { +func (r DeleteTrainedModel) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_trained_model") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -169,6 +219,9 @@ func (r DeleteTrainedModel) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -178,6 +231,9 @@ func (r DeleteTrainedModel) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -185,12 +241,25 @@ func (r DeleteTrainedModel) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteTrainedModel) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteTrainedModel) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_trained_model") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -206,6 +275,14 @@ func (r DeleteTrainedModel) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteTrainedModel query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletetrainedmodel/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletetrainedmodel/response.go index 525127d86..257dea95f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletetrainedmodel/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletetrainedmodel/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deletetrainedmodel // Response holds the response body struct for the package deletetrainedmodel // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/delete_trained_model/MlDeleteTrainedModelResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/delete_trained_model/MlDeleteTrainedModelResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletetrainedmodelalias/delete_trained_model_alias.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletetrainedmodelalias/delete_trained_model_alias.go index b33668dee..32c692238 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletetrainedmodelalias/delete_trained_model_alias.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletetrainedmodelalias/delete_trained_model_alias.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes a model alias that refers to the trained model package deletetrainedmodelalias import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,12 +52,16 @@ type DeleteTrainedModelAlias struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int modelalias string modelid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteTrainedModelAlias type alias for index. @@ -86,7 +89,12 @@ func New(tp elastictransport.Interface) *DeleteTrainedModelAlias { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -111,11 +119,17 @@ func (r *DeleteTrainedModelAlias) HttpRequest(ctx context.Context) (*http.Reques path.WriteString("trained_models") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "modelid", r.modelid) + } path.WriteString(r.modelid) path.WriteString("/") path.WriteString("model_aliases") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "modelalias", r.modelalias) + } path.WriteString(r.modelalias) method = http.MethodDelete @@ -129,15 +143,15 @@ func (r *DeleteTrainedModelAlias) HttpRequest(ctx context.Context) (*http.Reques } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -154,27 +168,66 @@ func (r *DeleteTrainedModelAlias) HttpRequest(ctx context.Context) (*http.Reques } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteTrainedModelAlias) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteTrainedModelAlias) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.delete_trained_model_alias") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.delete_trained_model_alias") + if reader := instrument.RecordRequestBody(ctx, "ml.delete_trained_model_alias", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.delete_trained_model_alias") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteTrainedModelAlias query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteTrainedModelAlias query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deletetrainedmodelalias.Response -func (r DeleteTrainedModelAlias) Do(ctx context.Context) (*Response, error) { +func (r DeleteTrainedModelAlias) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_trained_model_alias") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -182,6 +235,9 @@ func (r DeleteTrainedModelAlias) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -191,6 +247,9 @@ func (r DeleteTrainedModelAlias) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -198,12 +257,25 @@ func (r DeleteTrainedModelAlias) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteTrainedModelAlias) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteTrainedModelAlias) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.delete_trained_model_alias") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -219,6 +291,14 @@ func (r DeleteTrainedModelAlias) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteTrainedModelAlias query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletetrainedmodelalias/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletetrainedmodelalias/response.go index 36d540bee..7288b32d6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletetrainedmodelalias/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/deletetrainedmodelalias/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deletetrainedmodelalias // Response holds the response body struct for the package deletetrainedmodelalias // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/delete_trained_model_alias/MlDeleteTrainedModelAliasResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/delete_trained_model_alias/MlDeleteTrainedModelAliasResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/estimatemodelmemory/estimate_model_memory.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/estimatemodelmemory/estimate_model_memory.go index ae1f6e86e..3e0e3ac7f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/estimatemodelmemory/estimate_model_memory.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/estimatemodelmemory/estimate_model_memory.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Estimates the model memory package estimatemodelmemory @@ -46,13 +46,17 @@ type EstimateModelMemory struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewEstimateModelMemory type alias for index. @@ -76,11 +80,18 @@ func New(tp elastictransport.Interface) *EstimateModelMemory { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -117,9 +128,7 @@ func (r *EstimateModelMemory) HttpRequest(ctx context.Context) (*http.Request, e } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -131,6 +140,10 @@ func (r *EstimateModelMemory) HttpRequest(ctx context.Context) (*http.Request, e } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -153,15 +166,15 @@ func (r *EstimateModelMemory) HttpRequest(ctx context.Context) (*http.Request, e } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -178,27 +191,66 @@ func (r *EstimateModelMemory) HttpRequest(ctx context.Context) (*http.Request, e } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r EstimateModelMemory) Perform(ctx context.Context) (*http.Response, error) { +func (r EstimateModelMemory) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.estimate_model_memory") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.estimate_model_memory") + if reader := instrument.RecordRequestBody(ctx, "ml.estimate_model_memory", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.estimate_model_memory") + } if err != nil { - return nil, fmt.Errorf("an error happened during the EstimateModelMemory query execution: %w", err) + localErr := fmt.Errorf("an error happened during the EstimateModelMemory query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a estimatemodelmemory.Response -func (r EstimateModelMemory) Do(ctx context.Context) (*Response, error) { +func (r EstimateModelMemory) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.estimate_model_memory") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -206,6 +258,9 @@ func (r EstimateModelMemory) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -215,6 +270,9 @@ func (r EstimateModelMemory) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -222,6 +280,9 @@ func (r EstimateModelMemory) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/estimatemodelmemory/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/estimatemodelmemory/request.go index c01642066..a06bca88b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/estimatemodelmemory/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/estimatemodelmemory/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package estimatemodelmemory @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package estimatemodelmemory // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/estimate_model_memory/MlEstimateModelMemoryRequest.ts#L26-L61 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/estimate_model_memory/MlEstimateModelMemoryRequest.ts#L26-L61 type Request struct { // AnalysisConfig For a list of the properties that you can specify in the diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/estimatemodelmemory/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/estimatemodelmemory/response.go index abd80cc25..4696b0e23 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/estimatemodelmemory/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/estimatemodelmemory/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package estimatemodelmemory // Response holds the response body struct for the package estimatemodelmemory // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/estimate_model_memory/MlEstimateModelMemoryResponse.ts#L20-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/estimate_model_memory/MlEstimateModelMemoryResponse.ts#L20-L24 type Response struct { ModelMemoryEstimate string `json:"model_memory_estimate"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/evaluatedataframe/evaluate_data_frame.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/evaluatedataframe/evaluate_data_frame.go index bb85e43cd..f8186f294 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/evaluatedataframe/evaluate_data_frame.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/evaluatedataframe/evaluate_data_frame.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Evaluates the data frame analytics for an annotated index. package evaluatedataframe @@ -46,13 +46,17 @@ type EvaluateDataFrame struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewEvaluateDataFrame type alias for index. @@ -76,11 +80,18 @@ func New(tp elastictransport.Interface) *EvaluateDataFrame { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -117,9 +128,7 @@ func (r *EvaluateDataFrame) HttpRequest(ctx context.Context) (*http.Request, err } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -131,6 +140,10 @@ func (r *EvaluateDataFrame) HttpRequest(ctx context.Context) (*http.Request, err } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -153,15 +166,15 @@ func (r *EvaluateDataFrame) HttpRequest(ctx context.Context) (*http.Request, err } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -178,27 +191,66 @@ func (r *EvaluateDataFrame) HttpRequest(ctx context.Context) (*http.Request, err } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r EvaluateDataFrame) Perform(ctx context.Context) (*http.Response, error) { +func (r EvaluateDataFrame) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.evaluate_data_frame") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.evaluate_data_frame") + if reader := instrument.RecordRequestBody(ctx, "ml.evaluate_data_frame", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.evaluate_data_frame") + } if err != nil { - return nil, fmt.Errorf("an error happened during the EvaluateDataFrame query execution: %w", err) + localErr := fmt.Errorf("an error happened during the EvaluateDataFrame query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a evaluatedataframe.Response -func (r EvaluateDataFrame) Do(ctx context.Context) (*Response, error) { +func (r EvaluateDataFrame) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.evaluate_data_frame") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -206,6 +258,9 @@ func (r EvaluateDataFrame) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -215,6 +270,9 @@ func (r EvaluateDataFrame) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -222,6 +280,9 @@ func (r EvaluateDataFrame) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/evaluatedataframe/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/evaluatedataframe/request.go index 20ed27523..bea444655 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/evaluatedataframe/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/evaluatedataframe/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package evaluatedataframe @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package evaluatedataframe // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/evaluate_data_frame/MlEvaluateDataFrameRequest.ts#L25-L52 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/evaluate_data_frame/MlEvaluateDataFrameRequest.ts#L25-L52 type Request struct { // Evaluation Defines the type of evaluation you want to perform. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/evaluatedataframe/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/evaluatedataframe/response.go index 5049b991e..65bea4d06 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/evaluatedataframe/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/evaluatedataframe/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package evaluatedataframe @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package evaluatedataframe // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/evaluate_data_frame/MlEvaluateDataFrameResponse.ts#L26-L33 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/evaluate_data_frame/MlEvaluateDataFrameResponse.ts#L26-L33 type Response struct { Classification *types.DataframeClassificationSummary `json:"classification,omitempty"` OutlierDetection *types.DataframeOutlierDetectionSummary `json:"outlier_detection,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/explaindataframeanalytics/explain_data_frame_analytics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/explaindataframeanalytics/explain_data_frame_analytics.go index d6cbf91c3..c42a58c8e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/explaindataframeanalytics/explain_data_frame_analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/explaindataframeanalytics/explain_data_frame_analytics.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Explains a data frame analytics config. package explaindataframeanalytics @@ -50,15 +50,19 @@ type ExplainDataFrameAnalytics struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewExplainDataFrameAnalytics type alias for index. @@ -82,11 +86,18 @@ func New(tp elastictransport.Interface) *ExplainDataFrameAnalytics { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -123,9 +134,7 @@ func (r *ExplainDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Requ } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -137,6 +146,10 @@ func (r *ExplainDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Requ } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -160,6 +173,9 @@ func (r *ExplainDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Requ path.WriteString("analytics") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) path.WriteString("/") path.WriteString("_explain") @@ -175,15 +191,15 @@ func (r *ExplainDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Requ } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -200,27 +216,66 @@ func (r *ExplainDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Requ } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ExplainDataFrameAnalytics) Perform(ctx context.Context) (*http.Response, error) { +func (r ExplainDataFrameAnalytics) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.explain_data_frame_analytics") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.explain_data_frame_analytics") + if reader := instrument.RecordRequestBody(ctx, "ml.explain_data_frame_analytics", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.explain_data_frame_analytics") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ExplainDataFrameAnalytics query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ExplainDataFrameAnalytics query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a explaindataframeanalytics.Response -func (r ExplainDataFrameAnalytics) Do(ctx context.Context) (*Response, error) { +func (r ExplainDataFrameAnalytics) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.explain_data_frame_analytics") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -228,6 +283,9 @@ func (r ExplainDataFrameAnalytics) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -237,6 +295,9 @@ func (r ExplainDataFrameAnalytics) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -244,6 +305,9 @@ func (r ExplainDataFrameAnalytics) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/explaindataframeanalytics/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/explaindataframeanalytics/request.go index 6502f5753..fed09b6b9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/explaindataframeanalytics/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/explaindataframeanalytics/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package explaindataframeanalytics @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package explaindataframeanalytics // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/explain_data_frame_analytics/MlExplainDataFrameAnalyticsRequest.ts#L30-L107 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/explain_data_frame_analytics/MlExplainDataFrameAnalyticsRequest.ts#L30-L107 type Request struct { // AllowLazyStart Specifies whether this job can start when there is insufficient machine diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/explaindataframeanalytics/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/explaindataframeanalytics/response.go index ee018d6de..027c31408 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/explaindataframeanalytics/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/explaindataframeanalytics/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package explaindataframeanalytics @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package explaindataframeanalytics // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/explain_data_frame_analytics/MlExplainDataFrameAnalyticsResponse.ts#L25-L32 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/explain_data_frame_analytics/MlExplainDataFrameAnalyticsResponse.ts#L25-L32 type Response struct { // FieldSelection An array of objects that explain selection for each field, sorted by the diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/flushjob/flush_job.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/flushjob/flush_job.go index 0cdf33ad4..13ef2aaf1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/flushjob/flush_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/flushjob/flush_job.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Forces any buffered data to be processed by the job. package flushjob @@ -50,15 +50,19 @@ type FlushJob struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int jobid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewFlushJob type alias for index. @@ -84,11 +88,18 @@ func New(tp elastictransport.Interface) *FlushJob { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -125,9 +136,7 @@ func (r *FlushJob) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -139,6 +148,10 @@ func (r *FlushJob) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -149,6 +162,9 @@ func (r *FlushJob) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("anomaly_detectors") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "jobid", r.jobid) + } path.WriteString(r.jobid) path.WriteString("/") path.WriteString("_flush") @@ -164,15 +180,15 @@ func (r *FlushJob) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -189,27 +205,66 @@ func (r *FlushJob) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r FlushJob) Perform(ctx context.Context) (*http.Response, error) { +func (r FlushJob) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.flush_job") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.flush_job") + if reader := instrument.RecordRequestBody(ctx, "ml.flush_job", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.flush_job") + } if err != nil { - return nil, fmt.Errorf("an error happened during the FlushJob query execution: %w", err) + localErr := fmt.Errorf("an error happened during the FlushJob query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a flushjob.Response -func (r FlushJob) Do(ctx context.Context) (*Response, error) { +func (r FlushJob) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.flush_job") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -217,6 +272,9 @@ func (r FlushJob) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -226,6 +284,9 @@ func (r FlushJob) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -233,6 +294,9 @@ func (r FlushJob) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/flushjob/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/flushjob/request.go index a213d835c..ac13fb77c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/flushjob/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/flushjob/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package flushjob @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package flushjob // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/flush_job/MlFlushJobRequest.ts#L24-L99 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/flush_job/MlFlushJobRequest.ts#L24-L99 type Request struct { // AdvanceTime Refer to the description for the `advance_time` query parameter. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/flushjob/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/flushjob/response.go index 210aa730c..4a4542311 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/flushjob/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/flushjob/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package flushjob // Response holds the response body struct for the package flushjob // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/flush_job/MlFlushJobResponse.ts#L22-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/flush_job/MlFlushJobResponse.ts#L22-L31 type Response struct { Flushed bool `json:"flushed"` // LastFinalizedBucketEnd Provides the timestamp (in milliseconds since the epoch) of the end of diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/forecast/forecast.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/forecast/forecast.go index 46cf7e93d..ad090add3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/forecast/forecast.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/forecast/forecast.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Predicts the future behavior of a time series by using its historical // behavior. @@ -51,15 +51,19 @@ type Forecast struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int jobid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewForecast type alias for index. @@ -86,11 +90,18 @@ func New(tp elastictransport.Interface) *Forecast { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -127,9 +138,7 @@ func (r *Forecast) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -141,6 +150,10 @@ func (r *Forecast) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -151,6 +164,9 @@ func (r *Forecast) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("anomaly_detectors") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "jobid", r.jobid) + } path.WriteString(r.jobid) path.WriteString("/") path.WriteString("_forecast") @@ -166,15 +182,15 @@ func (r *Forecast) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -191,27 +207,66 @@ func (r *Forecast) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Forecast) Perform(ctx context.Context) (*http.Response, error) { +func (r Forecast) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.forecast") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.forecast") + if reader := instrument.RecordRequestBody(ctx, "ml.forecast", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.forecast") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Forecast query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Forecast query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a forecast.Response -func (r Forecast) Do(ctx context.Context) (*Response, error) { +func (r Forecast) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.forecast") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -219,6 +274,9 @@ func (r Forecast) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -228,6 +286,9 @@ func (r Forecast) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -235,6 +296,9 @@ func (r Forecast) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/forecast/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/forecast/request.go index 6d5205242..c95e238dd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/forecast/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/forecast/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package forecast @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package forecast // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/forecast/MlForecastJobRequest.ts#L24-L87 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/forecast/MlForecastJobRequest.ts#L24-L87 type Request struct { // Duration Refer to the description for the `duration` query parameter. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/forecast/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/forecast/response.go index 456bb441a..906aa06bf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/forecast/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/forecast/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package forecast // Response holds the response body struct for the package forecast // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/forecast/MlForecastJobResponse.ts#L22-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/forecast/MlForecastJobResponse.ts#L22-L27 type Response struct { Acknowledged bool `json:"acknowledged"` ForecastId string `json:"forecast_id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getbuckets/get_buckets.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getbuckets/get_buckets.go index 467dbfd0e..35ae255b0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getbuckets/get_buckets.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getbuckets/get_buckets.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves anomaly detection job results for one or more buckets. package getbuckets @@ -53,16 +53,20 @@ type GetBuckets struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int jobid string timestamp string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetBuckets type alias for index. @@ -88,11 +92,18 @@ func New(tp elastictransport.Interface) *GetBuckets { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -129,9 +140,7 @@ func (r *GetBuckets) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -143,6 +152,10 @@ func (r *GetBuckets) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -153,6 +166,9 @@ func (r *GetBuckets) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("anomaly_detectors") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "jobid", r.jobid) + } path.WriteString(r.jobid) path.WriteString("/") path.WriteString("results") @@ -160,6 +176,9 @@ func (r *GetBuckets) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("buckets") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "timestamp", r.timestamp) + } path.WriteString(r.timestamp) method = http.MethodPost @@ -170,6 +189,9 @@ func (r *GetBuckets) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("anomaly_detectors") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "jobid", r.jobid) + } path.WriteString(r.jobid) path.WriteString("/") path.WriteString("results") @@ -187,15 +209,15 @@ func (r *GetBuckets) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -212,27 +234,66 @@ func (r *GetBuckets) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetBuckets) Perform(ctx context.Context) (*http.Response, error) { +func (r GetBuckets) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.get_buckets") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_buckets") + if reader := instrument.RecordRequestBody(ctx, "ml.get_buckets", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_buckets") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetBuckets query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetBuckets query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getbuckets.Response -func (r GetBuckets) Do(ctx context.Context) (*Response, error) { +func (r GetBuckets) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_buckets") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -240,6 +301,9 @@ func (r GetBuckets) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -249,6 +313,9 @@ func (r GetBuckets) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -256,6 +323,9 @@ func (r GetBuckets) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getbuckets/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getbuckets/request.go index e4e19b58f..369947a58 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getbuckets/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getbuckets/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getbuckets @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package getbuckets // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/get_buckets/MlGetBucketsRequest.ts#L26-L133 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/get_buckets/MlGetBucketsRequest.ts#L26-L133 type Request struct { // AnomalyScore Refer to the description for the `anomaly_score` query parameter. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getbuckets/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getbuckets/response.go index a778a64bc..e5299658b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getbuckets/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getbuckets/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getbuckets @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getbuckets // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/get_buckets/MlGetBucketsResponse.ts#L23-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/get_buckets/MlGetBucketsResponse.ts#L23-L28 type Response struct { Buckets []types.BucketSummary `json:"buckets"` Count int64 `json:"count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getcalendarevents/get_calendar_events.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getcalendarevents/get_calendar_events.go index 9261ed35e..2291489b3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getcalendarevents/get_calendar_events.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getcalendarevents/get_calendar_events.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves information about the scheduled events in calendars. package getcalendarevents import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type GetCalendarEvents struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int calendarid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetCalendarEvents type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *GetCalendarEvents { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -107,6 +115,9 @@ func (r *GetCalendarEvents) HttpRequest(ctx context.Context) (*http.Request, err path.WriteString("calendars") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "calendarid", r.calendarid) + } path.WriteString(r.calendarid) path.WriteString("/") path.WriteString("events") @@ -122,9 +133,9 @@ func (r *GetCalendarEvents) HttpRequest(ctx context.Context) (*http.Request, err } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -141,27 +152,66 @@ func (r *GetCalendarEvents) HttpRequest(ctx context.Context) (*http.Request, err } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetCalendarEvents) Perform(ctx context.Context) (*http.Response, error) { +func (r GetCalendarEvents) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.get_calendar_events") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_calendar_events") + if reader := instrument.RecordRequestBody(ctx, "ml.get_calendar_events", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_calendar_events") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetCalendarEvents query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetCalendarEvents query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getcalendarevents.Response -func (r GetCalendarEvents) Do(ctx context.Context) (*Response, error) { +func (r GetCalendarEvents) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_calendar_events") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -169,6 +219,9 @@ func (r GetCalendarEvents) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -178,6 +231,9 @@ func (r GetCalendarEvents) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -185,12 +241,25 @@ func (r GetCalendarEvents) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetCalendarEvents) IsSuccess(ctx context.Context) (bool, error) { +func (r GetCalendarEvents) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_calendar_events") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -206,6 +275,14 @@ func (r GetCalendarEvents) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetCalendarEvents query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getcalendarevents/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getcalendarevents/response.go index 00f129235..e8bfeb3f5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getcalendarevents/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getcalendarevents/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getcalendarevents @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getcalendarevents // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/get_calendar_events/MlGetCalendarEventsResponse.ts#L23-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/get_calendar_events/MlGetCalendarEventsResponse.ts#L23-L28 type Response struct { Count int64 `json:"count"` Events []types.CalendarEvent `json:"events"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getcalendars/get_calendars.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getcalendars/get_calendars.go index 0c131b340..620b0c366 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getcalendars/get_calendars.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getcalendars/get_calendars.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves configuration information for calendars. package getcalendars @@ -51,15 +51,19 @@ type GetCalendars struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int calendarid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetCalendars type alias for index. @@ -83,11 +87,18 @@ func New(tp elastictransport.Interface) *GetCalendars { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -124,9 +135,7 @@ func (r *GetCalendars) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -138,6 +147,10 @@ func (r *GetCalendars) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -155,6 +168,9 @@ func (r *GetCalendars) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("calendars") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "calendarid", r.calendarid) + } path.WriteString(r.calendarid) method = http.MethodPost @@ -168,15 +184,15 @@ func (r *GetCalendars) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -193,27 +209,66 @@ func (r *GetCalendars) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetCalendars) Perform(ctx context.Context) (*http.Response, error) { +func (r GetCalendars) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.get_calendars") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_calendars") + if reader := instrument.RecordRequestBody(ctx, "ml.get_calendars", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_calendars") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetCalendars query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetCalendars query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getcalendars.Response -func (r GetCalendars) Do(ctx context.Context) (*Response, error) { +func (r GetCalendars) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_calendars") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -221,6 +276,9 @@ func (r GetCalendars) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -230,6 +288,9 @@ func (r GetCalendars) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -237,6 +298,9 @@ func (r GetCalendars) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getcalendars/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getcalendars/request.go index 0f087356f..095d46ac2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getcalendars/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getcalendars/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getcalendars @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package getcalendars // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/get_calendars/MlGetCalendarsRequest.ts#L25-L51 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/get_calendars/MlGetCalendarsRequest.ts#L25-L51 type Request struct { // Page This object is supported only when you omit the calendar identifier. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getcalendars/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getcalendars/response.go index a2f355659..2a0d7ecb3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getcalendars/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getcalendars/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getcalendars @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getcalendars // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/get_calendars/MlGetCalendarsResponse.ts#L23-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/get_calendars/MlGetCalendarsResponse.ts#L23-L25 type Response struct { Calendars []types.Calendar `json:"calendars"` Count int64 `json:"count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getcategories/get_categories.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getcategories/get_categories.go index f8d0953ea..f03a11d8f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getcategories/get_categories.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getcategories/get_categories.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves anomaly detection job results for one or more categories. package getcategories @@ -53,16 +53,20 @@ type GetCategories struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int jobid string categoryid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetCategories type alias for index. @@ -88,11 +92,18 @@ func New(tp elastictransport.Interface) *GetCategories { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -129,9 +140,7 @@ func (r *GetCategories) HttpRequest(ctx context.Context) (*http.Request, error) } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -143,6 +152,10 @@ func (r *GetCategories) HttpRequest(ctx context.Context) (*http.Request, error) } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -153,6 +166,9 @@ func (r *GetCategories) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("anomaly_detectors") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "jobid", r.jobid) + } path.WriteString(r.jobid) path.WriteString("/") path.WriteString("results") @@ -160,6 +176,9 @@ func (r *GetCategories) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("categories") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "categoryid", r.categoryid) + } path.WriteString(r.categoryid) method = http.MethodPost @@ -170,6 +189,9 @@ func (r *GetCategories) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("anomaly_detectors") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "jobid", r.jobid) + } path.WriteString(r.jobid) path.WriteString("/") path.WriteString("results") @@ -187,15 +209,15 @@ func (r *GetCategories) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -212,27 +234,66 @@ func (r *GetCategories) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetCategories) Perform(ctx context.Context) (*http.Response, error) { +func (r GetCategories) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.get_categories") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_categories") + if reader := instrument.RecordRequestBody(ctx, "ml.get_categories", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_categories") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetCategories query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetCategories query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getcategories.Response -func (r GetCategories) Do(ctx context.Context) (*Response, error) { +func (r GetCategories) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_categories") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -240,6 +301,9 @@ func (r GetCategories) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -249,6 +313,9 @@ func (r GetCategories) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -256,6 +323,9 @@ func (r GetCategories) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getcategories/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getcategories/request.go index 7a2c23fcf..f5130ce3f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getcategories/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getcategories/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getcategories @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package getcategories // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/get_categories/MlGetCategoriesRequest.ts#L25-L70 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/get_categories/MlGetCategoriesRequest.ts#L25-L70 type Request struct { // Page Configures pagination. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getcategories/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getcategories/response.go index c232715b5..5375c8256 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getcategories/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getcategories/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getcategories @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getcategories // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/get_categories/MlGetCategoriesResponse.ts#L23-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/get_categories/MlGetCategoriesResponse.ts#L23-L28 type Response struct { Categories []types.Category `json:"categories"` Count int64 `json:"count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getdatafeeds/get_datafeeds.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getdatafeeds/get_datafeeds.go index 0a2c64c19..7bd67c98d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getdatafeeds/get_datafeeds.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getdatafeeds/get_datafeeds.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves configuration information for datafeeds. package getdatafeeds import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type GetDatafeeds struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int datafeedid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetDatafeeds type alias for index. @@ -80,7 +83,12 @@ func New(tp elastictransport.Interface) *GetDatafeeds { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -105,6 +113,9 @@ func (r *GetDatafeeds) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("datafeeds") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "datafeedid", r.datafeedid) + } path.WriteString(r.datafeedid) method = http.MethodGet @@ -125,9 +136,9 @@ func (r *GetDatafeeds) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -144,27 +155,66 @@ func (r *GetDatafeeds) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetDatafeeds) Perform(ctx context.Context) (*http.Response, error) { +func (r GetDatafeeds) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.get_datafeeds") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_datafeeds") + if reader := instrument.RecordRequestBody(ctx, "ml.get_datafeeds", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_datafeeds") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetDatafeeds query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetDatafeeds query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getdatafeeds.Response -func (r GetDatafeeds) Do(ctx context.Context) (*Response, error) { +func (r GetDatafeeds) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_datafeeds") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -172,6 +222,9 @@ func (r GetDatafeeds) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -181,6 +234,9 @@ func (r GetDatafeeds) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -188,12 +244,25 @@ func (r GetDatafeeds) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetDatafeeds) IsSuccess(ctx context.Context) (bool, error) { +func (r GetDatafeeds) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_datafeeds") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -209,6 +278,14 @@ func (r GetDatafeeds) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetDatafeeds query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getdatafeeds/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getdatafeeds/response.go index d646d03b8..c5fd43fe4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getdatafeeds/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getdatafeeds/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getdatafeeds @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getdatafeeds // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/get_datafeeds/MlGetDatafeedsResponse.ts#L23-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/get_datafeeds/MlGetDatafeedsResponse.ts#L23-L28 type Response struct { Count int64 `json:"count"` Datafeeds []types.MLDatafeed `json:"datafeeds"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getdatafeedstats/get_datafeed_stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getdatafeedstats/get_datafeed_stats.go index 4aadcf86b..5800395dd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getdatafeedstats/get_datafeed_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getdatafeedstats/get_datafeed_stats.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves usage information for datafeeds. package getdatafeedstats import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type GetDatafeedStats struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int datafeedid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetDatafeedStats type alias for index. @@ -80,7 +83,12 @@ func New(tp elastictransport.Interface) *GetDatafeedStats { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -105,6 +113,9 @@ func (r *GetDatafeedStats) HttpRequest(ctx context.Context) (*http.Request, erro path.WriteString("datafeeds") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "datafeedid", r.datafeedid) + } path.WriteString(r.datafeedid) path.WriteString("/") path.WriteString("_stats") @@ -129,9 +140,9 @@ func (r *GetDatafeedStats) HttpRequest(ctx context.Context) (*http.Request, erro } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -148,27 +159,66 @@ func (r *GetDatafeedStats) HttpRequest(ctx context.Context) (*http.Request, erro } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetDatafeedStats) Perform(ctx context.Context) (*http.Response, error) { +func (r GetDatafeedStats) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.get_datafeed_stats") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_datafeed_stats") + if reader := instrument.RecordRequestBody(ctx, "ml.get_datafeed_stats", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_datafeed_stats") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetDatafeedStats query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetDatafeedStats query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getdatafeedstats.Response -func (r GetDatafeedStats) Do(ctx context.Context) (*Response, error) { +func (r GetDatafeedStats) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_datafeed_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -176,6 +226,9 @@ func (r GetDatafeedStats) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -185,6 +238,9 @@ func (r GetDatafeedStats) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -192,12 +248,25 @@ func (r GetDatafeedStats) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetDatafeedStats) IsSuccess(ctx context.Context) (bool, error) { +func (r GetDatafeedStats) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_datafeed_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -213,6 +282,14 @@ func (r GetDatafeedStats) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetDatafeedStats query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getdatafeedstats/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getdatafeedstats/response.go index 4171062bb..735abdbd1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getdatafeedstats/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getdatafeedstats/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getdatafeedstats @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getdatafeedstats // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/get_datafeed_stats/MlGetDatafeedStatsResponse.ts#L23-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/get_datafeed_stats/MlGetDatafeedStatsResponse.ts#L23-L28 type Response struct { Count int64 `json:"count"` Datafeeds []types.DatafeedStats `json:"datafeeds"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getdataframeanalytics/get_data_frame_analytics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getdataframeanalytics/get_data_frame_analytics.go index 42125f02c..24a61f7c9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getdataframeanalytics/get_data_frame_analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getdataframeanalytics/get_data_frame_analytics.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves configuration information for data frame analytics jobs. package getdataframeanalytics import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type GetDataFrameAnalytics struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetDataFrameAnalytics type alias for index. @@ -80,7 +83,12 @@ func New(tp elastictransport.Interface) *GetDataFrameAnalytics { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -107,6 +115,9 @@ func (r *GetDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Request, path.WriteString("analytics") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodGet @@ -129,9 +140,9 @@ func (r *GetDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Request, } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -148,27 +159,66 @@ func (r *GetDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Request, } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetDataFrameAnalytics) Perform(ctx context.Context) (*http.Response, error) { +func (r GetDataFrameAnalytics) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.get_data_frame_analytics") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_data_frame_analytics") + if reader := instrument.RecordRequestBody(ctx, "ml.get_data_frame_analytics", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_data_frame_analytics") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetDataFrameAnalytics query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetDataFrameAnalytics query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getdataframeanalytics.Response -func (r GetDataFrameAnalytics) Do(ctx context.Context) (*Response, error) { +func (r GetDataFrameAnalytics) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_data_frame_analytics") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -176,6 +226,9 @@ func (r GetDataFrameAnalytics) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -185,6 +238,9 @@ func (r GetDataFrameAnalytics) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -192,12 +248,25 @@ func (r GetDataFrameAnalytics) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetDataFrameAnalytics) IsSuccess(ctx context.Context) (bool, error) { +func (r GetDataFrameAnalytics) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_data_frame_analytics") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -213,6 +282,14 @@ func (r GetDataFrameAnalytics) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetDataFrameAnalytics query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getdataframeanalytics/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getdataframeanalytics/response.go index 183d40d53..7867825c2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getdataframeanalytics/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getdataframeanalytics/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getdataframeanalytics @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getdataframeanalytics // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/get_data_frame_analytics/MlGetDataFrameAnalyticsResponse.ts#L23-L29 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/get_data_frame_analytics/MlGetDataFrameAnalyticsResponse.ts#L23-L29 type Response struct { Count int `json:"count"` // DataFrameAnalytics An array of data frame analytics job resources, which are sorted by the id diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getdataframeanalyticsstats/get_data_frame_analytics_stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getdataframeanalyticsstats/get_data_frame_analytics_stats.go index f4fa58d69..486f13803 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getdataframeanalyticsstats/get_data_frame_analytics_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getdataframeanalyticsstats/get_data_frame_analytics_stats.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves usage information for data frame analytics jobs. package getdataframeanalyticsstats import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type GetDataFrameAnalyticsStats struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetDataFrameAnalyticsStats type alias for index. @@ -80,7 +83,12 @@ func New(tp elastictransport.Interface) *GetDataFrameAnalyticsStats { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -118,6 +126,9 @@ func (r *GetDataFrameAnalyticsStats) HttpRequest(ctx context.Context) (*http.Req path.WriteString("analytics") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) path.WriteString("/") path.WriteString("_stats") @@ -133,9 +144,9 @@ func (r *GetDataFrameAnalyticsStats) HttpRequest(ctx context.Context) (*http.Req } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -152,27 +163,66 @@ func (r *GetDataFrameAnalyticsStats) HttpRequest(ctx context.Context) (*http.Req } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetDataFrameAnalyticsStats) Perform(ctx context.Context) (*http.Response, error) { +func (r GetDataFrameAnalyticsStats) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.get_data_frame_analytics_stats") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_data_frame_analytics_stats") + if reader := instrument.RecordRequestBody(ctx, "ml.get_data_frame_analytics_stats", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_data_frame_analytics_stats") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetDataFrameAnalyticsStats query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetDataFrameAnalyticsStats query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getdataframeanalyticsstats.Response -func (r GetDataFrameAnalyticsStats) Do(ctx context.Context) (*Response, error) { +func (r GetDataFrameAnalyticsStats) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_data_frame_analytics_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -180,6 +230,9 @@ func (r GetDataFrameAnalyticsStats) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -189,6 +242,9 @@ func (r GetDataFrameAnalyticsStats) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -196,12 +252,25 @@ func (r GetDataFrameAnalyticsStats) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetDataFrameAnalyticsStats) IsSuccess(ctx context.Context) (bool, error) { +func (r GetDataFrameAnalyticsStats) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_data_frame_analytics_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -217,6 +286,14 @@ func (r GetDataFrameAnalyticsStats) IsSuccess(ctx context.Context) (bool, error) return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetDataFrameAnalyticsStats query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getdataframeanalyticsstats/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getdataframeanalyticsstats/response.go index cb6bdbc09..3e859f644 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getdataframeanalyticsstats/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getdataframeanalyticsstats/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getdataframeanalyticsstats @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getdataframeanalyticsstats // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/get_data_frame_analytics_stats/MlGetDataFrameAnalyticsStatsResponse.ts#L24-L30 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/get_data_frame_analytics_stats/MlGetDataFrameAnalyticsStatsResponse.ts#L24-L30 type Response struct { Count int64 `json:"count"` // DataFrameAnalytics An array of objects that contain usage information for data frame analytics diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getfilters/get_filters.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getfilters/get_filters.go index ec4f5a87c..e0782c42d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getfilters/get_filters.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getfilters/get_filters.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves filters. package getfilters import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type GetFilters struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int filterid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetFilters type alias for index. @@ -80,7 +83,12 @@ func New(tp elastictransport.Interface) *GetFilters { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -112,6 +120,9 @@ func (r *GetFilters) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("filters") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "filterid", r.filterid) + } path.WriteString(r.filterid) method = http.MethodGet @@ -125,9 +136,9 @@ func (r *GetFilters) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -144,27 +155,66 @@ func (r *GetFilters) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetFilters) Perform(ctx context.Context) (*http.Response, error) { +func (r GetFilters) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.get_filters") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_filters") + if reader := instrument.RecordRequestBody(ctx, "ml.get_filters", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_filters") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetFilters query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetFilters query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getfilters.Response -func (r GetFilters) Do(ctx context.Context) (*Response, error) { +func (r GetFilters) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_filters") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -172,6 +222,9 @@ func (r GetFilters) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -181,6 +234,9 @@ func (r GetFilters) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -188,12 +244,25 @@ func (r GetFilters) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetFilters) IsSuccess(ctx context.Context) (bool, error) { +func (r GetFilters) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_filters") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -209,6 +278,14 @@ func (r GetFilters) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetFilters query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getfilters/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getfilters/response.go index 9bcb63272..2973e8b16 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getfilters/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getfilters/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getfilters @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getfilters // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/get_filters/MlGetFiltersResponse.ts#L23-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/get_filters/MlGetFiltersResponse.ts#L23-L28 type Response struct { Count int64 `json:"count"` Filters []types.MLFilter `json:"filters"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getinfluencers/get_influencers.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getinfluencers/get_influencers.go index f7577b840..7bd2b09d2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getinfluencers/get_influencers.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getinfluencers/get_influencers.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves anomaly detection job results for one or more influencers. package getinfluencers @@ -51,15 +51,19 @@ type GetInfluencers struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int jobid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetInfluencers type alias for index. @@ -85,11 +89,18 @@ func New(tp elastictransport.Interface) *GetInfluencers { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -126,9 +137,7 @@ func (r *GetInfluencers) HttpRequest(ctx context.Context) (*http.Request, error) } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -140,6 +149,10 @@ func (r *GetInfluencers) HttpRequest(ctx context.Context) (*http.Request, error) } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -150,6 +163,9 @@ func (r *GetInfluencers) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("anomaly_detectors") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "jobid", r.jobid) + } path.WriteString(r.jobid) path.WriteString("/") path.WriteString("results") @@ -167,15 +183,15 @@ func (r *GetInfluencers) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -192,27 +208,66 @@ func (r *GetInfluencers) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetInfluencers) Perform(ctx context.Context) (*http.Response, error) { +func (r GetInfluencers) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.get_influencers") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_influencers") + if reader := instrument.RecordRequestBody(ctx, "ml.get_influencers", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_influencers") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetInfluencers query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetInfluencers query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getinfluencers.Response -func (r GetInfluencers) Do(ctx context.Context) (*Response, error) { +func (r GetInfluencers) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_influencers") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -220,6 +275,9 @@ func (r GetInfluencers) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -229,6 +287,9 @@ func (r GetInfluencers) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -236,6 +297,9 @@ func (r GetInfluencers) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getinfluencers/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getinfluencers/request.go index 79d9f128f..3f5a4ce0e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getinfluencers/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getinfluencers/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getinfluencers @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package getinfluencers // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/get_influencers/MlGetInfluencersRequest.ts#L26-L97 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/get_influencers/MlGetInfluencersRequest.ts#L26-L97 type Request struct { // Page Configures pagination. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getinfluencers/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getinfluencers/response.go index 07a27cb33..58d0056f6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getinfluencers/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getinfluencers/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getinfluencers @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getinfluencers // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/get_influencers/MlGetInfluencersResponse.ts#L23-L29 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/get_influencers/MlGetInfluencersResponse.ts#L23-L29 type Response struct { Count int64 `json:"count"` // Influencers Array of influencer objects diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getjobs/get_jobs.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getjobs/get_jobs.go index 66fbb80cb..347729d9e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getjobs/get_jobs.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getjobs/get_jobs.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves configuration information for anomaly detection jobs. package getjobs import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type GetJobs struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int jobid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetJobs type alias for index. @@ -80,7 +83,12 @@ func New(tp elastictransport.Interface) *GetJobs { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -105,6 +113,9 @@ func (r *GetJobs) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("anomaly_detectors") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "jobid", r.jobid) + } path.WriteString(r.jobid) method = http.MethodGet @@ -125,9 +136,9 @@ func (r *GetJobs) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -144,27 +155,66 @@ func (r *GetJobs) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetJobs) Perform(ctx context.Context) (*http.Response, error) { +func (r GetJobs) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.get_jobs") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_jobs") + if reader := instrument.RecordRequestBody(ctx, "ml.get_jobs", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_jobs") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetJobs query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetJobs query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getjobs.Response -func (r GetJobs) Do(ctx context.Context) (*Response, error) { +func (r GetJobs) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_jobs") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -172,6 +222,9 @@ func (r GetJobs) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -181,6 +234,9 @@ func (r GetJobs) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -188,12 +244,25 @@ func (r GetJobs) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetJobs) IsSuccess(ctx context.Context) (bool, error) { +func (r GetJobs) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_jobs") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -209,6 +278,14 @@ func (r GetJobs) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetJobs query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getjobs/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getjobs/response.go index e0775c0dc..58e9f36dc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getjobs/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getjobs/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getjobs @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getjobs // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/get_jobs/MlGetJobsResponse.ts#L23-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/get_jobs/MlGetJobsResponse.ts#L23-L28 type Response struct { Count int64 `json:"count"` Jobs []types.Job `json:"jobs"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getjobstats/get_job_stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getjobstats/get_job_stats.go index 86a4db877..68bb91e29 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getjobstats/get_job_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getjobstats/get_job_stats.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves usage information for anomaly detection jobs. package getjobstats import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type GetJobStats struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int jobid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetJobStats type alias for index. @@ -80,7 +83,12 @@ func New(tp elastictransport.Interface) *GetJobStats { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -114,6 +122,9 @@ func (r *GetJobStats) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("anomaly_detectors") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "jobid", r.jobid) + } path.WriteString(r.jobid) path.WriteString("/") path.WriteString("_stats") @@ -129,9 +140,9 @@ func (r *GetJobStats) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -148,27 +159,66 @@ func (r *GetJobStats) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetJobStats) Perform(ctx context.Context) (*http.Response, error) { +func (r GetJobStats) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.get_job_stats") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_job_stats") + if reader := instrument.RecordRequestBody(ctx, "ml.get_job_stats", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_job_stats") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetJobStats query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetJobStats query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getjobstats.Response -func (r GetJobStats) Do(ctx context.Context) (*Response, error) { +func (r GetJobStats) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_job_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -176,6 +226,9 @@ func (r GetJobStats) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -185,6 +238,9 @@ func (r GetJobStats) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -192,12 +248,25 @@ func (r GetJobStats) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetJobStats) IsSuccess(ctx context.Context) (bool, error) { +func (r GetJobStats) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_job_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -213,6 +282,14 @@ func (r GetJobStats) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetJobStats query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getjobstats/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getjobstats/response.go index f43b6f2ce..ba34623bd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getjobstats/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getjobstats/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getjobstats @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getjobstats // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/get_job_stats/MlGetJobStatsResponse.ts#L23-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/get_job_stats/MlGetJobStatsResponse.ts#L23-L28 type Response struct { Count int64 `json:"count"` Jobs []types.JobStats `json:"jobs"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getmemorystats/get_memory_stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getmemorystats/get_memory_stats.go index 9f207812c..8bc5da26f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getmemorystats/get_memory_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getmemorystats/get_memory_stats.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns information on how ML is using memory. package getmemorystats import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type GetMemoryStats struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int nodeid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetMemoryStats type alias for index. @@ -80,7 +83,12 @@ func New(tp elastictransport.Interface) *GetMemoryStats { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -114,6 +122,9 @@ func (r *GetMemoryStats) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("memory") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "nodeid", r.nodeid) + } path.WriteString(r.nodeid) path.WriteString("/") path.WriteString("_stats") @@ -129,9 +140,9 @@ func (r *GetMemoryStats) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -148,27 +159,66 @@ func (r *GetMemoryStats) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetMemoryStats) Perform(ctx context.Context) (*http.Response, error) { +func (r GetMemoryStats) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.get_memory_stats") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_memory_stats") + if reader := instrument.RecordRequestBody(ctx, "ml.get_memory_stats", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_memory_stats") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetMemoryStats query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetMemoryStats query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getmemorystats.Response -func (r GetMemoryStats) Do(ctx context.Context) (*Response, error) { +func (r GetMemoryStats) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_memory_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -176,6 +226,9 @@ func (r GetMemoryStats) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -185,6 +238,9 @@ func (r GetMemoryStats) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -192,12 +248,25 @@ func (r GetMemoryStats) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetMemoryStats) IsSuccess(ctx context.Context) (bool, error) { +func (r GetMemoryStats) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_memory_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -213,6 +282,14 @@ func (r GetMemoryStats) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetMemoryStats query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getmemorystats/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getmemorystats/response.go index c64f16e58..f7f9dc01c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getmemorystats/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getmemorystats/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getmemorystats @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getmemorystats // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/get_memory_stats/MlGetMemoryStatsResponse.ts#L25-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/get_memory_stats/MlGetMemoryStatsResponse.ts#L25-L31 type Response struct { ClusterName string `json:"cluster_name"` NodeStats types.NodeStatistics `json:"_nodes"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getmodelsnapshots/get_model_snapshots.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getmodelsnapshots/get_model_snapshots.go index e3b0ab4ef..af0e1308b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getmodelsnapshots/get_model_snapshots.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getmodelsnapshots/get_model_snapshots.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves information about model snapshots. package getmodelsnapshots @@ -53,16 +53,20 @@ type GetModelSnapshots struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int jobid string snapshotid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetModelSnapshots type alias for index. @@ -88,11 +92,18 @@ func New(tp elastictransport.Interface) *GetModelSnapshots { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -129,9 +140,7 @@ func (r *GetModelSnapshots) HttpRequest(ctx context.Context) (*http.Request, err } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -143,6 +152,10 @@ func (r *GetModelSnapshots) HttpRequest(ctx context.Context) (*http.Request, err } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -153,11 +166,17 @@ func (r *GetModelSnapshots) HttpRequest(ctx context.Context) (*http.Request, err path.WriteString("anomaly_detectors") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "jobid", r.jobid) + } path.WriteString(r.jobid) path.WriteString("/") path.WriteString("model_snapshots") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "snapshotid", r.snapshotid) + } path.WriteString(r.snapshotid) method = http.MethodPost @@ -168,6 +187,9 @@ func (r *GetModelSnapshots) HttpRequest(ctx context.Context) (*http.Request, err path.WriteString("anomaly_detectors") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "jobid", r.jobid) + } path.WriteString(r.jobid) path.WriteString("/") path.WriteString("model_snapshots") @@ -183,15 +205,15 @@ func (r *GetModelSnapshots) HttpRequest(ctx context.Context) (*http.Request, err } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -208,27 +230,66 @@ func (r *GetModelSnapshots) HttpRequest(ctx context.Context) (*http.Request, err } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetModelSnapshots) Perform(ctx context.Context) (*http.Response, error) { +func (r GetModelSnapshots) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.get_model_snapshots") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_model_snapshots") + if reader := instrument.RecordRequestBody(ctx, "ml.get_model_snapshots", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_model_snapshots") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetModelSnapshots query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetModelSnapshots query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getmodelsnapshots.Response -func (r GetModelSnapshots) Do(ctx context.Context) (*Response, error) { +func (r GetModelSnapshots) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_model_snapshots") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -236,6 +297,9 @@ func (r GetModelSnapshots) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -245,6 +309,9 @@ func (r GetModelSnapshots) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -252,6 +319,9 @@ func (r GetModelSnapshots) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getmodelsnapshots/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getmodelsnapshots/request.go index 27c90d192..c4628df47 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getmodelsnapshots/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getmodelsnapshots/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getmodelsnapshots @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package getmodelsnapshots // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/get_model_snapshots/MlGetModelSnapshotsRequest.ts#L26-L96 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/get_model_snapshots/MlGetModelSnapshotsRequest.ts#L26-L96 type Request struct { // Desc Refer to the description for the `desc` query parameter. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getmodelsnapshots/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getmodelsnapshots/response.go index 434d9886b..4e5bb1fce 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getmodelsnapshots/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getmodelsnapshots/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getmodelsnapshots @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getmodelsnapshots // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/get_model_snapshots/MlGetModelSnapshotsResponse.ts#L23-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/get_model_snapshots/MlGetModelSnapshotsResponse.ts#L23-L28 type Response struct { Count int64 `json:"count"` ModelSnapshots []types.ModelSnapshot `json:"model_snapshots"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getmodelsnapshotupgradestats/get_model_snapshot_upgrade_stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getmodelsnapshotupgradestats/get_model_snapshot_upgrade_stats.go index af4433337..49a7c208d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getmodelsnapshotupgradestats/get_model_snapshot_upgrade_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getmodelsnapshotupgradestats/get_model_snapshot_upgrade_stats.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Gets stats for anomaly detection job model snapshot upgrades that are in // progress. package getmodelsnapshotupgradestats import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -55,12 +54,16 @@ type GetModelSnapshotUpgradeStats struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int jobid string snapshotid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetModelSnapshotUpgradeStats type alias for index. @@ -89,7 +92,12 @@ func New(tp elastictransport.Interface) *GetModelSnapshotUpgradeStats { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -114,11 +122,17 @@ func (r *GetModelSnapshotUpgradeStats) HttpRequest(ctx context.Context) (*http.R path.WriteString("anomaly_detectors") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "jobid", r.jobid) + } path.WriteString(r.jobid) path.WriteString("/") path.WriteString("model_snapshots") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "snapshotid", r.snapshotid) + } path.WriteString(r.snapshotid) path.WriteString("/") path.WriteString("_upgrade") @@ -136,9 +150,9 @@ func (r *GetModelSnapshotUpgradeStats) HttpRequest(ctx context.Context) (*http.R } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -155,27 +169,66 @@ func (r *GetModelSnapshotUpgradeStats) HttpRequest(ctx context.Context) (*http.R } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetModelSnapshotUpgradeStats) Perform(ctx context.Context) (*http.Response, error) { +func (r GetModelSnapshotUpgradeStats) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.get_model_snapshot_upgrade_stats") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_model_snapshot_upgrade_stats") + if reader := instrument.RecordRequestBody(ctx, "ml.get_model_snapshot_upgrade_stats", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_model_snapshot_upgrade_stats") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetModelSnapshotUpgradeStats query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetModelSnapshotUpgradeStats query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getmodelsnapshotupgradestats.Response -func (r GetModelSnapshotUpgradeStats) Do(ctx context.Context) (*Response, error) { +func (r GetModelSnapshotUpgradeStats) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_model_snapshot_upgrade_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -183,6 +236,9 @@ func (r GetModelSnapshotUpgradeStats) Do(ctx context.Context) (*Response, error) if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -192,6 +248,9 @@ func (r GetModelSnapshotUpgradeStats) Do(ctx context.Context) (*Response, error) errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -199,12 +258,25 @@ func (r GetModelSnapshotUpgradeStats) Do(ctx context.Context) (*Response, error) errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetModelSnapshotUpgradeStats) IsSuccess(ctx context.Context) (bool, error) { +func (r GetModelSnapshotUpgradeStats) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_model_snapshot_upgrade_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -220,6 +292,14 @@ func (r GetModelSnapshotUpgradeStats) IsSuccess(ctx context.Context) (bool, erro return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetModelSnapshotUpgradeStats query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getmodelsnapshotupgradestats/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getmodelsnapshotupgradestats/response.go index 7fbb45af8..f037f384a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getmodelsnapshotupgradestats/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getmodelsnapshotupgradestats/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getmodelsnapshotupgradestats @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getmodelsnapshotupgradestats // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/get_model_snapshot_upgrade_stats/MlGetModelSnapshotUpgradeStatsResponse.ts#L23-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/get_model_snapshot_upgrade_stats/MlGetModelSnapshotUpgradeStatsResponse.ts#L23-L28 type Response struct { Count int64 `json:"count"` ModelSnapshotUpgrades []types.ModelSnapshotUpgrade `json:"model_snapshot_upgrades"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getoverallbuckets/get_overall_buckets.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getoverallbuckets/get_overall_buckets.go index 25bc8f07a..d385e17be 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getoverallbuckets/get_overall_buckets.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getoverallbuckets/get_overall_buckets.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves overall bucket results that summarize the bucket results of // multiple anomaly detection jobs. @@ -51,15 +51,19 @@ type GetOverallBuckets struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int jobid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetOverallBuckets type alias for index. @@ -86,11 +90,18 @@ func New(tp elastictransport.Interface) *GetOverallBuckets { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -127,9 +138,7 @@ func (r *GetOverallBuckets) HttpRequest(ctx context.Context) (*http.Request, err } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -141,6 +150,10 @@ func (r *GetOverallBuckets) HttpRequest(ctx context.Context) (*http.Request, err } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -151,6 +164,9 @@ func (r *GetOverallBuckets) HttpRequest(ctx context.Context) (*http.Request, err path.WriteString("anomaly_detectors") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "jobid", r.jobid) + } path.WriteString(r.jobid) path.WriteString("/") path.WriteString("results") @@ -168,15 +184,15 @@ func (r *GetOverallBuckets) HttpRequest(ctx context.Context) (*http.Request, err } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -193,27 +209,66 @@ func (r *GetOverallBuckets) HttpRequest(ctx context.Context) (*http.Request, err } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetOverallBuckets) Perform(ctx context.Context) (*http.Response, error) { +func (r GetOverallBuckets) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.get_overall_buckets") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_overall_buckets") + if reader := instrument.RecordRequestBody(ctx, "ml.get_overall_buckets", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_overall_buckets") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetOverallBuckets query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetOverallBuckets query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getoverallbuckets.Response -func (r GetOverallBuckets) Do(ctx context.Context) (*Response, error) { +func (r GetOverallBuckets) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_overall_buckets") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -221,6 +276,9 @@ func (r GetOverallBuckets) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -230,6 +288,9 @@ func (r GetOverallBuckets) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -237,6 +298,9 @@ func (r GetOverallBuckets) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getoverallbuckets/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getoverallbuckets/request.go index 14a220adc..bfc085d31 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getoverallbuckets/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getoverallbuckets/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getoverallbuckets @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package getoverallbuckets // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/get_overall_buckets/MlGetOverallBucketsRequest.ts#L25-L143 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/get_overall_buckets/MlGetOverallBucketsRequest.ts#L25-L143 type Request struct { // AllowNoMatch Refer to the description for the `allow_no_match` query parameter. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getoverallbuckets/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getoverallbuckets/response.go index 9aed73bd4..afc4d00bb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getoverallbuckets/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getoverallbuckets/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getoverallbuckets @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getoverallbuckets // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/get_overall_buckets/MlGetOverallBucketsResponse.ts#L23-L29 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/get_overall_buckets/MlGetOverallBucketsResponse.ts#L23-L29 type Response struct { Count int64 `json:"count"` // OverallBuckets Array of overall bucket objects diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getrecords/get_records.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getrecords/get_records.go index 5d3a3364b..ac69ea456 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getrecords/get_records.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getrecords/get_records.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves anomaly records for an anomaly detection job. package getrecords @@ -51,15 +51,19 @@ type GetRecords struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int jobid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetRecords type alias for index. @@ -85,11 +89,18 @@ func New(tp elastictransport.Interface) *GetRecords { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -126,9 +137,7 @@ func (r *GetRecords) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -140,6 +149,10 @@ func (r *GetRecords) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -150,6 +163,9 @@ func (r *GetRecords) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("anomaly_detectors") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "jobid", r.jobid) + } path.WriteString(r.jobid) path.WriteString("/") path.WriteString("results") @@ -167,15 +183,15 @@ func (r *GetRecords) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -192,27 +208,66 @@ func (r *GetRecords) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetRecords) Perform(ctx context.Context) (*http.Response, error) { +func (r GetRecords) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.get_records") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_records") + if reader := instrument.RecordRequestBody(ctx, "ml.get_records", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_records") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetRecords query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetRecords query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getrecords.Response -func (r GetRecords) Do(ctx context.Context) (*Response, error) { +func (r GetRecords) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_records") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -220,6 +275,9 @@ func (r GetRecords) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -229,6 +287,9 @@ func (r GetRecords) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -236,6 +297,9 @@ func (r GetRecords) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getrecords/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getrecords/request.go index f6829e744..f8fc6fddf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getrecords/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getrecords/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getrecords @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package getrecords // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/get_records/MlGetAnomalyRecordsRequest.ts#L26-L127 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/get_records/MlGetAnomalyRecordsRequest.ts#L26-L127 type Request struct { // Desc Refer to the description for the `desc` query parameter. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getrecords/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getrecords/response.go index 78b92dd3f..6eb7a0cb9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getrecords/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/getrecords/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getrecords @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getrecords // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/get_records/MlGetAnomalyRecordsResponse.ts#L23-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/get_records/MlGetAnomalyRecordsResponse.ts#L23-L28 type Response struct { Count int64 `json:"count"` Records []types.Anomaly `json:"records"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/gettrainedmodels/get_trained_models.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/gettrainedmodels/get_trained_models.go index c6249b2b8..88dd19ecb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/gettrainedmodels/get_trained_models.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/gettrainedmodels/get_trained_models.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves configuration information for a trained inference model. package gettrainedmodels import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,11 +52,15 @@ type GetTrainedModels struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int modelid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetTrainedModels type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *GetTrainedModels { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *GetTrainedModels) HttpRequest(ctx context.Context) (*http.Request, erro path.WriteString("trained_models") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "modelid", r.modelid) + } path.WriteString(r.modelid) method = http.MethodGet @@ -126,9 +137,9 @@ func (r *GetTrainedModels) HttpRequest(ctx context.Context) (*http.Request, erro } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -145,27 +156,66 @@ func (r *GetTrainedModels) HttpRequest(ctx context.Context) (*http.Request, erro } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetTrainedModels) Perform(ctx context.Context) (*http.Response, error) { +func (r GetTrainedModels) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.get_trained_models") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_trained_models") + if reader := instrument.RecordRequestBody(ctx, "ml.get_trained_models", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_trained_models") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetTrainedModels query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetTrainedModels query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a gettrainedmodels.Response -func (r GetTrainedModels) Do(ctx context.Context) (*Response, error) { +func (r GetTrainedModels) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_trained_models") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -173,6 +223,9 @@ func (r GetTrainedModels) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,6 +235,9 @@ func (r GetTrainedModels) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -189,12 +245,25 @@ func (r GetTrainedModels) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetTrainedModels) IsSuccess(ctx context.Context) (bool, error) { +func (r GetTrainedModels) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_trained_models") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -210,6 +279,14 @@ func (r GetTrainedModels) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetTrainedModels query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/gettrainedmodels/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/gettrainedmodels/response.go index ded94dfea..985444b5b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/gettrainedmodels/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/gettrainedmodels/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package gettrainedmodels @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package gettrainedmodels // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/get_trained_models/MlGetTrainedModelResponse.ts#L23-L34 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/get_trained_models/MlGetTrainedModelResponse.ts#L23-L34 type Response struct { Count int `json:"count"` // TrainedModelConfigs An array of trained model resources, which are sorted by the model_id value diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/gettrainedmodelsstats/get_trained_models_stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/gettrainedmodelsstats/get_trained_models_stats.go index c6d00c2e3..e5f4ff92e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/gettrainedmodelsstats/get_trained_models_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/gettrainedmodelsstats/get_trained_models_stats.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves usage information for trained inference models. package gettrainedmodelsstats import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type GetTrainedModelsStats struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int modelid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetTrainedModelsStats type alias for index. @@ -80,7 +83,12 @@ func New(tp elastictransport.Interface) *GetTrainedModelsStats { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -105,6 +113,9 @@ func (r *GetTrainedModelsStats) HttpRequest(ctx context.Context) (*http.Request, path.WriteString("trained_models") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "modelid", r.modelid) + } path.WriteString(r.modelid) path.WriteString("/") path.WriteString("_stats") @@ -129,9 +140,9 @@ func (r *GetTrainedModelsStats) HttpRequest(ctx context.Context) (*http.Request, } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -148,27 +159,66 @@ func (r *GetTrainedModelsStats) HttpRequest(ctx context.Context) (*http.Request, } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetTrainedModelsStats) Perform(ctx context.Context) (*http.Response, error) { +func (r GetTrainedModelsStats) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.get_trained_models_stats") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.get_trained_models_stats") + if reader := instrument.RecordRequestBody(ctx, "ml.get_trained_models_stats", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.get_trained_models_stats") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetTrainedModelsStats query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetTrainedModelsStats query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a gettrainedmodelsstats.Response -func (r GetTrainedModelsStats) Do(ctx context.Context) (*Response, error) { +func (r GetTrainedModelsStats) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_trained_models_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -176,6 +226,9 @@ func (r GetTrainedModelsStats) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -185,6 +238,9 @@ func (r GetTrainedModelsStats) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -192,12 +248,25 @@ func (r GetTrainedModelsStats) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetTrainedModelsStats) IsSuccess(ctx context.Context) (bool, error) { +func (r GetTrainedModelsStats) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.get_trained_models_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -213,6 +282,14 @@ func (r GetTrainedModelsStats) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetTrainedModelsStats query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/gettrainedmodelsstats/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/gettrainedmodelsstats/response.go index 1594d6380..512c57f84 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/gettrainedmodelsstats/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/gettrainedmodelsstats/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package gettrainedmodelsstats @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package gettrainedmodelsstats // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/get_trained_models_stats/MlGetTrainedModelStatsResponse.ts#L23-L33 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/get_trained_models_stats/MlGetTrainedModelStatsResponse.ts#L23-L33 type Response struct { // Count The total number of trained model statistics that matched the requested ID diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/infertrainedmodel/infer_trained_model.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/infertrainedmodel/infer_trained_model.go index 17cd99858..6949ba694 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/infertrainedmodel/infer_trained_model.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/infertrainedmodel/infer_trained_model.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Evaluate a trained model. package infertrainedmodel @@ -50,15 +50,19 @@ type InferTrainedModel struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int modelid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewInferTrainedModel type alias for index. @@ -84,11 +88,18 @@ func New(tp elastictransport.Interface) *InferTrainedModel { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -125,9 +136,7 @@ func (r *InferTrainedModel) HttpRequest(ctx context.Context) (*http.Request, err } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -139,6 +148,10 @@ func (r *InferTrainedModel) HttpRequest(ctx context.Context) (*http.Request, err } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -149,6 +162,9 @@ func (r *InferTrainedModel) HttpRequest(ctx context.Context) (*http.Request, err path.WriteString("trained_models") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "modelid", r.modelid) + } path.WriteString(r.modelid) path.WriteString("/") path.WriteString("_infer") @@ -161,6 +177,9 @@ func (r *InferTrainedModel) HttpRequest(ctx context.Context) (*http.Request, err path.WriteString("trained_models") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "modelid", r.modelid) + } path.WriteString(r.modelid) path.WriteString("/") path.WriteString("deployment") @@ -178,15 +197,15 @@ func (r *InferTrainedModel) HttpRequest(ctx context.Context) (*http.Request, err } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -203,27 +222,66 @@ func (r *InferTrainedModel) HttpRequest(ctx context.Context) (*http.Request, err } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r InferTrainedModel) Perform(ctx context.Context) (*http.Response, error) { +func (r InferTrainedModel) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.infer_trained_model") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.infer_trained_model") + if reader := instrument.RecordRequestBody(ctx, "ml.infer_trained_model", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.infer_trained_model") + } if err != nil { - return nil, fmt.Errorf("an error happened during the InferTrainedModel query execution: %w", err) + localErr := fmt.Errorf("an error happened during the InferTrainedModel query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a infertrainedmodel.Response -func (r InferTrainedModel) Do(ctx context.Context) (*Response, error) { +func (r InferTrainedModel) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.infer_trained_model") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -231,6 +289,9 @@ func (r InferTrainedModel) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -240,6 +301,9 @@ func (r InferTrainedModel) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -247,6 +311,9 @@ func (r InferTrainedModel) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/infertrainedmodel/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/infertrainedmodel/request.go index c6b63e1a8..f9d43618c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/infertrainedmodel/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/infertrainedmodel/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package infertrainedmodel @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package infertrainedmodel // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/infer_trained_model/MlInferTrainedModelRequest.ts#L27-L59 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/infer_trained_model/MlInferTrainedModelRequest.ts#L27-L59 type Request struct { // Docs An array of objects to pass to the model for inference. The objects should diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/infertrainedmodel/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/infertrainedmodel/response.go index 79add5db1..81f47d953 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/infertrainedmodel/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/infertrainedmodel/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package infertrainedmodel @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package infertrainedmodel // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/infer_trained_model/MlInferTrainedModelResponse.ts#L22-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/infer_trained_model/MlInferTrainedModelResponse.ts#L22-L26 type Response struct { InferenceResults []types.InferenceResponseResult `json:"inference_results"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/info/info.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/info/info.go index 89b5d3260..47a83542d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/info/info.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/info/info.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns defaults and limits used by machine learning. package info import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -47,9 +46,13 @@ type Info struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewInfo type alias for index. @@ -73,7 +76,12 @@ func New(tp elastictransport.Interface) *Info { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,9 +116,9 @@ func (r *Info) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -127,27 +135,66 @@ func (r *Info) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Info) Perform(ctx context.Context) (*http.Response, error) { +func (r Info) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.info") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.info") + if reader := instrument.RecordRequestBody(ctx, "ml.info", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.info") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Info query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Info query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a info.Response -func (r Info) Do(ctx context.Context) (*Response, error) { +func (r Info) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.info") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -155,6 +202,9 @@ func (r Info) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -164,6 +214,9 @@ func (r Info) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -171,12 +224,25 @@ func (r Info) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Info) IsSuccess(ctx context.Context) (bool, error) { +func (r Info) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.info") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -192,6 +258,14 @@ func (r Info) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Info query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/info/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/info/response.go index 110165cc5..fd86db13c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/info/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/info/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package info @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package info // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/info/MlInfoResponse.ts#L22-L29 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/info/MlInfoResponse.ts#L22-L29 type Response struct { Defaults types.Defaults `json:"defaults"` Limits types.Limits `json:"limits"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/openjob/open_job.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/openjob/open_job.go index ce7687583..155736e09 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/openjob/open_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/openjob/open_job.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Opens one or more anomaly detection jobs. package openjob @@ -50,15 +50,19 @@ type OpenJob struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int jobid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewOpenJob type alias for index. @@ -84,11 +88,18 @@ func New(tp elastictransport.Interface) *OpenJob { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -125,9 +136,7 @@ func (r *OpenJob) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -139,6 +148,10 @@ func (r *OpenJob) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -149,6 +162,9 @@ func (r *OpenJob) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("anomaly_detectors") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "jobid", r.jobid) + } path.WriteString(r.jobid) path.WriteString("/") path.WriteString("_open") @@ -164,15 +180,15 @@ func (r *OpenJob) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -189,27 +205,66 @@ func (r *OpenJob) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r OpenJob) Perform(ctx context.Context) (*http.Response, error) { +func (r OpenJob) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.open_job") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.open_job") + if reader := instrument.RecordRequestBody(ctx, "ml.open_job", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.open_job") + } if err != nil { - return nil, fmt.Errorf("an error happened during the OpenJob query execution: %w", err) + localErr := fmt.Errorf("an error happened during the OpenJob query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a openjob.Response -func (r OpenJob) Do(ctx context.Context) (*Response, error) { +func (r OpenJob) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.open_job") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -217,6 +272,9 @@ func (r OpenJob) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -226,6 +284,9 @@ func (r OpenJob) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -233,6 +294,9 @@ func (r OpenJob) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/openjob/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/openjob/request.go index 45325104e..7b985cdd7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/openjob/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/openjob/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package openjob @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package openjob // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/open_job/MlOpenJobRequest.ts#L24-L59 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/open_job/MlOpenJobRequest.ts#L24-L59 type Request struct { // Timeout Refer to the description for the `timeout` query parameter. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/openjob/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/openjob/response.go index 9c4cb186f..e74c3d510 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/openjob/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/openjob/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package openjob // Response holds the response body struct for the package openjob // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/open_job/MlOpenJobResponse.ts#L22-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/open_job/MlOpenJobResponse.ts#L22-L31 type Response struct { // Node The ID of the node that the job was started on. In serverless this will be diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/postcalendarevents/post_calendar_events.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/postcalendarevents/post_calendar_events.go index 82daaa3be..08fedd92a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/postcalendarevents/post_calendar_events.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/postcalendarevents/post_calendar_events.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Posts scheduled events in a calendar. package postcalendarevents @@ -50,15 +50,19 @@ type PostCalendarEvents struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int calendarid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPostCalendarEvents type alias for index. @@ -84,11 +88,18 @@ func New(tp elastictransport.Interface) *PostCalendarEvents { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -125,9 +136,7 @@ func (r *PostCalendarEvents) HttpRequest(ctx context.Context) (*http.Request, er } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -139,6 +148,10 @@ func (r *PostCalendarEvents) HttpRequest(ctx context.Context) (*http.Request, er } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -149,6 +162,9 @@ func (r *PostCalendarEvents) HttpRequest(ctx context.Context) (*http.Request, er path.WriteString("calendars") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "calendarid", r.calendarid) + } path.WriteString(r.calendarid) path.WriteString("/") path.WriteString("events") @@ -164,15 +180,15 @@ func (r *PostCalendarEvents) HttpRequest(ctx context.Context) (*http.Request, er } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -189,27 +205,66 @@ func (r *PostCalendarEvents) HttpRequest(ctx context.Context) (*http.Request, er } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PostCalendarEvents) Perform(ctx context.Context) (*http.Response, error) { +func (r PostCalendarEvents) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.post_calendar_events") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.post_calendar_events") + if reader := instrument.RecordRequestBody(ctx, "ml.post_calendar_events", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.post_calendar_events") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PostCalendarEvents query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PostCalendarEvents query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a postcalendarevents.Response -func (r PostCalendarEvents) Do(ctx context.Context) (*Response, error) { +func (r PostCalendarEvents) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.post_calendar_events") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -217,6 +272,9 @@ func (r PostCalendarEvents) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -226,6 +284,9 @@ func (r PostCalendarEvents) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -233,6 +294,9 @@ func (r PostCalendarEvents) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/postcalendarevents/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/postcalendarevents/request.go index d34108848..184f84acb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/postcalendarevents/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/postcalendarevents/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package postcalendarevents @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package postcalendarevents // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/post_calendar_events/MlPostCalendarEventsRequest.ts#L24-L40 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/post_calendar_events/MlPostCalendarEventsRequest.ts#L24-L40 type Request struct { // Events A list of one of more scheduled events. The event’s start and end times can diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/postcalendarevents/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/postcalendarevents/response.go index cd469d435..02d3f9346 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/postcalendarevents/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/postcalendarevents/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package postcalendarevents @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package postcalendarevents // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/post_calendar_events/MlPostCalendarEventsResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/post_calendar_events/MlPostCalendarEventsResponse.ts#L22-L24 type Response struct { Events []types.CalendarEvent `json:"events"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/postdata/post_data.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/postdata/post_data.go index 20b4570c5..13b5a5c47 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/postdata/post_data.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/postdata/post_data.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Sends data to an anomaly detection job for analysis. package postdata @@ -50,15 +50,19 @@ type PostData struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int jobid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPostData type alias for index. @@ -84,7 +88,14 @@ func New(tp elastictransport.Interface) *PostData { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -123,9 +134,7 @@ func (r *PostData) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -137,6 +146,10 @@ func (r *PostData) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -147,6 +160,9 @@ func (r *PostData) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("anomaly_detectors") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "jobid", r.jobid) + } path.WriteString(r.jobid) path.WriteString("/") path.WriteString("_data") @@ -162,15 +178,15 @@ func (r *PostData) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -187,27 +203,66 @@ func (r *PostData) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PostData) Perform(ctx context.Context) (*http.Response, error) { +func (r PostData) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.post_data") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.post_data") + if reader := instrument.RecordRequestBody(ctx, "ml.post_data", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.post_data") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PostData query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PostData query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a postdata.Response -func (r PostData) Do(ctx context.Context) (*Response, error) { +func (r PostData) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.post_data") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -215,6 +270,9 @@ func (r PostData) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -224,6 +282,9 @@ func (r PostData) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -231,6 +292,9 @@ func (r PostData) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/postdata/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/postdata/request.go index dcd2a31be..c8d66d55b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/postdata/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/postdata/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package postdata @@ -26,5 +26,5 @@ import ( // Request holds the request body struct for the package postdata // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/post_data/MlPostJobDataRequest.ts#L24-L68 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/post_data/MlPostJobDataRequest.ts#L24-L68 type Request = []json.RawMessage diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/postdata/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/postdata/response.go index ba9e70df5..ab14bfa27 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/postdata/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/postdata/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package postdata // Response holds the response body struct for the package postdata // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/post_data/MlPostJobDataResponse.ts#L23-L41 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/post_data/MlPostJobDataResponse.ts#L23-L41 type Response struct { BucketCount int64 `json:"bucket_count"` EarliestRecordTimestamp int64 `json:"earliest_record_timestamp"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/previewdatafeed/preview_datafeed.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/previewdatafeed/preview_datafeed.go index e401d8dfb..c43524225 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/previewdatafeed/preview_datafeed.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/previewdatafeed/preview_datafeed.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Previews a datafeed. package previewdatafeed @@ -50,15 +50,19 @@ type PreviewDatafeed struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int datafeedid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPreviewDatafeed type alias for index. @@ -82,11 +86,18 @@ func New(tp elastictransport.Interface) *PreviewDatafeed { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -123,9 +134,7 @@ func (r *PreviewDatafeed) HttpRequest(ctx context.Context) (*http.Request, error } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -137,6 +146,10 @@ func (r *PreviewDatafeed) HttpRequest(ctx context.Context) (*http.Request, error } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -147,6 +160,9 @@ func (r *PreviewDatafeed) HttpRequest(ctx context.Context) (*http.Request, error path.WriteString("datafeeds") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "datafeedid", r.datafeedid) + } path.WriteString(r.datafeedid) path.WriteString("/") path.WriteString("_preview") @@ -171,15 +187,15 @@ func (r *PreviewDatafeed) HttpRequest(ctx context.Context) (*http.Request, error } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -196,27 +212,66 @@ func (r *PreviewDatafeed) HttpRequest(ctx context.Context) (*http.Request, error } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PreviewDatafeed) Perform(ctx context.Context) (*http.Response, error) { +func (r PreviewDatafeed) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.preview_datafeed") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.preview_datafeed") + if reader := instrument.RecordRequestBody(ctx, "ml.preview_datafeed", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.preview_datafeed") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PreviewDatafeed query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PreviewDatafeed query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a previewdatafeed.Response -func (r PreviewDatafeed) Do(ctx context.Context) (Response, error) { +func (r PreviewDatafeed) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.preview_datafeed") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -224,6 +279,9 @@ func (r PreviewDatafeed) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -233,6 +291,9 @@ func (r PreviewDatafeed) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -240,6 +301,9 @@ func (r PreviewDatafeed) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/previewdatafeed/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/previewdatafeed/request.go index aa1983da5..609e61b57 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/previewdatafeed/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/previewdatafeed/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package previewdatafeed @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package previewdatafeed // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/preview_datafeed/MlPreviewDatafeedRequest.ts#L26-L69 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/preview_datafeed/MlPreviewDatafeedRequest.ts#L26-L69 type Request struct { // DatafeedConfig The datafeed definition to preview. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/previewdatafeed/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/previewdatafeed/response.go index 2c6cbfe34..71c7c1b98 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/previewdatafeed/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/previewdatafeed/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package previewdatafeed @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package previewdatafeed // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/preview_datafeed/MlPreviewDatafeedResponse.ts#L20-L22 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/preview_datafeed/MlPreviewDatafeedResponse.ts#L20-L22 type Response []json.RawMessage diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/previewdataframeanalytics/preview_data_frame_analytics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/previewdataframeanalytics/preview_data_frame_analytics.go index 0b03e1dd7..360f79099 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/previewdataframeanalytics/preview_data_frame_analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/previewdataframeanalytics/preview_data_frame_analytics.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Previews that will be analyzed given a data frame analytics config. package previewdataframeanalytics @@ -50,15 +50,19 @@ type PreviewDataFrameAnalytics struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPreviewDataFrameAnalytics type alias for index. @@ -82,11 +86,18 @@ func New(tp elastictransport.Interface) *PreviewDataFrameAnalytics { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -123,9 +134,7 @@ func (r *PreviewDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Requ } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -137,6 +146,10 @@ func (r *PreviewDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Requ } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -160,6 +173,9 @@ func (r *PreviewDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Requ path.WriteString("analytics") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) path.WriteString("/") path.WriteString("_preview") @@ -175,15 +191,15 @@ func (r *PreviewDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Requ } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -200,27 +216,66 @@ func (r *PreviewDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Requ } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PreviewDataFrameAnalytics) Perform(ctx context.Context) (*http.Response, error) { +func (r PreviewDataFrameAnalytics) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.preview_data_frame_analytics") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.preview_data_frame_analytics") + if reader := instrument.RecordRequestBody(ctx, "ml.preview_data_frame_analytics", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.preview_data_frame_analytics") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PreviewDataFrameAnalytics query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PreviewDataFrameAnalytics query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a previewdataframeanalytics.Response -func (r PreviewDataFrameAnalytics) Do(ctx context.Context) (*Response, error) { +func (r PreviewDataFrameAnalytics) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.preview_data_frame_analytics") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -228,6 +283,9 @@ func (r PreviewDataFrameAnalytics) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -237,6 +295,9 @@ func (r PreviewDataFrameAnalytics) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -244,6 +305,9 @@ func (r PreviewDataFrameAnalytics) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/previewdataframeanalytics/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/previewdataframeanalytics/request.go index ca15c27f2..619824bed 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/previewdataframeanalytics/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/previewdataframeanalytics/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package previewdataframeanalytics @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package previewdataframeanalytics // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/preview_data_frame_analytics/MlPreviewDataFrameAnalyticsRequest.ts#L24-L47 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/preview_data_frame_analytics/MlPreviewDataFrameAnalyticsRequest.ts#L24-L47 type Request struct { // Config A data frame analytics config as described in create data frame analytics diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/previewdataframeanalytics/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/previewdataframeanalytics/response.go index 8ee350f07..c8ba5ccc5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/previewdataframeanalytics/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/previewdataframeanalytics/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package previewdataframeanalytics // Response holds the response body struct for the package previewdataframeanalytics // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/preview_data_frame_analytics/MlPreviewDataFrameAnalyticsResponse.ts#L23-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/preview_data_frame_analytics/MlPreviewDataFrameAnalyticsResponse.ts#L23-L28 type Response struct { // FeatureValues An array of objects that contain feature name and value pairs. The features diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putcalendar/put_calendar.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putcalendar/put_calendar.go index c8fbebf2e..bdc9e4df4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putcalendar/put_calendar.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putcalendar/put_calendar.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Instantiates a calendar. package putcalendar @@ -50,15 +50,19 @@ type PutCalendar struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int calendarid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutCalendar type alias for index. @@ -84,11 +88,18 @@ func New(tp elastictransport.Interface) *PutCalendar { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -125,9 +136,7 @@ func (r *PutCalendar) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -139,6 +148,10 @@ func (r *PutCalendar) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -149,6 +162,9 @@ func (r *PutCalendar) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("calendars") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "calendarid", r.calendarid) + } path.WriteString(r.calendarid) method = http.MethodPut @@ -162,15 +178,15 @@ func (r *PutCalendar) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -187,27 +203,66 @@ func (r *PutCalendar) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutCalendar) Perform(ctx context.Context) (*http.Response, error) { +func (r PutCalendar) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.put_calendar") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.put_calendar") + if reader := instrument.RecordRequestBody(ctx, "ml.put_calendar", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.put_calendar") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutCalendar query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutCalendar query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a putcalendar.Response -func (r PutCalendar) Do(ctx context.Context) (*Response, error) { +func (r PutCalendar) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.put_calendar") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -215,6 +270,9 @@ func (r PutCalendar) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -224,6 +282,9 @@ func (r PutCalendar) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -231,6 +292,9 @@ func (r PutCalendar) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putcalendar/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putcalendar/request.go index 300cdc02f..c488c5728 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putcalendar/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putcalendar/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putcalendar @@ -27,7 +27,7 @@ import ( // Request holds the request body struct for the package putcalendar // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/put_calendar/MlPutCalendarRequest.ts#L23-L43 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/put_calendar/MlPutCalendarRequest.ts#L23-L43 type Request struct { // Description A description of the calendar. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putcalendar/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putcalendar/response.go index 02acf19af..8d04c8872 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putcalendar/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putcalendar/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putcalendar @@ -30,7 +30,7 @@ import ( // Response holds the response body struct for the package putcalendar // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/put_calendar/MlPutCalendarResponse.ts#L22-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/put_calendar/MlPutCalendarResponse.ts#L22-L31 type Response struct { // CalendarId A string that uniquely identifies a calendar. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putcalendarjob/put_calendar_job.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putcalendarjob/put_calendar_job.go index 37b8c4dc6..3c220dc72 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putcalendarjob/put_calendar_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putcalendarjob/put_calendar_job.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Adds an anomaly detection job to a calendar. package putcalendarjob import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,12 +52,16 @@ type PutCalendarJob struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int calendarid string jobid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutCalendarJob type alias for index. @@ -86,7 +89,12 @@ func New(tp elastictransport.Interface) *PutCalendarJob { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -111,11 +119,17 @@ func (r *PutCalendarJob) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("calendars") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "calendarid", r.calendarid) + } path.WriteString(r.calendarid) path.WriteString("/") path.WriteString("jobs") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "jobid", r.jobid) + } path.WriteString(r.jobid) method = http.MethodPut @@ -129,9 +143,9 @@ func (r *PutCalendarJob) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -148,27 +162,66 @@ func (r *PutCalendarJob) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutCalendarJob) Perform(ctx context.Context) (*http.Response, error) { +func (r PutCalendarJob) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.put_calendar_job") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.put_calendar_job") + if reader := instrument.RecordRequestBody(ctx, "ml.put_calendar_job", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.put_calendar_job") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutCalendarJob query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutCalendarJob query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a putcalendarjob.Response -func (r PutCalendarJob) Do(ctx context.Context) (*Response, error) { +func (r PutCalendarJob) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.put_calendar_job") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -176,6 +229,9 @@ func (r PutCalendarJob) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -185,6 +241,9 @@ func (r PutCalendarJob) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -192,12 +251,25 @@ func (r PutCalendarJob) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r PutCalendarJob) IsSuccess(ctx context.Context) (bool, error) { +func (r PutCalendarJob) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.put_calendar_job") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -213,6 +285,14 @@ func (r PutCalendarJob) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the PutCalendarJob query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putcalendarjob/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putcalendarjob/response.go index f49ca094c..873f4daf8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putcalendarjob/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putcalendarjob/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putcalendarjob @@ -30,7 +30,7 @@ import ( // Response holds the response body struct for the package putcalendarjob // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/put_calendar_job/MlPutCalendarJobResponse.ts#L22-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/put_calendar_job/MlPutCalendarJobResponse.ts#L22-L31 type Response struct { // CalendarId A string that uniquely identifies a calendar. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putdatafeed/put_datafeed.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putdatafeed/put_datafeed.go index f9ce4f4d2..f5ef00e8b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putdatafeed/put_datafeed.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putdatafeed/put_datafeed.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Instantiates a datafeed. package putdatafeed @@ -52,15 +52,19 @@ type PutDatafeed struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int datafeedid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutDatafeed type alias for index. @@ -86,11 +90,18 @@ func New(tp elastictransport.Interface) *PutDatafeed { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -127,9 +138,7 @@ func (r *PutDatafeed) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -141,6 +150,10 @@ func (r *PutDatafeed) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -151,6 +164,9 @@ func (r *PutDatafeed) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("datafeeds") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "datafeedid", r.datafeedid) + } path.WriteString(r.datafeedid) method = http.MethodPut @@ -164,15 +180,15 @@ func (r *PutDatafeed) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -189,27 +205,66 @@ func (r *PutDatafeed) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutDatafeed) Perform(ctx context.Context) (*http.Response, error) { +func (r PutDatafeed) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.put_datafeed") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.put_datafeed") + if reader := instrument.RecordRequestBody(ctx, "ml.put_datafeed", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.put_datafeed") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutDatafeed query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutDatafeed query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a putdatafeed.Response -func (r PutDatafeed) Do(ctx context.Context) (*Response, error) { +func (r PutDatafeed) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.put_datafeed") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -217,6 +272,9 @@ func (r PutDatafeed) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -226,6 +284,9 @@ func (r PutDatafeed) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -233,6 +294,9 @@ func (r PutDatafeed) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putdatafeed/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putdatafeed/request.go index 7887ef946..dc712a0f9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putdatafeed/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putdatafeed/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putdatafeed @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package putdatafeed // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/put_datafeed/MlPutDatafeedRequest.ts#L37-L172 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/put_datafeed/MlPutDatafeedRequest.ts#L37-L172 type Request struct { // Aggregations If set, the datafeed performs aggregation searches. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putdatafeed/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putdatafeed/response.go index 567feda0d..c1aff841c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putdatafeed/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putdatafeed/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putdatafeed @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package putdatafeed // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/put_datafeed/MlPutDatafeedResponse.ts#L31-L49 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/put_datafeed/MlPutDatafeedResponse.ts#L31-L49 type Response struct { Aggregations map[string]types.Aggregations `json:"aggregations,omitempty"` Authorization *types.DatafeedAuthorization `json:"authorization,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putdataframeanalytics/put_data_frame_analytics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putdataframeanalytics/put_data_frame_analytics.go index d616f492e..cb49bd394 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putdataframeanalytics/put_data_frame_analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putdataframeanalytics/put_data_frame_analytics.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Instantiates a data frame analytics job. package putdataframeanalytics @@ -50,15 +50,19 @@ type PutDataFrameAnalytics struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutDataFrameAnalytics type alias for index. @@ -84,11 +88,18 @@ func New(tp elastictransport.Interface) *PutDataFrameAnalytics { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -125,9 +136,7 @@ func (r *PutDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Request, } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -139,6 +148,10 @@ func (r *PutDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Request, } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -151,6 +164,9 @@ func (r *PutDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Request, path.WriteString("analytics") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodPut @@ -164,15 +180,15 @@ func (r *PutDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Request, } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -189,27 +205,66 @@ func (r *PutDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Request, } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutDataFrameAnalytics) Perform(ctx context.Context) (*http.Response, error) { +func (r PutDataFrameAnalytics) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.put_data_frame_analytics") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.put_data_frame_analytics") + if reader := instrument.RecordRequestBody(ctx, "ml.put_data_frame_analytics", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.put_data_frame_analytics") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutDataFrameAnalytics query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutDataFrameAnalytics query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a putdataframeanalytics.Response -func (r PutDataFrameAnalytics) Do(ctx context.Context) (*Response, error) { +func (r PutDataFrameAnalytics) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.put_data_frame_analytics") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -217,6 +272,9 @@ func (r PutDataFrameAnalytics) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -226,6 +284,9 @@ func (r PutDataFrameAnalytics) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -233,6 +294,9 @@ func (r PutDataFrameAnalytics) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putdataframeanalytics/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putdataframeanalytics/request.go index 5eddbfa90..119c2d022 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putdataframeanalytics/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putdataframeanalytics/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putdataframeanalytics @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package putdataframeanalytics // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/put_data_frame_analytics/MlPutDataFrameAnalyticsRequest.ts#L30-L141 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/put_data_frame_analytics/MlPutDataFrameAnalyticsRequest.ts#L30-L141 type Request struct { // AllowLazyStart Specifies whether this job can start when there is insufficient machine diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putdataframeanalytics/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putdataframeanalytics/response.go index ac0977bde..ac0118e77 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putdataframeanalytics/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putdataframeanalytics/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putdataframeanalytics @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package putdataframeanalytics // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/put_data_frame_analytics/MlPutDataFrameAnalyticsResponse.ts#L31-L46 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/put_data_frame_analytics/MlPutDataFrameAnalyticsResponse.ts#L31-L46 type Response struct { AllowLazyStart bool `json:"allow_lazy_start"` Analysis types.DataframeAnalysisContainer `json:"analysis"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putfilter/put_filter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putfilter/put_filter.go index 2b8de324c..346003d8c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putfilter/put_filter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putfilter/put_filter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Instantiates a filter. package putfilter @@ -50,15 +50,19 @@ type PutFilter struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int filterid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutFilter type alias for index. @@ -84,11 +88,18 @@ func New(tp elastictransport.Interface) *PutFilter { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -125,9 +136,7 @@ func (r *PutFilter) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -139,6 +148,10 @@ func (r *PutFilter) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -149,6 +162,9 @@ func (r *PutFilter) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("filters") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "filterid", r.filterid) + } path.WriteString(r.filterid) method = http.MethodPut @@ -162,15 +178,15 @@ func (r *PutFilter) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -187,27 +203,66 @@ func (r *PutFilter) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutFilter) Perform(ctx context.Context) (*http.Response, error) { +func (r PutFilter) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.put_filter") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.put_filter") + if reader := instrument.RecordRequestBody(ctx, "ml.put_filter", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.put_filter") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutFilter query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutFilter query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a putfilter.Response -func (r PutFilter) Do(ctx context.Context) (*Response, error) { +func (r PutFilter) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.put_filter") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -215,6 +270,9 @@ func (r PutFilter) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -224,6 +282,9 @@ func (r PutFilter) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -231,6 +292,9 @@ func (r PutFilter) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putfilter/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putfilter/request.go index e28552686..8010ecea6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putfilter/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putfilter/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putfilter @@ -27,7 +27,7 @@ import ( // Request holds the request body struct for the package putfilter // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/put_filter/MlPutFilterRequest.ts#L23-L50 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/put_filter/MlPutFilterRequest.ts#L23-L50 type Request struct { // Description A description of the filter. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putfilter/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putfilter/response.go index df7a95740..37887811e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putfilter/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putfilter/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putfilter // Response holds the response body struct for the package putfilter // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/put_filter/MlPutFilterResponse.ts#L22-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/put_filter/MlPutFilterResponse.ts#L22-L28 type Response struct { Description string `json:"description"` FilterId string `json:"filter_id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putjob/put_job.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putjob/put_job.go index 7777c4945..ee5408009 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putjob/put_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putjob/put_job.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Instantiates an anomaly detection job. package putjob @@ -50,15 +50,19 @@ type PutJob struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int jobid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutJob type alias for index. @@ -84,11 +88,18 @@ func New(tp elastictransport.Interface) *PutJob { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -125,9 +136,7 @@ func (r *PutJob) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -139,6 +148,10 @@ func (r *PutJob) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -149,6 +162,9 @@ func (r *PutJob) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("anomaly_detectors") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "jobid", r.jobid) + } path.WriteString(r.jobid) method = http.MethodPut @@ -162,15 +178,15 @@ func (r *PutJob) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -187,27 +203,66 @@ func (r *PutJob) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutJob) Perform(ctx context.Context) (*http.Response, error) { +func (r PutJob) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.put_job") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.put_job") + if reader := instrument.RecordRequestBody(ctx, "ml.put_job", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.put_job") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutJob query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutJob query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a putjob.Response -func (r PutJob) Do(ctx context.Context) (*Response, error) { +func (r PutJob) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.put_job") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -215,6 +270,9 @@ func (r PutJob) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -224,6 +282,9 @@ func (r PutJob) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -231,6 +292,9 @@ func (r PutJob) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putjob/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putjob/request.go index fc8e8646a..2f17fc4d8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putjob/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putjob/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putjob @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package putjob // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/put_job/MlPutJobRequest.ts#L30-L111 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/put_job/MlPutJobRequest.ts#L30-L111 type Request struct { // AllowLazyOpen Advanced configuration option. Specifies whether this job can open when there diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putjob/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putjob/response.go index 9e450a68d..946377134 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putjob/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/putjob/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putjob @@ -28,7 +28,7 @@ import ( // Response holds the response body struct for the package putjob // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/put_job/MlPutJobResponse.ts#L29-L52 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/put_job/MlPutJobResponse.ts#L29-L52 type Response struct { AllowLazyOpen bool `json:"allow_lazy_open"` AnalysisConfig types.AnalysisConfigRead `json:"analysis_config"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodel/put_trained_model.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodel/put_trained_model.go index 13bc85ebb..87e1afd1d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodel/put_trained_model.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodel/put_trained_model.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates an inference trained model. package puttrainedmodel @@ -52,15 +52,19 @@ type PutTrainedModel struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int modelid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutTrainedModel type alias for index. @@ -86,11 +90,18 @@ func New(tp elastictransport.Interface) *PutTrainedModel { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -127,9 +138,7 @@ func (r *PutTrainedModel) HttpRequest(ctx context.Context) (*http.Request, error } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -141,6 +150,10 @@ func (r *PutTrainedModel) HttpRequest(ctx context.Context) (*http.Request, error } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -151,6 +164,9 @@ func (r *PutTrainedModel) HttpRequest(ctx context.Context) (*http.Request, error path.WriteString("trained_models") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "modelid", r.modelid) + } path.WriteString(r.modelid) method = http.MethodPut @@ -164,15 +180,15 @@ func (r *PutTrainedModel) HttpRequest(ctx context.Context) (*http.Request, error } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -189,27 +205,66 @@ func (r *PutTrainedModel) HttpRequest(ctx context.Context) (*http.Request, error } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutTrainedModel) Perform(ctx context.Context) (*http.Response, error) { +func (r PutTrainedModel) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.put_trained_model") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.put_trained_model") + if reader := instrument.RecordRequestBody(ctx, "ml.put_trained_model", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.put_trained_model") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutTrainedModel query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutTrainedModel query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a puttrainedmodel.Response -func (r PutTrainedModel) Do(ctx context.Context) (*Response, error) { +func (r PutTrainedModel) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.put_trained_model") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -217,6 +272,9 @@ func (r PutTrainedModel) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -226,6 +284,9 @@ func (r PutTrainedModel) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -233,6 +294,9 @@ func (r PutTrainedModel) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodel/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodel/request.go index 119ae4f33..007e1a7af 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodel/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodel/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package puttrainedmodel @@ -30,7 +30,7 @@ import ( // Request holds the request body struct for the package puttrainedmodel // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/put_trained_model/MlPutTrainedModelRequest.ts#L28-L106 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/put_trained_model/MlPutTrainedModelRequest.ts#L28-L106 type Request struct { // CompressedDefinition The compressed (GZipped and Base64 encoded) inference definition of the diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodel/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodel/response.go index 65532f268..e65dfc2e1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodel/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodel/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package puttrainedmodel @@ -27,7 +27,7 @@ import ( // Response holds the response body struct for the package puttrainedmodel // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/put_trained_model/MlPutTrainedModelResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/put_trained_model/MlPutTrainedModelResponse.ts#L22-L24 type Response struct { CompressedDefinition *string `json:"compressed_definition,omitempty"` // CreateTime The time when the trained model was created. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodelalias/put_trained_model_alias.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodelalias/put_trained_model_alias.go index 917d9228f..47cbf7275 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodelalias/put_trained_model_alias.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodelalias/put_trained_model_alias.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates a new model alias (or reassigns an existing one) to refer to the // trained model package puttrainedmodelalias import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -55,12 +54,16 @@ type PutTrainedModelAlias struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int modelalias string modelid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutTrainedModelAlias type alias for index. @@ -89,7 +92,12 @@ func New(tp elastictransport.Interface) *PutTrainedModelAlias { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -114,11 +122,17 @@ func (r *PutTrainedModelAlias) HttpRequest(ctx context.Context) (*http.Request, path.WriteString("trained_models") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "modelid", r.modelid) + } path.WriteString(r.modelid) path.WriteString("/") path.WriteString("model_aliases") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "modelalias", r.modelalias) + } path.WriteString(r.modelalias) method = http.MethodPut @@ -132,15 +146,15 @@ func (r *PutTrainedModelAlias) HttpRequest(ctx context.Context) (*http.Request, } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -157,27 +171,66 @@ func (r *PutTrainedModelAlias) HttpRequest(ctx context.Context) (*http.Request, } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutTrainedModelAlias) Perform(ctx context.Context) (*http.Response, error) { +func (r PutTrainedModelAlias) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.put_trained_model_alias") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.put_trained_model_alias") + if reader := instrument.RecordRequestBody(ctx, "ml.put_trained_model_alias", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.put_trained_model_alias") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutTrainedModelAlias query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutTrainedModelAlias query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a puttrainedmodelalias.Response -func (r PutTrainedModelAlias) Do(ctx context.Context) (*Response, error) { +func (r PutTrainedModelAlias) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.put_trained_model_alias") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -185,6 +238,9 @@ func (r PutTrainedModelAlias) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -194,6 +250,9 @@ func (r PutTrainedModelAlias) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -201,12 +260,25 @@ func (r PutTrainedModelAlias) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r PutTrainedModelAlias) IsSuccess(ctx context.Context) (bool, error) { +func (r PutTrainedModelAlias) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.put_trained_model_alias") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -222,6 +294,14 @@ func (r PutTrainedModelAlias) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the PutTrainedModelAlias query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodelalias/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodelalias/response.go index 4954b8c62..c394e8728 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodelalias/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodelalias/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package puttrainedmodelalias // Response holds the response body struct for the package puttrainedmodelalias // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/put_trained_model_alias/MlPutTrainedModelAliasResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/put_trained_model_alias/MlPutTrainedModelAliasResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodeldefinitionpart/put_trained_model_definition_part.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodeldefinitionpart/put_trained_model_definition_part.go index dd0ea089a..677d0e49c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodeldefinitionpart/put_trained_model_definition_part.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodeldefinitionpart/put_trained_model_definition_part.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates part of a trained model definition package puttrainedmodeldefinitionpart @@ -52,16 +52,20 @@ type PutTrainedModelDefinitionPart struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int modelid string part string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutTrainedModelDefinitionPart type alias for index. @@ -89,11 +93,18 @@ func New(tp elastictransport.Interface) *PutTrainedModelDefinitionPart { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -130,9 +141,7 @@ func (r *PutTrainedModelDefinitionPart) HttpRequest(ctx context.Context) (*http. } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -144,6 +153,10 @@ func (r *PutTrainedModelDefinitionPart) HttpRequest(ctx context.Context) (*http. } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -154,11 +167,17 @@ func (r *PutTrainedModelDefinitionPart) HttpRequest(ctx context.Context) (*http. path.WriteString("trained_models") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "modelid", r.modelid) + } path.WriteString(r.modelid) path.WriteString("/") path.WriteString("definition") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "part", r.part) + } path.WriteString(r.part) method = http.MethodPut @@ -172,15 +191,15 @@ func (r *PutTrainedModelDefinitionPart) HttpRequest(ctx context.Context) (*http. } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -197,27 +216,66 @@ func (r *PutTrainedModelDefinitionPart) HttpRequest(ctx context.Context) (*http. } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutTrainedModelDefinitionPart) Perform(ctx context.Context) (*http.Response, error) { +func (r PutTrainedModelDefinitionPart) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.put_trained_model_definition_part") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.put_trained_model_definition_part") + if reader := instrument.RecordRequestBody(ctx, "ml.put_trained_model_definition_part", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.put_trained_model_definition_part") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutTrainedModelDefinitionPart query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutTrainedModelDefinitionPart query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a puttrainedmodeldefinitionpart.Response -func (r PutTrainedModelDefinitionPart) Do(ctx context.Context) (*Response, error) { +func (r PutTrainedModelDefinitionPart) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.put_trained_model_definition_part") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -225,6 +283,9 @@ func (r PutTrainedModelDefinitionPart) Do(ctx context.Context) (*Response, error if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -234,6 +295,9 @@ func (r PutTrainedModelDefinitionPart) Do(ctx context.Context) (*Response, error errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -241,6 +305,9 @@ func (r PutTrainedModelDefinitionPart) Do(ctx context.Context) (*Response, error errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodeldefinitionpart/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodeldefinitionpart/request.go index 04b171428..395c658bd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodeldefinitionpart/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodeldefinitionpart/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package puttrainedmodeldefinitionpart @@ -27,7 +27,7 @@ import ( // Request holds the request body struct for the package puttrainedmodeldefinitionpart // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/put_trained_model_definition_part/MlPutTrainedModelDefinitionPartRequest.ts#L24-L57 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/put_trained_model_definition_part/MlPutTrainedModelDefinitionPartRequest.ts#L24-L57 type Request struct { // Definition The definition part for the model. Must be a base64 encoded string. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodeldefinitionpart/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodeldefinitionpart/response.go index 872a91813..2c72386f0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodeldefinitionpart/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodeldefinitionpart/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package puttrainedmodeldefinitionpart // Response holds the response body struct for the package puttrainedmodeldefinitionpart // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/put_trained_model_definition_part/MlPutTrainedModelDefinitionPartResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/put_trained_model_definition_part/MlPutTrainedModelDefinitionPartResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodelvocabulary/put_trained_model_vocabulary.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodelvocabulary/put_trained_model_vocabulary.go index 200a6e9e5..f11982d83 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodelvocabulary/put_trained_model_vocabulary.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodelvocabulary/put_trained_model_vocabulary.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates a trained model vocabulary package puttrainedmodelvocabulary @@ -50,15 +50,19 @@ type PutTrainedModelVocabulary struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int modelid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutTrainedModelVocabulary type alias for index. @@ -84,11 +88,18 @@ func New(tp elastictransport.Interface) *PutTrainedModelVocabulary { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -125,9 +136,7 @@ func (r *PutTrainedModelVocabulary) HttpRequest(ctx context.Context) (*http.Requ } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -139,6 +148,10 @@ func (r *PutTrainedModelVocabulary) HttpRequest(ctx context.Context) (*http.Requ } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -149,6 +162,9 @@ func (r *PutTrainedModelVocabulary) HttpRequest(ctx context.Context) (*http.Requ path.WriteString("trained_models") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "modelid", r.modelid) + } path.WriteString(r.modelid) path.WriteString("/") path.WriteString("vocabulary") @@ -164,15 +180,15 @@ func (r *PutTrainedModelVocabulary) HttpRequest(ctx context.Context) (*http.Requ } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -189,27 +205,66 @@ func (r *PutTrainedModelVocabulary) HttpRequest(ctx context.Context) (*http.Requ } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutTrainedModelVocabulary) Perform(ctx context.Context) (*http.Response, error) { +func (r PutTrainedModelVocabulary) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.put_trained_model_vocabulary") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.put_trained_model_vocabulary") + if reader := instrument.RecordRequestBody(ctx, "ml.put_trained_model_vocabulary", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.put_trained_model_vocabulary") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutTrainedModelVocabulary query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutTrainedModelVocabulary query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a puttrainedmodelvocabulary.Response -func (r PutTrainedModelVocabulary) Do(ctx context.Context) (*Response, error) { +func (r PutTrainedModelVocabulary) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.put_trained_model_vocabulary") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -217,6 +272,9 @@ func (r PutTrainedModelVocabulary) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -226,6 +284,9 @@ func (r PutTrainedModelVocabulary) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -233,6 +294,9 @@ func (r PutTrainedModelVocabulary) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodelvocabulary/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodelvocabulary/request.go index ddf5ee9b3..1ec079fa7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodelvocabulary/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodelvocabulary/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package puttrainedmodelvocabulary @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package puttrainedmodelvocabulary // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/put_trained_model_vocabulary/MlPutTrainedModelVocabularyRequest.ts#L24-L60 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/put_trained_model_vocabulary/MlPutTrainedModelVocabularyRequest.ts#L24-L60 type Request struct { // Merges The optional model merges if required by the tokenizer. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodelvocabulary/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodelvocabulary/response.go index 3ea3bd59e..aca1edac7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodelvocabulary/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/puttrainedmodelvocabulary/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package puttrainedmodelvocabulary // Response holds the response body struct for the package puttrainedmodelvocabulary // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/put_trained_model_vocabulary/MlPutTrainedModelVocabularyResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/put_trained_model_vocabulary/MlPutTrainedModelVocabularyResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/resetjob/reset_job.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/resetjob/reset_job.go index a21c95f90..1e3808c4a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/resetjob/reset_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/resetjob/reset_job.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Resets an existing anomaly detection job. package resetjob import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type ResetJob struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int jobid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewResetJob type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *ResetJob { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -107,6 +115,9 @@ func (r *ResetJob) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("anomaly_detectors") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "jobid", r.jobid) + } path.WriteString(r.jobid) path.WriteString("/") path.WriteString("_reset") @@ -122,9 +133,9 @@ func (r *ResetJob) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -141,27 +152,66 @@ func (r *ResetJob) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ResetJob) Perform(ctx context.Context) (*http.Response, error) { +func (r ResetJob) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.reset_job") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.reset_job") + if reader := instrument.RecordRequestBody(ctx, "ml.reset_job", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.reset_job") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ResetJob query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ResetJob query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a resetjob.Response -func (r ResetJob) Do(ctx context.Context) (*Response, error) { +func (r ResetJob) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.reset_job") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -169,6 +219,9 @@ func (r ResetJob) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -178,6 +231,9 @@ func (r ResetJob) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -185,12 +241,25 @@ func (r ResetJob) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ResetJob) IsSuccess(ctx context.Context) (bool, error) { +func (r ResetJob) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.reset_job") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -206,6 +275,14 @@ func (r ResetJob) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ResetJob query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/resetjob/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/resetjob/response.go index d24d174a4..897099e90 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/resetjob/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/resetjob/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package resetjob // Response holds the response body struct for the package resetjob // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/reset_job/MlResetJobResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/reset_job/MlResetJobResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/revertmodelsnapshot/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/revertmodelsnapshot/request.go index f56f6fcf5..ffd64230c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/revertmodelsnapshot/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/revertmodelsnapshot/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package revertmodelsnapshot @@ -27,7 +27,7 @@ import ( // Request holds the request body struct for the package revertmodelsnapshot // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/revert_model_snapshot/MlRevertModelSnapshotRequest.ts#L23-L69 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/revert_model_snapshot/MlRevertModelSnapshotRequest.ts#L23-L69 type Request struct { // DeleteInterveningResults Refer to the description for the `delete_intervening_results` query diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/revertmodelsnapshot/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/revertmodelsnapshot/response.go index f05772c96..7af6b2572 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/revertmodelsnapshot/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/revertmodelsnapshot/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package revertmodelsnapshot @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package revertmodelsnapshot // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/revert_model_snapshot/MlRevertModelSnapshotResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/revert_model_snapshot/MlRevertModelSnapshotResponse.ts#L22-L24 type Response struct { Model types.ModelSnapshot `json:"model"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/revertmodelsnapshot/revert_model_snapshot.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/revertmodelsnapshot/revert_model_snapshot.go index 4629362b9..827f04149 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/revertmodelsnapshot/revert_model_snapshot.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/revertmodelsnapshot/revert_model_snapshot.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Reverts to a specific snapshot. package revertmodelsnapshot @@ -52,16 +52,20 @@ type RevertModelSnapshot struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int jobid string snapshotid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewRevertModelSnapshot type alias for index. @@ -89,11 +93,18 @@ func New(tp elastictransport.Interface) *RevertModelSnapshot { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -130,9 +141,7 @@ func (r *RevertModelSnapshot) HttpRequest(ctx context.Context) (*http.Request, e } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -144,6 +153,10 @@ func (r *RevertModelSnapshot) HttpRequest(ctx context.Context) (*http.Request, e } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -154,11 +167,17 @@ func (r *RevertModelSnapshot) HttpRequest(ctx context.Context) (*http.Request, e path.WriteString("anomaly_detectors") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "jobid", r.jobid) + } path.WriteString(r.jobid) path.WriteString("/") path.WriteString("model_snapshots") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "snapshotid", r.snapshotid) + } path.WriteString(r.snapshotid) path.WriteString("/") path.WriteString("_revert") @@ -174,15 +193,15 @@ func (r *RevertModelSnapshot) HttpRequest(ctx context.Context) (*http.Request, e } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -199,27 +218,66 @@ func (r *RevertModelSnapshot) HttpRequest(ctx context.Context) (*http.Request, e } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r RevertModelSnapshot) Perform(ctx context.Context) (*http.Response, error) { +func (r RevertModelSnapshot) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.revert_model_snapshot") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.revert_model_snapshot") + if reader := instrument.RecordRequestBody(ctx, "ml.revert_model_snapshot", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.revert_model_snapshot") + } if err != nil { - return nil, fmt.Errorf("an error happened during the RevertModelSnapshot query execution: %w", err) + localErr := fmt.Errorf("an error happened during the RevertModelSnapshot query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a revertmodelsnapshot.Response -func (r RevertModelSnapshot) Do(ctx context.Context) (*Response, error) { +func (r RevertModelSnapshot) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.revert_model_snapshot") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -227,6 +285,9 @@ func (r RevertModelSnapshot) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -236,6 +297,9 @@ func (r RevertModelSnapshot) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -243,6 +307,9 @@ func (r RevertModelSnapshot) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/setupgrademode/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/setupgrademode/response.go index ad2f51b52..2694bdd8b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/setupgrademode/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/setupgrademode/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package setupgrademode // Response holds the response body struct for the package setupgrademode // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/set_upgrade_mode/MlSetUpgradeModeResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/set_upgrade_mode/MlSetUpgradeModeResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/setupgrademode/set_upgrade_mode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/setupgrademode/set_upgrade_mode.go index ddb8d8945..f383b85d4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/setupgrademode/set_upgrade_mode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/setupgrademode/set_upgrade_mode.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Sets a cluster wide upgrade_mode setting that prepares machine learning // indices for an upgrade. package setupgrademode import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -49,9 +48,13 @@ type SetUpgradeMode struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewSetUpgradeMode type alias for index. @@ -76,7 +79,12 @@ func New(tp elastictransport.Interface) *SetUpgradeMode { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -111,9 +119,9 @@ func (r *SetUpgradeMode) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -130,27 +138,66 @@ func (r *SetUpgradeMode) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r SetUpgradeMode) Perform(ctx context.Context) (*http.Response, error) { +func (r SetUpgradeMode) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.set_upgrade_mode") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.set_upgrade_mode") + if reader := instrument.RecordRequestBody(ctx, "ml.set_upgrade_mode", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.set_upgrade_mode") + } if err != nil { - return nil, fmt.Errorf("an error happened during the SetUpgradeMode query execution: %w", err) + localErr := fmt.Errorf("an error happened during the SetUpgradeMode query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a setupgrademode.Response -func (r SetUpgradeMode) Do(ctx context.Context) (*Response, error) { +func (r SetUpgradeMode) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.set_upgrade_mode") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -158,6 +205,9 @@ func (r SetUpgradeMode) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -167,6 +217,9 @@ func (r SetUpgradeMode) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -174,12 +227,25 @@ func (r SetUpgradeMode) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r SetUpgradeMode) IsSuccess(ctx context.Context) (bool, error) { +func (r SetUpgradeMode) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.set_upgrade_mode") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -195,6 +261,14 @@ func (r SetUpgradeMode) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the SetUpgradeMode query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/startdatafeed/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/startdatafeed/request.go index 38e8dc105..5b2d05fed 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/startdatafeed/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/startdatafeed/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package startdatafeed @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package startdatafeed // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/start_datafeed/MlStartDatafeedRequest.ts#L24-L91 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/start_datafeed/MlStartDatafeedRequest.ts#L24-L91 type Request struct { // End Refer to the description for the `end` query parameter. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/startdatafeed/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/startdatafeed/response.go index ffcfd5b74..76716c072 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/startdatafeed/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/startdatafeed/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package startdatafeed @@ -30,7 +30,7 @@ import ( // Response holds the response body struct for the package startdatafeed // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/start_datafeed/MlStartDatafeedResponse.ts#L22-L34 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/start_datafeed/MlStartDatafeedResponse.ts#L22-L34 type Response struct { // Node The ID of the node that the job was started on. In serverless this will be diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/startdatafeed/start_datafeed.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/startdatafeed/start_datafeed.go index a02eb35bd..d83415574 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/startdatafeed/start_datafeed.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/startdatafeed/start_datafeed.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Starts one or more datafeeds. package startdatafeed @@ -50,15 +50,19 @@ type StartDatafeed struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int datafeedid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewStartDatafeed type alias for index. @@ -84,11 +88,18 @@ func New(tp elastictransport.Interface) *StartDatafeed { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -125,9 +136,7 @@ func (r *StartDatafeed) HttpRequest(ctx context.Context) (*http.Request, error) } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -139,6 +148,10 @@ func (r *StartDatafeed) HttpRequest(ctx context.Context) (*http.Request, error) } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -149,6 +162,9 @@ func (r *StartDatafeed) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("datafeeds") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "datafeedid", r.datafeedid) + } path.WriteString(r.datafeedid) path.WriteString("/") path.WriteString("_start") @@ -164,15 +180,15 @@ func (r *StartDatafeed) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -189,27 +205,66 @@ func (r *StartDatafeed) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r StartDatafeed) Perform(ctx context.Context) (*http.Response, error) { +func (r StartDatafeed) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.start_datafeed") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.start_datafeed") + if reader := instrument.RecordRequestBody(ctx, "ml.start_datafeed", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.start_datafeed") + } if err != nil { - return nil, fmt.Errorf("an error happened during the StartDatafeed query execution: %w", err) + localErr := fmt.Errorf("an error happened during the StartDatafeed query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a startdatafeed.Response -func (r StartDatafeed) Do(ctx context.Context) (*Response, error) { +func (r StartDatafeed) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.start_datafeed") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -217,6 +272,9 @@ func (r StartDatafeed) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -226,6 +284,9 @@ func (r StartDatafeed) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -233,6 +294,9 @@ func (r StartDatafeed) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/startdataframeanalytics/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/startdataframeanalytics/response.go index 9afa48b8b..edc4259e6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/startdataframeanalytics/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/startdataframeanalytics/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package startdataframeanalytics // Response holds the response body struct for the package startdataframeanalytics // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/start_data_frame_analytics/MlStartDataFrameAnalyticsResponse.ts#L22-L34 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/start_data_frame_analytics/MlStartDataFrameAnalyticsResponse.ts#L22-L34 type Response struct { Acknowledged bool `json:"acknowledged"` // Node The ID of the node that the job was started on. If the job is allowed to open diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/startdataframeanalytics/start_data_frame_analytics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/startdataframeanalytics/start_data_frame_analytics.go index e676bb69e..45db6df04 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/startdataframeanalytics/start_data_frame_analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/startdataframeanalytics/start_data_frame_analytics.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Starts a data frame analytics job. package startdataframeanalytics import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type StartDataFrameAnalytics struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewStartDataFrameAnalytics type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *StartDataFrameAnalytics { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,6 +116,9 @@ func (r *StartDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Reques path.WriteString("analytics") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) path.WriteString("/") path.WriteString("_start") @@ -123,15 +134,15 @@ func (r *StartDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Reques } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -148,27 +159,66 @@ func (r *StartDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Reques } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r StartDataFrameAnalytics) Perform(ctx context.Context) (*http.Response, error) { +func (r StartDataFrameAnalytics) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.start_data_frame_analytics") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.start_data_frame_analytics") + if reader := instrument.RecordRequestBody(ctx, "ml.start_data_frame_analytics", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.start_data_frame_analytics") + } if err != nil { - return nil, fmt.Errorf("an error happened during the StartDataFrameAnalytics query execution: %w", err) + localErr := fmt.Errorf("an error happened during the StartDataFrameAnalytics query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a startdataframeanalytics.Response -func (r StartDataFrameAnalytics) Do(ctx context.Context) (*Response, error) { +func (r StartDataFrameAnalytics) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.start_data_frame_analytics") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -176,6 +226,9 @@ func (r StartDataFrameAnalytics) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -185,6 +238,9 @@ func (r StartDataFrameAnalytics) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -192,12 +248,25 @@ func (r StartDataFrameAnalytics) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r StartDataFrameAnalytics) IsSuccess(ctx context.Context) (bool, error) { +func (r StartDataFrameAnalytics) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.start_data_frame_analytics") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -213,6 +282,14 @@ func (r StartDataFrameAnalytics) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the StartDataFrameAnalytics query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/starttrainedmodeldeployment/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/starttrainedmodeldeployment/response.go index 7b6f6c0fc..d3405350f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/starttrainedmodeldeployment/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/starttrainedmodeldeployment/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package starttrainedmodeldeployment @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package starttrainedmodeldeployment // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/start_trained_model_deployment/MlStartTrainedModelDeploymentResponse.ts#L22-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/start_trained_model_deployment/MlStartTrainedModelDeploymentResponse.ts#L22-L26 type Response struct { Assignment types.TrainedModelAssignment `json:"assignment"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/starttrainedmodeldeployment/start_trained_model_deployment.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/starttrainedmodeldeployment/start_trained_model_deployment.go index b8f728349..99b400f9a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/starttrainedmodeldeployment/start_trained_model_deployment.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/starttrainedmodeldeployment/start_trained_model_deployment.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Start a trained model deployment. package starttrainedmodeldeployment import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -54,11 +53,15 @@ type StartTrainedModelDeployment struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int modelid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewStartTrainedModelDeployment type alias for index. @@ -84,7 +87,12 @@ func New(tp elastictransport.Interface) *StartTrainedModelDeployment { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -109,6 +117,9 @@ func (r *StartTrainedModelDeployment) HttpRequest(ctx context.Context) (*http.Re path.WriteString("trained_models") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "modelid", r.modelid) + } path.WriteString(r.modelid) path.WriteString("/") path.WriteString("deployment") @@ -126,15 +137,15 @@ func (r *StartTrainedModelDeployment) HttpRequest(ctx context.Context) (*http.Re } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -151,27 +162,66 @@ func (r *StartTrainedModelDeployment) HttpRequest(ctx context.Context) (*http.Re } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r StartTrainedModelDeployment) Perform(ctx context.Context) (*http.Response, error) { +func (r StartTrainedModelDeployment) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.start_trained_model_deployment") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.start_trained_model_deployment") + if reader := instrument.RecordRequestBody(ctx, "ml.start_trained_model_deployment", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.start_trained_model_deployment") + } if err != nil { - return nil, fmt.Errorf("an error happened during the StartTrainedModelDeployment query execution: %w", err) + localErr := fmt.Errorf("an error happened during the StartTrainedModelDeployment query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a starttrainedmodeldeployment.Response -func (r StartTrainedModelDeployment) Do(ctx context.Context) (*Response, error) { +func (r StartTrainedModelDeployment) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.start_trained_model_deployment") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -179,6 +229,9 @@ func (r StartTrainedModelDeployment) Do(ctx context.Context) (*Response, error) if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -188,6 +241,9 @@ func (r StartTrainedModelDeployment) Do(ctx context.Context) (*Response, error) errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -195,12 +251,25 @@ func (r StartTrainedModelDeployment) Do(ctx context.Context) (*Response, error) errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r StartTrainedModelDeployment) IsSuccess(ctx context.Context) (bool, error) { +func (r StartTrainedModelDeployment) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.start_trained_model_deployment") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -216,6 +285,14 @@ func (r StartTrainedModelDeployment) IsSuccess(ctx context.Context) (bool, error return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the StartTrainedModelDeployment query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/stopdatafeed/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/stopdatafeed/request.go index 94082b22c..cf79aa52c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/stopdatafeed/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/stopdatafeed/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package stopdatafeed @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package stopdatafeed // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/stop_datafeed/MlStopDatafeedRequest.ts#L24-L78 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/stop_datafeed/MlStopDatafeedRequest.ts#L24-L78 type Request struct { // AllowNoMatch Refer to the description for the `allow_no_match` query parameter. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/stopdatafeed/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/stopdatafeed/response.go index 741e4a0ef..6f357d8f3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/stopdatafeed/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/stopdatafeed/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package stopdatafeed // Response holds the response body struct for the package stopdatafeed // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/stop_datafeed/MlStopDatafeedResponse.ts#L20-L22 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/stop_datafeed/MlStopDatafeedResponse.ts#L20-L22 type Response struct { Stopped bool `json:"stopped"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/stopdatafeed/stop_datafeed.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/stopdatafeed/stop_datafeed.go index a3bfce836..393a50dde 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/stopdatafeed/stop_datafeed.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/stopdatafeed/stop_datafeed.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Stops one or more datafeeds. package stopdatafeed @@ -50,15 +50,19 @@ type StopDatafeed struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int datafeedid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewStopDatafeed type alias for index. @@ -84,11 +88,18 @@ func New(tp elastictransport.Interface) *StopDatafeed { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -125,9 +136,7 @@ func (r *StopDatafeed) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -139,6 +148,10 @@ func (r *StopDatafeed) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -149,6 +162,9 @@ func (r *StopDatafeed) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("datafeeds") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "datafeedid", r.datafeedid) + } path.WriteString(r.datafeedid) path.WriteString("/") path.WriteString("_stop") @@ -164,15 +180,15 @@ func (r *StopDatafeed) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -189,27 +205,66 @@ func (r *StopDatafeed) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r StopDatafeed) Perform(ctx context.Context) (*http.Response, error) { +func (r StopDatafeed) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.stop_datafeed") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.stop_datafeed") + if reader := instrument.RecordRequestBody(ctx, "ml.stop_datafeed", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.stop_datafeed") + } if err != nil { - return nil, fmt.Errorf("an error happened during the StopDatafeed query execution: %w", err) + localErr := fmt.Errorf("an error happened during the StopDatafeed query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a stopdatafeed.Response -func (r StopDatafeed) Do(ctx context.Context) (*Response, error) { +func (r StopDatafeed) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.stop_datafeed") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -217,6 +272,9 @@ func (r StopDatafeed) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -226,6 +284,9 @@ func (r StopDatafeed) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -233,6 +294,9 @@ func (r StopDatafeed) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/stopdataframeanalytics/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/stopdataframeanalytics/response.go index 262c547a5..9b48fb102 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/stopdataframeanalytics/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/stopdataframeanalytics/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package stopdataframeanalytics // Response holds the response body struct for the package stopdataframeanalytics // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/stop_data_frame_analytics/MlStopDataFrameAnalyticsResponse.ts#L20-L22 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/stop_data_frame_analytics/MlStopDataFrameAnalyticsResponse.ts#L20-L22 type Response struct { Stopped bool `json:"stopped"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/stopdataframeanalytics/stop_data_frame_analytics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/stopdataframeanalytics/stop_data_frame_analytics.go index ab7884f2b..794170b0d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/stopdataframeanalytics/stop_data_frame_analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/stopdataframeanalytics/stop_data_frame_analytics.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Stops one or more data frame analytics jobs. package stopdataframeanalytics import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type StopDataFrameAnalytics struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewStopDataFrameAnalytics type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *StopDataFrameAnalytics { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -109,6 +117,9 @@ func (r *StopDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Request path.WriteString("analytics") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) path.WriteString("/") path.WriteString("_stop") @@ -124,15 +135,15 @@ func (r *StopDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Request } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -149,27 +160,66 @@ func (r *StopDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Request } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r StopDataFrameAnalytics) Perform(ctx context.Context) (*http.Response, error) { +func (r StopDataFrameAnalytics) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.stop_data_frame_analytics") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.stop_data_frame_analytics") + if reader := instrument.RecordRequestBody(ctx, "ml.stop_data_frame_analytics", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.stop_data_frame_analytics") + } if err != nil { - return nil, fmt.Errorf("an error happened during the StopDataFrameAnalytics query execution: %w", err) + localErr := fmt.Errorf("an error happened during the StopDataFrameAnalytics query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a stopdataframeanalytics.Response -func (r StopDataFrameAnalytics) Do(ctx context.Context) (*Response, error) { +func (r StopDataFrameAnalytics) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.stop_data_frame_analytics") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -177,6 +227,9 @@ func (r StopDataFrameAnalytics) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -186,6 +239,9 @@ func (r StopDataFrameAnalytics) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -193,12 +249,25 @@ func (r StopDataFrameAnalytics) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r StopDataFrameAnalytics) IsSuccess(ctx context.Context) (bool, error) { +func (r StopDataFrameAnalytics) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.stop_data_frame_analytics") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -214,6 +283,14 @@ func (r StopDataFrameAnalytics) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the StopDataFrameAnalytics query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/stoptrainedmodeldeployment/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/stoptrainedmodeldeployment/response.go index 9292534ad..63624a576 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/stoptrainedmodeldeployment/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/stoptrainedmodeldeployment/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package stoptrainedmodeldeployment // Response holds the response body struct for the package stoptrainedmodeldeployment // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/stop_trained_model_deployment/MlStopTrainedModelDeploymentResponse.ts#L20-L22 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/stop_trained_model_deployment/MlStopTrainedModelDeploymentResponse.ts#L20-L22 type Response struct { Stopped bool `json:"stopped"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/stoptrainedmodeldeployment/stop_trained_model_deployment.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/stoptrainedmodeldeployment/stop_trained_model_deployment.go index 7cd014f9b..05fb59246 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/stoptrainedmodeldeployment/stop_trained_model_deployment.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/stoptrainedmodeldeployment/stop_trained_model_deployment.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Stop a trained model deployment. package stoptrainedmodeldeployment import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type StopTrainedModelDeployment struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int modelid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewStopTrainedModelDeployment type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *StopTrainedModelDeployment { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -107,6 +115,9 @@ func (r *StopTrainedModelDeployment) HttpRequest(ctx context.Context) (*http.Req path.WriteString("trained_models") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "modelid", r.modelid) + } path.WriteString(r.modelid) path.WriteString("/") path.WriteString("deployment") @@ -124,15 +135,15 @@ func (r *StopTrainedModelDeployment) HttpRequest(ctx context.Context) (*http.Req } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -149,27 +160,66 @@ func (r *StopTrainedModelDeployment) HttpRequest(ctx context.Context) (*http.Req } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r StopTrainedModelDeployment) Perform(ctx context.Context) (*http.Response, error) { +func (r StopTrainedModelDeployment) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.stop_trained_model_deployment") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.stop_trained_model_deployment") + if reader := instrument.RecordRequestBody(ctx, "ml.stop_trained_model_deployment", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.stop_trained_model_deployment") + } if err != nil { - return nil, fmt.Errorf("an error happened during the StopTrainedModelDeployment query execution: %w", err) + localErr := fmt.Errorf("an error happened during the StopTrainedModelDeployment query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a stoptrainedmodeldeployment.Response -func (r StopTrainedModelDeployment) Do(ctx context.Context) (*Response, error) { +func (r StopTrainedModelDeployment) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.stop_trained_model_deployment") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -177,6 +227,9 @@ func (r StopTrainedModelDeployment) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -186,6 +239,9 @@ func (r StopTrainedModelDeployment) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -193,12 +249,25 @@ func (r StopTrainedModelDeployment) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r StopTrainedModelDeployment) IsSuccess(ctx context.Context) (bool, error) { +func (r StopTrainedModelDeployment) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.stop_trained_model_deployment") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -214,6 +283,14 @@ func (r StopTrainedModelDeployment) IsSuccess(ctx context.Context) (bool, error) return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the StopTrainedModelDeployment query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatedatafeed/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatedatafeed/request.go index 083f635fe..b4ba244bd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatedatafeed/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatedatafeed/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package updatedatafeed @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package updatedatafeed // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/update_datafeed/MlUpdateDatafeedRequest.ts#L31-L162 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/update_datafeed/MlUpdateDatafeedRequest.ts#L31-L162 type Request struct { // Aggregations If set, the datafeed performs aggregation searches. Support for aggregations diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatedatafeed/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatedatafeed/response.go index 21e33c6ac..cdcdf2b70 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatedatafeed/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatedatafeed/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package updatedatafeed @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package updatedatafeed // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/update_datafeed/MlUpdateDatafeedResponse.ts#L31-L49 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/update_datafeed/MlUpdateDatafeedResponse.ts#L31-L49 type Response struct { Aggregations map[string]types.Aggregations `json:"aggregations,omitempty"` Authorization *types.DatafeedAuthorization `json:"authorization,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatedatafeed/update_datafeed.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatedatafeed/update_datafeed.go index 3ce3e02a7..891ae0a6d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatedatafeed/update_datafeed.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatedatafeed/update_datafeed.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Updates certain properties of a datafeed. package updatedatafeed @@ -52,15 +52,19 @@ type UpdateDatafeed struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int datafeedid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewUpdateDatafeed type alias for index. @@ -86,11 +90,18 @@ func New(tp elastictransport.Interface) *UpdateDatafeed { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -127,9 +138,7 @@ func (r *UpdateDatafeed) HttpRequest(ctx context.Context) (*http.Request, error) } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -141,6 +150,10 @@ func (r *UpdateDatafeed) HttpRequest(ctx context.Context) (*http.Request, error) } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -151,6 +164,9 @@ func (r *UpdateDatafeed) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("datafeeds") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "datafeedid", r.datafeedid) + } path.WriteString(r.datafeedid) path.WriteString("/") path.WriteString("_update") @@ -166,15 +182,15 @@ func (r *UpdateDatafeed) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -191,27 +207,66 @@ func (r *UpdateDatafeed) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r UpdateDatafeed) Perform(ctx context.Context) (*http.Response, error) { +func (r UpdateDatafeed) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.update_datafeed") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.update_datafeed") + if reader := instrument.RecordRequestBody(ctx, "ml.update_datafeed", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.update_datafeed") + } if err != nil { - return nil, fmt.Errorf("an error happened during the UpdateDatafeed query execution: %w", err) + localErr := fmt.Errorf("an error happened during the UpdateDatafeed query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a updatedatafeed.Response -func (r UpdateDatafeed) Do(ctx context.Context) (*Response, error) { +func (r UpdateDatafeed) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.update_datafeed") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -219,6 +274,9 @@ func (r UpdateDatafeed) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -228,6 +286,9 @@ func (r UpdateDatafeed) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -235,6 +296,9 @@ func (r UpdateDatafeed) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatedataframeanalytics/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatedataframeanalytics/request.go index fb6464bdc..057766c58 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatedataframeanalytics/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatedataframeanalytics/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package updatedataframeanalytics @@ -27,7 +27,7 @@ import ( // Request holds the request body struct for the package updatedataframeanalytics // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/update_data_frame_analytics/MlUpdateDataFrameAnalyticsRequest.ts#L24-L72 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/update_data_frame_analytics/MlUpdateDataFrameAnalyticsRequest.ts#L24-L72 type Request struct { // AllowLazyStart Specifies whether this job can start when there is insufficient machine diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatedataframeanalytics/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatedataframeanalytics/response.go index b4e1573d2..974d576f6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatedataframeanalytics/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatedataframeanalytics/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package updatedataframeanalytics @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package updatedataframeanalytics // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/update_data_frame_analytics/MlUpdateDataFrameAnalyticsResponse.ts#L30-L45 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/update_data_frame_analytics/MlUpdateDataFrameAnalyticsResponse.ts#L30-L45 type Response struct { AllowLazyStart bool `json:"allow_lazy_start"` Analysis types.DataframeAnalysisContainer `json:"analysis"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatedataframeanalytics/update_data_frame_analytics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatedataframeanalytics/update_data_frame_analytics.go index 21fc52d75..4b38a0436 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatedataframeanalytics/update_data_frame_analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatedataframeanalytics/update_data_frame_analytics.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Updates certain properties of a data frame analytics job. package updatedataframeanalytics @@ -50,15 +50,19 @@ type UpdateDataFrameAnalytics struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewUpdateDataFrameAnalytics type alias for index. @@ -84,11 +88,18 @@ func New(tp elastictransport.Interface) *UpdateDataFrameAnalytics { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -125,9 +136,7 @@ func (r *UpdateDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Reque } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -139,6 +148,10 @@ func (r *UpdateDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Reque } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -151,6 +164,9 @@ func (r *UpdateDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Reque path.WriteString("analytics") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) path.WriteString("/") path.WriteString("_update") @@ -166,15 +182,15 @@ func (r *UpdateDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Reque } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -191,27 +207,66 @@ func (r *UpdateDataFrameAnalytics) HttpRequest(ctx context.Context) (*http.Reque } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r UpdateDataFrameAnalytics) Perform(ctx context.Context) (*http.Response, error) { +func (r UpdateDataFrameAnalytics) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.update_data_frame_analytics") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.update_data_frame_analytics") + if reader := instrument.RecordRequestBody(ctx, "ml.update_data_frame_analytics", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.update_data_frame_analytics") + } if err != nil { - return nil, fmt.Errorf("an error happened during the UpdateDataFrameAnalytics query execution: %w", err) + localErr := fmt.Errorf("an error happened during the UpdateDataFrameAnalytics query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a updatedataframeanalytics.Response -func (r UpdateDataFrameAnalytics) Do(ctx context.Context) (*Response, error) { +func (r UpdateDataFrameAnalytics) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.update_data_frame_analytics") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -219,6 +274,9 @@ func (r UpdateDataFrameAnalytics) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -228,6 +286,9 @@ func (r UpdateDataFrameAnalytics) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -235,6 +296,9 @@ func (r UpdateDataFrameAnalytics) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatefilter/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatefilter/request.go index 2e3ab936b..b393bbf7c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatefilter/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatefilter/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package updatefilter @@ -27,7 +27,7 @@ import ( // Request holds the request body struct for the package updatefilter // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/update_filter/MlUpdateFilterRequest.ts#L23-L51 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/update_filter/MlUpdateFilterRequest.ts#L23-L51 type Request struct { // AddItems The items to add to the filter. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatefilter/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatefilter/response.go index c83139205..068af9889 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatefilter/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatefilter/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package updatefilter // Response holds the response body struct for the package updatefilter // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/update_filter/MlUpdateFilterResponse.ts#L22-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/update_filter/MlUpdateFilterResponse.ts#L22-L28 type Response struct { Description string `json:"description"` FilterId string `json:"filter_id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatefilter/update_filter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatefilter/update_filter.go index a76ba81b2..c58ef067b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatefilter/update_filter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatefilter/update_filter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Updates the description of a filter, adds items, or removes items. package updatefilter @@ -50,15 +50,19 @@ type UpdateFilter struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int filterid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewUpdateFilter type alias for index. @@ -84,11 +88,18 @@ func New(tp elastictransport.Interface) *UpdateFilter { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -125,9 +136,7 @@ func (r *UpdateFilter) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -139,6 +148,10 @@ func (r *UpdateFilter) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -149,6 +162,9 @@ func (r *UpdateFilter) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("filters") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "filterid", r.filterid) + } path.WriteString(r.filterid) path.WriteString("/") path.WriteString("_update") @@ -164,15 +180,15 @@ func (r *UpdateFilter) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -189,27 +205,66 @@ func (r *UpdateFilter) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r UpdateFilter) Perform(ctx context.Context) (*http.Response, error) { +func (r UpdateFilter) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.update_filter") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.update_filter") + if reader := instrument.RecordRequestBody(ctx, "ml.update_filter", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.update_filter") + } if err != nil { - return nil, fmt.Errorf("an error happened during the UpdateFilter query execution: %w", err) + localErr := fmt.Errorf("an error happened during the UpdateFilter query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a updatefilter.Response -func (r UpdateFilter) Do(ctx context.Context) (*Response, error) { +func (r UpdateFilter) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.update_filter") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -217,6 +272,9 @@ func (r UpdateFilter) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -226,6 +284,9 @@ func (r UpdateFilter) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -233,6 +294,9 @@ func (r UpdateFilter) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatejob/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatejob/request.go index becb26a85..60ef60c68 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatejob/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatejob/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package updatejob @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package updatejob // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/update_job/MlUpdateJobRequest.ts#L33-L138 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/update_job/MlUpdateJobRequest.ts#L33-L138 type Request struct { // AllowLazyOpen Advanced configuration option. Specifies whether this job can open when diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatejob/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatejob/response.go index ac319e15b..c388d6cfe 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatejob/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatejob/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package updatejob @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package updatejob // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/update_job/MlUpdateJobResponse.ts#L29-L53 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/update_job/MlUpdateJobResponse.ts#L29-L53 type Response struct { AllowLazyOpen bool `json:"allow_lazy_open"` AnalysisConfig types.AnalysisConfigRead `json:"analysis_config"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatejob/update_job.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatejob/update_job.go index 8cd8ef61f..36e161da3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatejob/update_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatejob/update_job.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Updates certain properties of an anomaly detection job. package updatejob @@ -50,15 +50,19 @@ type UpdateJob struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int jobid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewUpdateJob type alias for index. @@ -84,11 +88,18 @@ func New(tp elastictransport.Interface) *UpdateJob { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -125,9 +136,7 @@ func (r *UpdateJob) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -139,6 +148,10 @@ func (r *UpdateJob) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -149,6 +162,9 @@ func (r *UpdateJob) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("anomaly_detectors") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "jobid", r.jobid) + } path.WriteString(r.jobid) path.WriteString("/") path.WriteString("_update") @@ -164,15 +180,15 @@ func (r *UpdateJob) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -189,27 +205,66 @@ func (r *UpdateJob) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r UpdateJob) Perform(ctx context.Context) (*http.Response, error) { +func (r UpdateJob) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.update_job") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.update_job") + if reader := instrument.RecordRequestBody(ctx, "ml.update_job", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.update_job") + } if err != nil { - return nil, fmt.Errorf("an error happened during the UpdateJob query execution: %w", err) + localErr := fmt.Errorf("an error happened during the UpdateJob query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a updatejob.Response -func (r UpdateJob) Do(ctx context.Context) (*Response, error) { +func (r UpdateJob) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.update_job") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -217,6 +272,9 @@ func (r UpdateJob) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -226,6 +284,9 @@ func (r UpdateJob) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -233,6 +294,9 @@ func (r UpdateJob) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatemodelsnapshot/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatemodelsnapshot/request.go index ceaa80e45..17284c84d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatemodelsnapshot/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatemodelsnapshot/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package updatemodelsnapshot @@ -27,7 +27,7 @@ import ( // Request holds the request body struct for the package updatemodelsnapshot // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/update_model_snapshot/MlUpdateModelSnapshotRequest.ts#L23-L54 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/update_model_snapshot/MlUpdateModelSnapshotRequest.ts#L23-L54 type Request struct { // Description A description of the model snapshot. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatemodelsnapshot/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatemodelsnapshot/response.go index 07cfc88d1..fda89c8f7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatemodelsnapshot/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatemodelsnapshot/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package updatemodelsnapshot @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package updatemodelsnapshot // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/update_model_snapshot/MlUpdateModelSnapshotResponse.ts#L22-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/update_model_snapshot/MlUpdateModelSnapshotResponse.ts#L22-L27 type Response struct { Acknowledged bool `json:"acknowledged"` Model types.ModelSnapshot `json:"model"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatemodelsnapshot/update_model_snapshot.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatemodelsnapshot/update_model_snapshot.go index 5f8723785..a9d7f149d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatemodelsnapshot/update_model_snapshot.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/updatemodelsnapshot/update_model_snapshot.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Updates certain properties of a snapshot. package updatemodelsnapshot @@ -52,16 +52,20 @@ type UpdateModelSnapshot struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int jobid string snapshotid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewUpdateModelSnapshot type alias for index. @@ -89,11 +93,18 @@ func New(tp elastictransport.Interface) *UpdateModelSnapshot { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -130,9 +141,7 @@ func (r *UpdateModelSnapshot) HttpRequest(ctx context.Context) (*http.Request, e } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -144,6 +153,10 @@ func (r *UpdateModelSnapshot) HttpRequest(ctx context.Context) (*http.Request, e } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -154,11 +167,17 @@ func (r *UpdateModelSnapshot) HttpRequest(ctx context.Context) (*http.Request, e path.WriteString("anomaly_detectors") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "jobid", r.jobid) + } path.WriteString(r.jobid) path.WriteString("/") path.WriteString("model_snapshots") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "snapshotid", r.snapshotid) + } path.WriteString(r.snapshotid) path.WriteString("/") path.WriteString("_update") @@ -174,15 +193,15 @@ func (r *UpdateModelSnapshot) HttpRequest(ctx context.Context) (*http.Request, e } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -199,27 +218,66 @@ func (r *UpdateModelSnapshot) HttpRequest(ctx context.Context) (*http.Request, e } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r UpdateModelSnapshot) Perform(ctx context.Context) (*http.Response, error) { +func (r UpdateModelSnapshot) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.update_model_snapshot") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.update_model_snapshot") + if reader := instrument.RecordRequestBody(ctx, "ml.update_model_snapshot", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.update_model_snapshot") + } if err != nil { - return nil, fmt.Errorf("an error happened during the UpdateModelSnapshot query execution: %w", err) + localErr := fmt.Errorf("an error happened during the UpdateModelSnapshot query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a updatemodelsnapshot.Response -func (r UpdateModelSnapshot) Do(ctx context.Context) (*Response, error) { +func (r UpdateModelSnapshot) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.update_model_snapshot") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -227,6 +285,9 @@ func (r UpdateModelSnapshot) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -236,6 +297,9 @@ func (r UpdateModelSnapshot) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -243,6 +307,9 @@ func (r UpdateModelSnapshot) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/upgradejobsnapshot/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/upgradejobsnapshot/response.go index effc7b3a9..b03fdc4e2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/upgradejobsnapshot/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/upgradejobsnapshot/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package upgradejobsnapshot // Response holds the response body struct for the package upgradejobsnapshot // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/upgrade_job_snapshot/MlUpgradeJobSnapshotResponse.ts#L22-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/upgrade_job_snapshot/MlUpgradeJobSnapshotResponse.ts#L22-L31 type Response struct { // Completed When true, this means the task is complete. When false, it is still running. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/upgradejobsnapshot/upgrade_job_snapshot.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/upgradejobsnapshot/upgrade_job_snapshot.go index eb7b9d477..6aed1ef1e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/upgradejobsnapshot/upgrade_job_snapshot.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/upgradejobsnapshot/upgrade_job_snapshot.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Upgrades a given job snapshot to the current major version. package upgradejobsnapshot import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -54,12 +53,16 @@ type UpgradeJobSnapshot struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int jobid string snapshotid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewUpgradeJobSnapshot type alias for index. @@ -87,7 +90,12 @@ func New(tp elastictransport.Interface) *UpgradeJobSnapshot { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -112,11 +120,17 @@ func (r *UpgradeJobSnapshot) HttpRequest(ctx context.Context) (*http.Request, er path.WriteString("anomaly_detectors") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "jobid", r.jobid) + } path.WriteString(r.jobid) path.WriteString("/") path.WriteString("model_snapshots") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "snapshotid", r.snapshotid) + } path.WriteString(r.snapshotid) path.WriteString("/") path.WriteString("_upgrade") @@ -132,9 +146,9 @@ func (r *UpgradeJobSnapshot) HttpRequest(ctx context.Context) (*http.Request, er } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -151,27 +165,66 @@ func (r *UpgradeJobSnapshot) HttpRequest(ctx context.Context) (*http.Request, er } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r UpgradeJobSnapshot) Perform(ctx context.Context) (*http.Response, error) { +func (r UpgradeJobSnapshot) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.upgrade_job_snapshot") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.upgrade_job_snapshot") + if reader := instrument.RecordRequestBody(ctx, "ml.upgrade_job_snapshot", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.upgrade_job_snapshot") + } if err != nil { - return nil, fmt.Errorf("an error happened during the UpgradeJobSnapshot query execution: %w", err) + localErr := fmt.Errorf("an error happened during the UpgradeJobSnapshot query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a upgradejobsnapshot.Response -func (r UpgradeJobSnapshot) Do(ctx context.Context) (*Response, error) { +func (r UpgradeJobSnapshot) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.upgrade_job_snapshot") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -179,6 +232,9 @@ func (r UpgradeJobSnapshot) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -188,6 +244,9 @@ func (r UpgradeJobSnapshot) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -195,12 +254,25 @@ func (r UpgradeJobSnapshot) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r UpgradeJobSnapshot) IsSuccess(ctx context.Context) (bool, error) { +func (r UpgradeJobSnapshot) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.upgrade_job_snapshot") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -216,6 +288,14 @@ func (r UpgradeJobSnapshot) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the UpgradeJobSnapshot query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/validate/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/validate/request.go index 22edbf318..0749e2223 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/validate/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/validate/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package validate @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package validate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/validate/MlValidateJobRequest.ts#L27-L44 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/validate/MlValidateJobRequest.ts#L27-L44 type Request struct { AnalysisConfig *types.AnalysisConfig `json:"analysis_config,omitempty"` AnalysisLimits *types.AnalysisLimits `json:"analysis_limits,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/validate/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/validate/response.go index b6cbed8e8..64ca815dc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/validate/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/validate/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package validate // Response holds the response body struct for the package validate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/validate/MlValidateJobResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/validate/MlValidateJobResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/validate/validate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/validate/validate.go index f32b558bc..e645f4a6a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/validate/validate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/validate/validate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Validates an anomaly detection job. package validate @@ -46,13 +46,17 @@ type Validate struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewValidate type alias for index. @@ -76,11 +80,18 @@ func New(tp elastictransport.Interface) *Validate { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -117,9 +128,7 @@ func (r *Validate) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -131,6 +140,10 @@ func (r *Validate) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -153,15 +166,15 @@ func (r *Validate) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -178,27 +191,66 @@ func (r *Validate) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Validate) Perform(ctx context.Context) (*http.Response, error) { +func (r Validate) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.validate") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.validate") + if reader := instrument.RecordRequestBody(ctx, "ml.validate", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.validate") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Validate query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Validate query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a validate.Response -func (r Validate) Do(ctx context.Context) (*Response, error) { +func (r Validate) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.validate") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -206,6 +258,9 @@ func (r Validate) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -215,6 +270,9 @@ func (r Validate) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -222,6 +280,9 @@ func (r Validate) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/validatedetector/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/validatedetector/request.go index 8d375559b..8f2c56137 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/validatedetector/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/validatedetector/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package validatedetector @@ -26,5 +26,5 @@ import ( // Request holds the request body struct for the package validatedetector // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/validate_detector/MlValidateDetectorRequest.ts#L23-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/validate_detector/MlValidateDetectorRequest.ts#L23-L31 type Request = types.Detector diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/validatedetector/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/validatedetector/response.go index 12cb78e0c..4e88f6ad3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/validatedetector/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/validatedetector/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package validatedetector // Response holds the response body struct for the package validatedetector // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/validate_detector/MlValidateDetectorResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/validate_detector/MlValidateDetectorResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/validatedetector/validate_detector.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/validatedetector/validate_detector.go index 5da3302b9..3eb3d25b1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/validatedetector/validate_detector.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ml/validatedetector/validate_detector.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Validates an anomaly detection detector. package validatedetector @@ -47,13 +47,17 @@ type ValidateDetector struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewValidateDetector type alias for index. @@ -77,7 +81,14 @@ func New(tp elastictransport.Interface) *ValidateDetector { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -116,9 +127,7 @@ func (r *ValidateDetector) HttpRequest(ctx context.Context) (*http.Request, erro } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -130,6 +139,10 @@ func (r *ValidateDetector) HttpRequest(ctx context.Context) (*http.Request, erro } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -154,15 +167,15 @@ func (r *ValidateDetector) HttpRequest(ctx context.Context) (*http.Request, erro } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -179,27 +192,66 @@ func (r *ValidateDetector) HttpRequest(ctx context.Context) (*http.Request, erro } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ValidateDetector) Perform(ctx context.Context) (*http.Response, error) { +func (r ValidateDetector) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ml.validate_detector") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ml.validate_detector") + if reader := instrument.RecordRequestBody(ctx, "ml.validate_detector", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ml.validate_detector") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ValidateDetector query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ValidateDetector query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a validatedetector.Response -func (r ValidateDetector) Do(ctx context.Context) (*Response, error) { +func (r ValidateDetector) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ml.validate_detector") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -207,6 +259,9 @@ func (r ValidateDetector) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -216,6 +271,9 @@ func (r ValidateDetector) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -223,6 +281,9 @@ func (r ValidateDetector) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/monitoring/bulk/bulk.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/monitoring/bulk/bulk.go index fad4f721d..42bbcea6d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/monitoring/bulk/bulk.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/monitoring/bulk/bulk.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Used by the monitoring features to send monitoring data. package bulk @@ -50,15 +50,19 @@ type Bulk struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int type_ string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewBulk type alias for index. @@ -82,7 +86,14 @@ func New(tp elastictransport.Interface) *Bulk { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -121,9 +132,7 @@ func (r *Bulk) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { for _, elem := range *r.req { data, err := json.Marshal(elem) @@ -140,6 +149,10 @@ func (r *Bulk) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -155,6 +168,9 @@ func (r *Bulk) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_monitoring") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "type_", r.type_) + } path.WriteString(r.type_) path.WriteString("/") path.WriteString("bulk") @@ -170,15 +186,15 @@ func (r *Bulk) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+x-ndjson;compatible-with=8") } } @@ -195,27 +211,66 @@ func (r *Bulk) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Bulk) Perform(ctx context.Context) (*http.Response, error) { +func (r Bulk) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "monitoring.bulk") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "monitoring.bulk") + if reader := instrument.RecordRequestBody(ctx, "monitoring.bulk", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "monitoring.bulk") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Bulk query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Bulk query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a bulk.Response -func (r Bulk) Do(ctx context.Context) (*Response, error) { +func (r Bulk) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "monitoring.bulk") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -223,6 +278,9 @@ func (r Bulk) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -232,6 +290,9 @@ func (r Bulk) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -239,6 +300,9 @@ func (r Bulk) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/monitoring/bulk/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/monitoring/bulk/request.go index 4837d5719..8531a3818 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/monitoring/bulk/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/monitoring/bulk/request.go @@ -16,11 +16,11 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package bulk // Request holds the request body struct for the package bulk // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/monitoring/bulk/BulkMonitoringRequest.ts#L24-L59 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/monitoring/bulk/BulkMonitoringRequest.ts#L24-L59 type Request = []interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/monitoring/bulk/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/monitoring/bulk/response.go index 73477cc99..f81573d97 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/monitoring/bulk/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/monitoring/bulk/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package bulk @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package bulk // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/monitoring/bulk/BulkMonitoringResponse.ts#L23-L32 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/monitoring/bulk/BulkMonitoringResponse.ts#L23-L32 type Response struct { Error *types.ErrorCause `json:"error,omitempty"` // Errors True if there is was an error diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/clearrepositoriesmeteringarchive/clear_repositories_metering_archive.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/clearrepositoriesmeteringarchive/clear_repositories_metering_archive.go index 6421bf84a..29a1e7a73 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/clearrepositoriesmeteringarchive/clear_repositories_metering_archive.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/clearrepositoriesmeteringarchive/clear_repositories_metering_archive.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Removes the archived repositories metering information present in the // cluster. package clearrepositoriesmeteringarchive import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -54,12 +53,16 @@ type ClearRepositoriesMeteringArchive struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int nodeid string maxarchiveversion string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewClearRepositoriesMeteringArchive type alias for index. @@ -88,7 +91,12 @@ func New(tp elastictransport.Interface) *ClearRepositoriesMeteringArchive { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -111,11 +119,17 @@ func (r *ClearRepositoriesMeteringArchive) HttpRequest(ctx context.Context) (*ht path.WriteString("_nodes") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "nodeid", r.nodeid) + } path.WriteString(r.nodeid) path.WriteString("/") path.WriteString("_repositories_metering") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "maxarchiveversion", r.maxarchiveversion) + } path.WriteString(r.maxarchiveversion) method = http.MethodDelete @@ -129,9 +143,9 @@ func (r *ClearRepositoriesMeteringArchive) HttpRequest(ctx context.Context) (*ht } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -148,27 +162,66 @@ func (r *ClearRepositoriesMeteringArchive) HttpRequest(ctx context.Context) (*ht } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ClearRepositoriesMeteringArchive) Perform(ctx context.Context) (*http.Response, error) { +func (r ClearRepositoriesMeteringArchive) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "nodes.clear_repositories_metering_archive") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "nodes.clear_repositories_metering_archive") + if reader := instrument.RecordRequestBody(ctx, "nodes.clear_repositories_metering_archive", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "nodes.clear_repositories_metering_archive") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ClearRepositoriesMeteringArchive query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ClearRepositoriesMeteringArchive query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a clearrepositoriesmeteringarchive.Response -func (r ClearRepositoriesMeteringArchive) Do(ctx context.Context) (*Response, error) { +func (r ClearRepositoriesMeteringArchive) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "nodes.clear_repositories_metering_archive") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -176,6 +229,9 @@ func (r ClearRepositoriesMeteringArchive) Do(ctx context.Context) (*Response, er if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -185,6 +241,9 @@ func (r ClearRepositoriesMeteringArchive) Do(ctx context.Context) (*Response, er errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -192,12 +251,25 @@ func (r ClearRepositoriesMeteringArchive) Do(ctx context.Context) (*Response, er errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ClearRepositoriesMeteringArchive) IsSuccess(ctx context.Context) (bool, error) { +func (r ClearRepositoriesMeteringArchive) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "nodes.clear_repositories_metering_archive") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -213,6 +285,14 @@ func (r ClearRepositoriesMeteringArchive) IsSuccess(ctx context.Context) (bool, return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ClearRepositoriesMeteringArchive query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/clearrepositoriesmeteringarchive/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/clearrepositoriesmeteringarchive/response.go index 2efc979ec..56daa1cbe 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/clearrepositoriesmeteringarchive/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/clearrepositoriesmeteringarchive/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package clearrepositoriesmeteringarchive @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package clearrepositoriesmeteringarchive // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/clear_repositories_metering_archive/ClearRepositoriesMeteringArchiveResponse.ts#L36-L38 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/clear_repositories_metering_archive/ClearRepositoriesMeteringArchiveResponse.ts#L36-L38 type Response struct { // ClusterName Name of the cluster. Based on the [Cluster name diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/getrepositoriesmeteringinfo/get_repositories_metering_info.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/getrepositoriesmeteringinfo/get_repositories_metering_info.go index 4641b38a8..a5f74e4cd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/getrepositoriesmeteringinfo/get_repositories_metering_info.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/getrepositoriesmeteringinfo/get_repositories_metering_info.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns cluster repositories metering information. package getrepositoriesmeteringinfo import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type GetRepositoriesMeteringInfo struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int nodeid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetRepositoriesMeteringInfo type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *GetRepositoriesMeteringInfo { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *GetRepositoriesMeteringInfo) HttpRequest(ctx context.Context) (*http.Re path.WriteString("_nodes") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "nodeid", r.nodeid) + } path.WriteString(r.nodeid) path.WriteString("/") path.WriteString("_repositories_metering") @@ -119,9 +130,9 @@ func (r *GetRepositoriesMeteringInfo) HttpRequest(ctx context.Context) (*http.Re } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -138,27 +149,66 @@ func (r *GetRepositoriesMeteringInfo) HttpRequest(ctx context.Context) (*http.Re } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetRepositoriesMeteringInfo) Perform(ctx context.Context) (*http.Response, error) { +func (r GetRepositoriesMeteringInfo) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "nodes.get_repositories_metering_info") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "nodes.get_repositories_metering_info") + if reader := instrument.RecordRequestBody(ctx, "nodes.get_repositories_metering_info", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "nodes.get_repositories_metering_info") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetRepositoriesMeteringInfo query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetRepositoriesMeteringInfo query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getrepositoriesmeteringinfo.Response -func (r GetRepositoriesMeteringInfo) Do(ctx context.Context) (*Response, error) { +func (r GetRepositoriesMeteringInfo) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "nodes.get_repositories_metering_info") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -166,6 +216,9 @@ func (r GetRepositoriesMeteringInfo) Do(ctx context.Context) (*Response, error) if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,6 +228,9 @@ func (r GetRepositoriesMeteringInfo) Do(ctx context.Context) (*Response, error) errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,12 +238,25 @@ func (r GetRepositoriesMeteringInfo) Do(ctx context.Context) (*Response, error) errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetRepositoriesMeteringInfo) IsSuccess(ctx context.Context) (bool, error) { +func (r GetRepositoriesMeteringInfo) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "nodes.get_repositories_metering_info") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -203,6 +272,14 @@ func (r GetRepositoriesMeteringInfo) IsSuccess(ctx context.Context) (bool, error return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetRepositoriesMeteringInfo query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/getrepositoriesmeteringinfo/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/getrepositoriesmeteringinfo/response.go index 8cdf542c1..ca08b951e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/getrepositoriesmeteringinfo/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/getrepositoriesmeteringinfo/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getrepositoriesmeteringinfo @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getrepositoriesmeteringinfo // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/get_repositories_metering_info/GetRepositoriesMeteringInfoResponse.ts#L36-L38 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/get_repositories_metering_info/GetRepositoriesMeteringInfoResponse.ts#L36-L38 type Response struct { // ClusterName Name of the cluster. Based on the [Cluster name diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/hotthreads/hot_threads.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/hotthreads/hot_threads.go index 846e2aba7..1a6263fff 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/hotthreads/hot_threads.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/hotthreads/hot_threads.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns information about hot threads on each node in the cluster. package hotthreads import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,11 +52,15 @@ type HotThreads struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int nodeid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewHotThreads type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *HotThreads { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -111,6 +119,9 @@ func (r *HotThreads) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_nodes") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "nodeid", r.nodeid) + } path.WriteString(r.nodeid) path.WriteString("/") path.WriteString("hot_threads") @@ -126,9 +137,9 @@ func (r *HotThreads) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -145,27 +156,66 @@ func (r *HotThreads) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r HotThreads) Perform(ctx context.Context) (*http.Response, error) { +func (r HotThreads) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "nodes.hot_threads") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "nodes.hot_threads") + if reader := instrument.RecordRequestBody(ctx, "nodes.hot_threads", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "nodes.hot_threads") + } if err != nil { - return nil, fmt.Errorf("an error happened during the HotThreads query execution: %w", err) + localErr := fmt.Errorf("an error happened during the HotThreads query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a hotthreads.Response -func (r HotThreads) Do(ctx context.Context) (*Response, error) { +func (r HotThreads) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "nodes.hot_threads") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -173,6 +223,9 @@ func (r HotThreads) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,6 +235,9 @@ func (r HotThreads) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -189,12 +245,25 @@ func (r HotThreads) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r HotThreads) IsSuccess(ctx context.Context) (bool, error) { +func (r HotThreads) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "nodes.hot_threads") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -210,6 +279,14 @@ func (r HotThreads) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the HotThreads query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/hotthreads/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/hotthreads/response.go index 7e57ffff6..cffd0b624 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/hotthreads/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/hotthreads/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package hotthreads @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package hotthreads // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/hot_threads/NodesHotThreadsResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/hot_threads/NodesHotThreadsResponse.ts#L22-L24 type Response struct { HotThreads []types.HotThread `json:"hot_threads"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/info/info.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/info/info.go index 98cf9b9d5..832771567 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/info/info.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/info/info.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns information about nodes in the cluster. package info import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -54,12 +53,16 @@ type Info struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int nodeid string metric string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewInfo type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *Info { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -111,6 +119,9 @@ func (r *Info) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_nodes") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "nodeid", r.nodeid) + } path.WriteString(r.nodeid) method = http.MethodGet @@ -119,6 +130,9 @@ func (r *Info) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_nodes") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "metric", r.metric) + } path.WriteString(r.metric) method = http.MethodGet @@ -127,9 +141,15 @@ func (r *Info) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_nodes") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "nodeid", r.nodeid) + } path.WriteString(r.nodeid) path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "metric", r.metric) + } path.WriteString(r.metric) method = http.MethodGet @@ -143,9 +163,9 @@ func (r *Info) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -162,27 +182,66 @@ func (r *Info) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Info) Perform(ctx context.Context) (*http.Response, error) { +func (r Info) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "nodes.info") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "nodes.info") + if reader := instrument.RecordRequestBody(ctx, "nodes.info", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "nodes.info") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Info query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Info query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a info.Response -func (r Info) Do(ctx context.Context) (*Response, error) { +func (r Info) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "nodes.info") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -190,6 +249,9 @@ func (r Info) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -199,6 +261,9 @@ func (r Info) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -206,12 +271,25 @@ func (r Info) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Info) IsSuccess(ctx context.Context) (bool, error) { +func (r Info) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "nodes.info") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -227,6 +305,14 @@ func (r Info) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Info query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/info/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/info/response.go index 48e3c6698..0cf0c0c83 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/info/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/info/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package info @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package info // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/NodesInfoResponse.ts#L30-L32 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/NodesInfoResponse.ts#L30-L32 type Response struct { ClusterName string `json:"cluster_name"` // NodeStats Contains statistics about the number of nodes selected by the request’s node diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/reloadsecuresettings/reload_secure_settings.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/reloadsecuresettings/reload_secure_settings.go index a3046b367..329008f6d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/reloadsecuresettings/reload_secure_settings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/reloadsecuresettings/reload_secure_settings.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Reloads secure settings. package reloadsecuresettings @@ -50,15 +50,19 @@ type ReloadSecureSettings struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int nodeid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewReloadSecureSettings type alias for index. @@ -82,11 +86,18 @@ func New(tp elastictransport.Interface) *ReloadSecureSettings { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -123,9 +134,7 @@ func (r *ReloadSecureSettings) HttpRequest(ctx context.Context) (*http.Request, } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -137,6 +146,10 @@ func (r *ReloadSecureSettings) HttpRequest(ctx context.Context) (*http.Request, } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -152,6 +165,9 @@ func (r *ReloadSecureSettings) HttpRequest(ctx context.Context) (*http.Request, path.WriteString("_nodes") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "nodeid", r.nodeid) + } path.WriteString(r.nodeid) path.WriteString("/") path.WriteString("reload_secure_settings") @@ -167,15 +183,15 @@ func (r *ReloadSecureSettings) HttpRequest(ctx context.Context) (*http.Request, } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -192,27 +208,66 @@ func (r *ReloadSecureSettings) HttpRequest(ctx context.Context) (*http.Request, } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ReloadSecureSettings) Perform(ctx context.Context) (*http.Response, error) { +func (r ReloadSecureSettings) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "nodes.reload_secure_settings") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "nodes.reload_secure_settings") + if reader := instrument.RecordRequestBody(ctx, "nodes.reload_secure_settings", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "nodes.reload_secure_settings") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ReloadSecureSettings query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ReloadSecureSettings query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a reloadsecuresettings.Response -func (r ReloadSecureSettings) Do(ctx context.Context) (*Response, error) { +func (r ReloadSecureSettings) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "nodes.reload_secure_settings") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -220,6 +275,9 @@ func (r ReloadSecureSettings) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -229,6 +287,9 @@ func (r ReloadSecureSettings) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -236,6 +297,9 @@ func (r ReloadSecureSettings) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/reloadsecuresettings/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/reloadsecuresettings/request.go index 62fd8881c..d249083b4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/reloadsecuresettings/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/reloadsecuresettings/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package reloadsecuresettings @@ -27,7 +27,7 @@ import ( // Request holds the request body struct for the package reloadsecuresettings // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/reload_secure_settings/ReloadSecureSettingsRequest.ts#L24-L50 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/reload_secure_settings/ReloadSecureSettingsRequest.ts#L24-L50 type Request struct { // SecureSettingsPassword The password for the Elasticsearch keystore. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/reloadsecuresettings/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/reloadsecuresettings/response.go index bfe86dd75..bb094b3fa 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/reloadsecuresettings/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/reloadsecuresettings/response.go @@ -16,17 +16,22 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package reloadsecuresettings import ( + "bytes" + "encoding/json" + "errors" + "io" + "github.com/elastic/go-elasticsearch/v8/typedapi/types" ) // Response holds the response body struct for the package reloadsecuresettings // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/reload_secure_settings/ReloadSecureSettingsResponse.ts#L30-L32 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/reload_secure_settings/ReloadSecureSettingsResponse.ts#L30-L32 type Response struct { ClusterName string `json:"cluster_name"` // NodeStats Contains statistics about the number of nodes selected by the request’s node @@ -42,3 +47,40 @@ func NewResponse() *Response { } return r } + +func (s *Response) UnmarshalJSON(data []byte) error { + dec := json.NewDecoder(bytes.NewReader(data)) + + for { + t, err := dec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "cluster_name": + if err := dec.Decode(&s.ClusterName); err != nil { + return err + } + + case "_nodes": + if err := dec.Decode(&s.NodeStats); err != nil { + return err + } + + case "nodes": + if s.Nodes == nil { + s.Nodes = make(map[string]types.NodeReloadResult, 0) + } + if err := dec.Decode(&s.Nodes); err != nil { + return err + } + + } + } + return nil +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/stats/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/stats/response.go index 5acdea029..0ebb39806 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/stats/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/stats/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package stats @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package stats // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/stats/NodesStatsResponse.ts#L30-L32 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/stats/NodesStatsResponse.ts#L30-L32 type Response struct { ClusterName *string `json:"cluster_name,omitempty"` // NodeStats Contains statistics about the number of nodes selected by the request’s node diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/stats/stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/stats/stats.go index a130f53b7..640df6d5c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/stats/stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/stats/stats.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns statistical information about nodes in the cluster. package stats import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -57,13 +56,17 @@ type Stats struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int nodeid string metric string indexmetric string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewStats type alias for index. @@ -87,7 +90,12 @@ func New(tp elastictransport.Interface) *Stats { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -117,6 +125,9 @@ func (r *Stats) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_nodes") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "nodeid", r.nodeid) + } path.WriteString(r.nodeid) path.WriteString("/") path.WriteString("stats") @@ -129,6 +140,9 @@ func (r *Stats) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("stats") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "metric", r.metric) + } path.WriteString(r.metric) method = http.MethodGet @@ -137,11 +151,17 @@ func (r *Stats) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_nodes") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "nodeid", r.nodeid) + } path.WriteString(r.nodeid) path.WriteString("/") path.WriteString("stats") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "metric", r.metric) + } path.WriteString(r.metric) method = http.MethodGet @@ -152,9 +172,15 @@ func (r *Stats) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("stats") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "metric", r.metric) + } path.WriteString(r.metric) path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "indexmetric", r.indexmetric) + } path.WriteString(r.indexmetric) method = http.MethodGet @@ -163,14 +189,23 @@ func (r *Stats) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_nodes") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "nodeid", r.nodeid) + } path.WriteString(r.nodeid) path.WriteString("/") path.WriteString("stats") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "metric", r.metric) + } path.WriteString(r.metric) path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "indexmetric", r.indexmetric) + } path.WriteString(r.indexmetric) method = http.MethodGet @@ -184,9 +219,9 @@ func (r *Stats) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -203,27 +238,66 @@ func (r *Stats) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Stats) Perform(ctx context.Context) (*http.Response, error) { +func (r Stats) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "nodes.stats") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "nodes.stats") + if reader := instrument.RecordRequestBody(ctx, "nodes.stats", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "nodes.stats") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Stats query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Stats query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a stats.Response -func (r Stats) Do(ctx context.Context) (*Response, error) { +func (r Stats) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "nodes.stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -231,6 +305,9 @@ func (r Stats) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -240,6 +317,9 @@ func (r Stats) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -247,12 +327,25 @@ func (r Stats) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Stats) IsSuccess(ctx context.Context) (bool, error) { +func (r Stats) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "nodes.stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -268,6 +361,14 @@ func (r Stats) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Stats query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/usage/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/usage/response.go index 69a5938ba..630974f05 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/usage/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/usage/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package usage @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package usage // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/usage/NodesUsageResponse.ts#L30-L32 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/usage/NodesUsageResponse.ts#L30-L32 type Response struct { ClusterName string `json:"cluster_name"` // NodeStats Contains statistics about the number of nodes selected by the request’s node diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/usage/usage.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/usage/usage.go index fee7d6701..b51b90147 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/usage/usage.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/nodes/usage/usage.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns low-level information about REST actions usage on nodes. package usage import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,12 +52,16 @@ type Usage struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int nodeid string metric string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewUsage type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *Usage { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -112,6 +120,9 @@ func (r *Usage) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_nodes") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "nodeid", r.nodeid) + } path.WriteString(r.nodeid) path.WriteString("/") path.WriteString("usage") @@ -124,6 +135,9 @@ func (r *Usage) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("usage") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "metric", r.metric) + } path.WriteString(r.metric) method = http.MethodGet @@ -132,11 +146,17 @@ func (r *Usage) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_nodes") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "nodeid", r.nodeid) + } path.WriteString(r.nodeid) path.WriteString("/") path.WriteString("usage") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "metric", r.metric) + } path.WriteString(r.metric) method = http.MethodGet @@ -150,9 +170,9 @@ func (r *Usage) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -169,27 +189,66 @@ func (r *Usage) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Usage) Perform(ctx context.Context) (*http.Response, error) { +func (r Usage) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "nodes.usage") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "nodes.usage") + if reader := instrument.RecordRequestBody(ctx, "nodes.usage", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "nodes.usage") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Usage query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Usage query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a usage.Response -func (r Usage) Do(ctx context.Context) (*Response, error) { +func (r Usage) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "nodes.usage") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -197,6 +256,9 @@ func (r Usage) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -206,6 +268,9 @@ func (r Usage) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -213,12 +278,25 @@ func (r Usage) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Usage) IsSuccess(ctx context.Context) (bool, error) { +func (r Usage) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "nodes.usage") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -234,6 +312,14 @@ func (r Usage) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Usage query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/delete/delete.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/delete/delete.go index d5e771b4c..f371d9536 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/delete/delete.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/delete/delete.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes a query ruleset. package delete import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type Delete struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int rulesetid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDelete type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *Delete { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *Delete) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_query_rules") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "rulesetid", r.rulesetid) + } path.WriteString(r.rulesetid) method = http.MethodDelete @@ -117,9 +128,9 @@ func (r *Delete) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -136,27 +147,66 @@ func (r *Delete) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Delete) Perform(ctx context.Context) (*http.Response, error) { +func (r Delete) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "query_ruleset.delete") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "query_ruleset.delete") + if reader := instrument.RecordRequestBody(ctx, "query_ruleset.delete", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "query_ruleset.delete") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Delete query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Delete query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a delete.Response -func (r Delete) Do(ctx context.Context) (*Response, error) { +func (r Delete) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "query_ruleset.delete") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -164,6 +214,9 @@ func (r Delete) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -173,6 +226,9 @@ func (r Delete) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -180,12 +236,25 @@ func (r Delete) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Delete) IsSuccess(ctx context.Context) (bool, error) { +func (r Delete) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "query_ruleset.delete") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -201,6 +270,14 @@ func (r Delete) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Delete query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/delete/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/delete/response.go index e3ebb15a3..ce0bbfe91 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/delete/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/delete/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package delete // Response holds the response body struct for the package delete // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/query_ruleset/delete/QueryRulesetDeleteResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/query_ruleset/delete/QueryRulesetDeleteResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/get/get.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/get/get.go index a2d8409a2..e3c0bc989 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/get/get.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/get/get.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns the details about a query ruleset. package get import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type Get struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int rulesetid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGet type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *Get { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *Get) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_query_rules") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "rulesetid", r.rulesetid) + } path.WriteString(r.rulesetid) method = http.MethodGet @@ -117,9 +128,9 @@ func (r *Get) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -136,27 +147,66 @@ func (r *Get) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Get) Perform(ctx context.Context) (*http.Response, error) { +func (r Get) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "query_ruleset.get") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "query_ruleset.get") + if reader := instrument.RecordRequestBody(ctx, "query_ruleset.get", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "query_ruleset.get") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Get query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Get query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a get.Response -func (r Get) Do(ctx context.Context) (*Response, error) { +func (r Get) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "query_ruleset.get") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -164,6 +214,9 @@ func (r Get) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -173,6 +226,9 @@ func (r Get) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -180,12 +236,25 @@ func (r Get) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Get) IsSuccess(ctx context.Context) (bool, error) { +func (r Get) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "query_ruleset.get") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -201,6 +270,14 @@ func (r Get) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Get query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/get/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/get/response.go index 014eb499b..bb0dc8d52 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/get/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/get/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package get @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package get // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/query_ruleset/get/QueryRulesetGetResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/query_ruleset/get/QueryRulesetGetResponse.ts#L22-L24 type Response struct { // Rules Rules associated with the query ruleset diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/list/list.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/list/list.go index b2b0fbd96..3fc71c889 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/list/list.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/list/list.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Lists query rulesets. package list import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -48,9 +47,13 @@ type List struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewList type alias for index. @@ -74,7 +77,12 @@ func New(tp elastictransport.Interface) *List { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -107,9 +115,9 @@ func (r *List) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -126,27 +134,66 @@ func (r *List) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r List) Perform(ctx context.Context) (*http.Response, error) { +func (r List) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "query_ruleset.list") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "query_ruleset.list") + if reader := instrument.RecordRequestBody(ctx, "query_ruleset.list", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "query_ruleset.list") + } if err != nil { - return nil, fmt.Errorf("an error happened during the List query execution: %w", err) + localErr := fmt.Errorf("an error happened during the List query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a list.Response -func (r List) Do(ctx context.Context) (*Response, error) { +func (r List) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "query_ruleset.list") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -154,6 +201,9 @@ func (r List) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -163,6 +213,9 @@ func (r List) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -170,12 +223,25 @@ func (r List) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r List) IsSuccess(ctx context.Context) (bool, error) { +func (r List) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "query_ruleset.list") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -191,6 +257,14 @@ func (r List) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the List query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/list/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/list/response.go index 6a1d3b6e8..9917fcf36 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/list/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/list/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package list @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package list // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/query_ruleset/list/QueryRulesetListResponse.ts#L23-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/query_ruleset/list/QueryRulesetListResponse.ts#L23-L28 type Response struct { Count int64 `json:"count"` Results []types.QueryRulesetListItem `json:"results"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/put/put.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/put/put.go index 52291e705..1d0edc6f4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/put/put.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/put/put.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates or updates a query ruleset. package put @@ -50,15 +50,19 @@ type Put struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int rulesetid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPut type alias for index. @@ -84,11 +88,18 @@ func New(tp elastictransport.Interface) *Put { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -125,9 +136,7 @@ func (r *Put) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -139,6 +148,10 @@ func (r *Put) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -147,6 +160,9 @@ func (r *Put) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_query_rules") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "rulesetid", r.rulesetid) + } path.WriteString(r.rulesetid) method = http.MethodPut @@ -160,15 +176,15 @@ func (r *Put) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -185,27 +201,66 @@ func (r *Put) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Put) Perform(ctx context.Context) (*http.Response, error) { +func (r Put) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "query_ruleset.put") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "query_ruleset.put") + if reader := instrument.RecordRequestBody(ctx, "query_ruleset.put", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "query_ruleset.put") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Put query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Put query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a put.Response -func (r Put) Do(ctx context.Context) (*Response, error) { +func (r Put) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "query_ruleset.put") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -213,6 +268,9 @@ func (r Put) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -222,6 +280,9 @@ func (r Put) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -229,6 +290,9 @@ func (r Put) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/put/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/put/request.go index ec3ec5106..40ca2821b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/put/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/put/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package put @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package put // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/query_ruleset/put/QueryRulesetPutRequest.ts#L23-L43 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/query_ruleset/put/QueryRulesetPutRequest.ts#L23-L43 type Request struct { Rules []types.QueryRule `json:"rules"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/put/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/put/response.go index e288bc520..0459e13f8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/put/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/queryruleset/put/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package put @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package put // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/query_ruleset/put/QueryRulesetPutResponse.ts#L22-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/query_ruleset/put/QueryRulesetPutResponse.ts#L22-L26 type Response struct { Result result.Result `json:"result"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/deletejob/delete_job.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/deletejob/delete_job.go index f0c2d2c5a..f139dbf01 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/deletejob/delete_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/deletejob/delete_job.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes an existing rollup job. package deletejob import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type DeleteJob struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteJob type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *DeleteJob { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *DeleteJob) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("job") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodDelete @@ -119,9 +130,9 @@ func (r *DeleteJob) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -138,27 +149,66 @@ func (r *DeleteJob) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteJob) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteJob) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "rollup.delete_job") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "rollup.delete_job") + if reader := instrument.RecordRequestBody(ctx, "rollup.delete_job", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "rollup.delete_job") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteJob query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteJob query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deletejob.Response -func (r DeleteJob) Do(ctx context.Context) (*Response, error) { +func (r DeleteJob) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "rollup.delete_job") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -166,6 +216,9 @@ func (r DeleteJob) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,6 +228,9 @@ func (r DeleteJob) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,12 +238,25 @@ func (r DeleteJob) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteJob) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteJob) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "rollup.delete_job") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -203,6 +272,14 @@ func (r DeleteJob) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteJob query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/deletejob/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/deletejob/response.go index 7b07597f9..16b77f544 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/deletejob/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/deletejob/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deletejob @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package deletejob // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/rollup/delete_job/DeleteRollupJobResponse.ts#L22-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/rollup/delete_job/DeleteRollupJobResponse.ts#L22-L27 type Response struct { Acknowledged bool `json:"acknowledged"` TaskFailures []types.TaskFailure `json:"task_failures,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/getjobs/get_jobs.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/getjobs/get_jobs.go index eac72c500..329e97dcb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/getjobs/get_jobs.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/getjobs/get_jobs.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves the configuration, stats, and status of rollup jobs. package getjobs import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type GetJobs struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetJobs type alias for index. @@ -79,7 +82,12 @@ func New(tp elastictransport.Interface) *GetJobs { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *GetJobs) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("job") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodGet @@ -124,9 +135,9 @@ func (r *GetJobs) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -143,27 +154,66 @@ func (r *GetJobs) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetJobs) Perform(ctx context.Context) (*http.Response, error) { +func (r GetJobs) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "rollup.get_jobs") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "rollup.get_jobs") + if reader := instrument.RecordRequestBody(ctx, "rollup.get_jobs", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "rollup.get_jobs") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetJobs query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetJobs query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getjobs.Response -func (r GetJobs) Do(ctx context.Context) (*Response, error) { +func (r GetJobs) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "rollup.get_jobs") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -171,6 +221,9 @@ func (r GetJobs) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -180,6 +233,9 @@ func (r GetJobs) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -187,12 +243,25 @@ func (r GetJobs) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetJobs) IsSuccess(ctx context.Context) (bool, error) { +func (r GetJobs) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "rollup.get_jobs") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -208,6 +277,14 @@ func (r GetJobs) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetJobs query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/getjobs/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/getjobs/response.go index cdc101887..8945dd4c8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/getjobs/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/getjobs/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getjobs @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getjobs // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/rollup/get_jobs/GetRollupJobResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/rollup/get_jobs/GetRollupJobResponse.ts#L22-L24 type Response struct { Jobs []types.RollupJob `json:"jobs"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/getrollupcaps/get_rollup_caps.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/getrollupcaps/get_rollup_caps.go index 06389078a..0078b4d8c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/getrollupcaps/get_rollup_caps.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/getrollupcaps/get_rollup_caps.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns the capabilities of any rollup jobs that have been configured for a // specific index or index pattern. package getrollupcaps import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type GetRollupCaps struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetRollupCaps type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *GetRollupCaps { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *GetRollupCaps) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("data") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodGet @@ -126,9 +137,9 @@ func (r *GetRollupCaps) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -145,27 +156,66 @@ func (r *GetRollupCaps) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetRollupCaps) Perform(ctx context.Context) (*http.Response, error) { +func (r GetRollupCaps) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "rollup.get_rollup_caps") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "rollup.get_rollup_caps") + if reader := instrument.RecordRequestBody(ctx, "rollup.get_rollup_caps", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "rollup.get_rollup_caps") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetRollupCaps query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetRollupCaps query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getrollupcaps.Response -func (r GetRollupCaps) Do(ctx context.Context) (Response, error) { +func (r GetRollupCaps) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "rollup.get_rollup_caps") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -173,6 +223,9 @@ func (r GetRollupCaps) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,6 +235,9 @@ func (r GetRollupCaps) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -189,12 +245,25 @@ func (r GetRollupCaps) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetRollupCaps) IsSuccess(ctx context.Context) (bool, error) { +func (r GetRollupCaps) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "rollup.get_rollup_caps") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -210,6 +279,14 @@ func (r GetRollupCaps) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetRollupCaps query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/getrollupcaps/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/getrollupcaps/response.go index c0aa52bad..49a3446eb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/getrollupcaps/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/getrollupcaps/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getrollupcaps @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getrollupcaps // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/rollup/get_rollup_caps/GetRollupCapabilitiesResponse.ts#L24-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/rollup/get_rollup_caps/GetRollupCapabilitiesResponse.ts#L24-L26 type Response map[string]types.RollupCapabilities diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/getrollupindexcaps/get_rollup_index_caps.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/getrollupindexcaps/get_rollup_index_caps.go index a52a49223..ac6b26329 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/getrollupindexcaps/get_rollup_index_caps.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/getrollupindexcaps/get_rollup_index_caps.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns the rollup capabilities of all jobs inside of a rollup index (e.g. // the index where rollup data is stored). package getrollupindexcaps import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type GetRollupIndexCaps struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetRollupIndexCaps type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *GetRollupIndexCaps { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *GetRollupIndexCaps) HttpRequest(ctx context.Context) (*http.Request, er case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_rollup") @@ -121,9 +132,9 @@ func (r *GetRollupIndexCaps) HttpRequest(ctx context.Context) (*http.Request, er } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -140,27 +151,66 @@ func (r *GetRollupIndexCaps) HttpRequest(ctx context.Context) (*http.Request, er } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetRollupIndexCaps) Perform(ctx context.Context) (*http.Response, error) { +func (r GetRollupIndexCaps) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "rollup.get_rollup_index_caps") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "rollup.get_rollup_index_caps") + if reader := instrument.RecordRequestBody(ctx, "rollup.get_rollup_index_caps", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "rollup.get_rollup_index_caps") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetRollupIndexCaps query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetRollupIndexCaps query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getrollupindexcaps.Response -func (r GetRollupIndexCaps) Do(ctx context.Context) (Response, error) { +func (r GetRollupIndexCaps) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "rollup.get_rollup_index_caps") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -168,6 +218,9 @@ func (r GetRollupIndexCaps) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -177,6 +230,9 @@ func (r GetRollupIndexCaps) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,12 +240,25 @@ func (r GetRollupIndexCaps) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetRollupIndexCaps) IsSuccess(ctx context.Context) (bool, error) { +func (r GetRollupIndexCaps) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "rollup.get_rollup_index_caps") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -205,6 +274,14 @@ func (r GetRollupIndexCaps) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetRollupIndexCaps query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/getrollupindexcaps/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/getrollupindexcaps/response.go index e0479e6b9..83d538105 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/getrollupindexcaps/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/getrollupindexcaps/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getrollupindexcaps @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getrollupindexcaps // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/rollup/get_rollup_index_caps/GetRollupIndexCapabilitiesResponse.ts#L24-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/rollup/get_rollup_index_caps/GetRollupIndexCapabilitiesResponse.ts#L24-L26 type Response map[string]types.IndexCapabilities diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/putjob/put_job.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/putjob/put_job.go index d590ba897..1b6f8d632 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/putjob/put_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/putjob/put_job.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates a rollup job. package putjob @@ -50,15 +50,19 @@ type PutJob struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutJob type alias for index. @@ -84,11 +88,18 @@ func New(tp elastictransport.Interface) *PutJob { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -125,9 +136,7 @@ func (r *PutJob) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -139,6 +148,10 @@ func (r *PutJob) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -149,6 +162,9 @@ func (r *PutJob) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("job") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodPut @@ -162,15 +178,15 @@ func (r *PutJob) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -187,27 +203,66 @@ func (r *PutJob) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutJob) Perform(ctx context.Context) (*http.Response, error) { +func (r PutJob) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "rollup.put_job") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "rollup.put_job") + if reader := instrument.RecordRequestBody(ctx, "rollup.put_job", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "rollup.put_job") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutJob query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutJob query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a putjob.Response -func (r PutJob) Do(ctx context.Context) (*Response, error) { +func (r PutJob) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "rollup.put_job") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -215,6 +270,9 @@ func (r PutJob) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -224,6 +282,9 @@ func (r PutJob) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -231,6 +292,9 @@ func (r PutJob) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/putjob/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/putjob/request.go index 39f2409fb..14b34b8ea 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/putjob/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/putjob/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putjob @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package putjob // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/rollup/put_job/CreateRollupJobRequest.ts#L27-L89 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/rollup/put_job/CreateRollupJobRequest.ts#L27-L89 type Request struct { // Cron A cron string which defines the intervals when the rollup job should be diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/putjob/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/putjob/response.go index 658f66ab9..7609c1dee 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/putjob/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/putjob/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putjob // Response holds the response body struct for the package putjob // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/rollup/put_job/CreateRollupJobResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/rollup/put_job/CreateRollupJobResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/rollupsearch/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/rollupsearch/request.go index 3e6eb3679..e90ad1742 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/rollupsearch/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/rollupsearch/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package rollupsearch @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package rollupsearch // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/rollup/rollup_search/RollupSearchRequest.ts#L27-L57 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/rollup/rollup_search/RollupSearchRequest.ts#L27-L57 type Request struct { // Aggregations Specifies aggregations. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/rollupsearch/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/rollupsearch/response.go index 2b00f42c3..fbe28328c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/rollupsearch/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/rollupsearch/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package rollupsearch @@ -33,7 +33,7 @@ import ( // Response holds the response body struct for the package rollupsearch // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/rollup/rollup_search/RollupSearchResponse.ts#L27-L36 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/rollup/rollup_search/RollupSearchResponse.ts#L27-L36 type Response struct { Aggregations map[string]types.Aggregate `json:"aggregations,omitempty"` Hits types.HitsMetadata `json:"hits"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/rollupsearch/rollup_search.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/rollupsearch/rollup_search.go index a6e3fc33c..e4476a863 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/rollupsearch/rollup_search.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/rollupsearch/rollup_search.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Enables searching rolled-up data using the standard query DSL. package rollupsearch @@ -51,15 +51,19 @@ type RollupSearch struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewRollupSearch type alias for index. @@ -85,11 +89,18 @@ func New(tp elastictransport.Interface) *RollupSearch { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -126,9 +137,7 @@ func (r *RollupSearch) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -140,12 +149,19 @@ func (r *RollupSearch) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_rollup_search") @@ -161,15 +177,15 @@ func (r *RollupSearch) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -186,22 +202,58 @@ func (r *RollupSearch) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r RollupSearch) Perform(ctx context.Context) (*http.Response, error) { +func (r RollupSearch) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "rollup.rollup_search") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "rollup.rollup_search") + if reader := instrument.RecordRequestBody(ctx, "rollup.rollup_search", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "rollup.rollup_search") + } if err != nil { - return nil, fmt.Errorf("an error happened during the RollupSearch query execution: %w", err) + localErr := fmt.Errorf("an error happened during the RollupSearch query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a rollupsearch.Response -func (r RollupSearch) Do(ctx context.Context) (*Response, error) { +func (r RollupSearch) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "rollup.rollup_search") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() @@ -209,6 +261,9 @@ func (r RollupSearch) Do(ctx context.Context) (*Response, error) { res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -216,6 +271,9 @@ func (r RollupSearch) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -225,6 +283,9 @@ func (r RollupSearch) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -232,6 +293,9 @@ func (r RollupSearch) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/startjob/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/startjob/response.go index 1e89dfaa6..db266afdd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/startjob/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/startjob/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package startjob // Response holds the response body struct for the package startjob // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/rollup/start_job/StartRollupJobResponse.ts#L20-L22 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/rollup/start_job/StartRollupJobResponse.ts#L20-L22 type Response struct { Started bool `json:"started"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/startjob/start_job.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/startjob/start_job.go index 48199fc0e..e9fe9db38 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/startjob/start_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/startjob/start_job.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Starts an existing, stopped rollup job. package startjob import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type StartJob struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewStartJob type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *StartJob { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *StartJob) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("job") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) path.WriteString("/") path.WriteString("_start") @@ -121,9 +132,9 @@ func (r *StartJob) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -140,27 +151,66 @@ func (r *StartJob) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r StartJob) Perform(ctx context.Context) (*http.Response, error) { +func (r StartJob) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "rollup.start_job") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "rollup.start_job") + if reader := instrument.RecordRequestBody(ctx, "rollup.start_job", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "rollup.start_job") + } if err != nil { - return nil, fmt.Errorf("an error happened during the StartJob query execution: %w", err) + localErr := fmt.Errorf("an error happened during the StartJob query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a startjob.Response -func (r StartJob) Do(ctx context.Context) (*Response, error) { +func (r StartJob) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "rollup.start_job") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -168,6 +218,9 @@ func (r StartJob) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -177,6 +230,9 @@ func (r StartJob) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,12 +240,25 @@ func (r StartJob) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r StartJob) IsSuccess(ctx context.Context) (bool, error) { +func (r StartJob) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "rollup.start_job") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -205,6 +274,14 @@ func (r StartJob) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the StartJob query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/stopjob/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/stopjob/response.go index 512ec5e9a..3f66a9eb0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/stopjob/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/stopjob/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package stopjob // Response holds the response body struct for the package stopjob // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/rollup/stop_job/StopRollupJobResponse.ts#L20-L22 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/rollup/stop_job/StopRollupJobResponse.ts#L20-L22 type Response struct { Stopped bool `json:"stopped"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/stopjob/stop_job.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/stopjob/stop_job.go index 75b55558c..32d0c1ea4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/stopjob/stop_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/rollup/stopjob/stop_job.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Stops an existing, started rollup job. package stopjob import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type StopJob struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewStopJob type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *StopJob { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -107,6 +115,9 @@ func (r *StopJob) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("job") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) path.WriteString("/") path.WriteString("_stop") @@ -122,9 +133,9 @@ func (r *StopJob) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -141,27 +152,66 @@ func (r *StopJob) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r StopJob) Perform(ctx context.Context) (*http.Response, error) { +func (r StopJob) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "rollup.stop_job") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "rollup.stop_job") + if reader := instrument.RecordRequestBody(ctx, "rollup.stop_job", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "rollup.stop_job") + } if err != nil { - return nil, fmt.Errorf("an error happened during the StopJob query execution: %w", err) + localErr := fmt.Errorf("an error happened during the StopJob query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a stopjob.Response -func (r StopJob) Do(ctx context.Context) (*Response, error) { +func (r StopJob) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "rollup.stop_job") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -169,6 +219,9 @@ func (r StopJob) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -178,6 +231,9 @@ func (r StopJob) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -185,12 +241,25 @@ func (r StopJob) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r StopJob) IsSuccess(ctx context.Context) (bool, error) { +func (r StopJob) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "rollup.stop_job") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -206,6 +275,14 @@ func (r StopJob) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the StopJob query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/cachestats/cache_stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/cachestats/cache_stats.go index 7d1f752aa..91237d0df 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/cachestats/cache_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/cachestats/cache_stats.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieve node-level cache statistics about searchable snapshots. package cachestats import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type CacheStats struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int nodeid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewCacheStats type alias for index. @@ -79,7 +82,12 @@ func New(tp elastictransport.Interface) *CacheStats { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -111,6 +119,9 @@ func (r *CacheStats) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_searchable_snapshots") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "nodeid", r.nodeid) + } path.WriteString(r.nodeid) path.WriteString("/") path.WriteString("cache") @@ -128,9 +139,9 @@ func (r *CacheStats) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -147,27 +158,66 @@ func (r *CacheStats) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r CacheStats) Perform(ctx context.Context) (*http.Response, error) { +func (r CacheStats) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "searchable_snapshots.cache_stats") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "searchable_snapshots.cache_stats") + if reader := instrument.RecordRequestBody(ctx, "searchable_snapshots.cache_stats", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "searchable_snapshots.cache_stats") + } if err != nil { - return nil, fmt.Errorf("an error happened during the CacheStats query execution: %w", err) + localErr := fmt.Errorf("an error happened during the CacheStats query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a cachestats.Response -func (r CacheStats) Do(ctx context.Context) (*Response, error) { +func (r CacheStats) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "searchable_snapshots.cache_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -175,6 +225,9 @@ func (r CacheStats) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,6 +237,9 @@ func (r CacheStats) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -191,12 +247,25 @@ func (r CacheStats) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r CacheStats) IsSuccess(ctx context.Context) (bool, error) { +func (r CacheStats) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "searchable_snapshots.cache_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -212,6 +281,14 @@ func (r CacheStats) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the CacheStats query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/cachestats/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/cachestats/response.go index 80bcb2ed5..6cb3a69cb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/cachestats/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/cachestats/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package cachestats @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package cachestats // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/searchable_snapshots/cache_stats/Response.ts#L24-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/searchable_snapshots/cache_stats/Response.ts#L24-L28 type Response struct { Nodes map[string]types.Node `json:"nodes"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/clearcache/clear_cache.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/clearcache/clear_cache.go index ad99cf6d4..9e0a5a992 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/clearcache/clear_cache.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/clearcache/clear_cache.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Clear the cache of searchable snapshots. package clearcache import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,11 +52,15 @@ type ClearCache struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewClearCache type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *ClearCache { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -111,6 +119,9 @@ func (r *ClearCache) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_searchable_snapshots") @@ -130,9 +141,9 @@ func (r *ClearCache) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -149,27 +160,66 @@ func (r *ClearCache) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ClearCache) Perform(ctx context.Context) (*http.Response, error) { +func (r ClearCache) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "searchable_snapshots.clear_cache") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "searchable_snapshots.clear_cache") + if reader := instrument.RecordRequestBody(ctx, "searchable_snapshots.clear_cache", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "searchable_snapshots.clear_cache") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ClearCache query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ClearCache query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a clearcache.Response -func (r ClearCache) Do(ctx context.Context) (Response, error) { +func (r ClearCache) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "searchable_snapshots.clear_cache") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := new(Response) res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -177,6 +227,9 @@ func (r ClearCache) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -186,6 +239,9 @@ func (r ClearCache) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -193,12 +249,25 @@ func (r ClearCache) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ClearCache) IsSuccess(ctx context.Context) (bool, error) { +func (r ClearCache) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "searchable_snapshots.clear_cache") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -214,6 +283,14 @@ func (r ClearCache) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ClearCache query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/clearcache/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/clearcache/response.go index 3b530213b..32757c7ab 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/clearcache/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/clearcache/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package clearcache @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package clearcache // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/searchable_snapshots/clear_cache/SearchableSnapshotsClearCacheResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/searchable_snapshots/clear_cache/SearchableSnapshotsClearCacheResponse.ts#L22-L24 type Response = json.RawMessage diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/mount/mount.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/mount/mount.go index 91aa90f5c..77c15b335 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/mount/mount.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/mount/mount.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Mount a snapshot as a searchable index. package mount @@ -53,16 +53,20 @@ type Mount struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int repository string snapshot string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewMount type alias for index. @@ -90,11 +94,18 @@ func New(tp elastictransport.Interface) *Mount { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -131,9 +142,7 @@ func (r *Mount) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -145,6 +154,10 @@ func (r *Mount) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -153,9 +166,15 @@ func (r *Mount) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_snapshot") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "repository", r.repository) + } path.WriteString(r.repository) path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "snapshot", r.snapshot) + } path.WriteString(r.snapshot) path.WriteString("/") path.WriteString("_mount") @@ -171,15 +190,15 @@ func (r *Mount) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -196,27 +215,66 @@ func (r *Mount) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Mount) Perform(ctx context.Context) (*http.Response, error) { +func (r Mount) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "searchable_snapshots.mount") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "searchable_snapshots.mount") + if reader := instrument.RecordRequestBody(ctx, "searchable_snapshots.mount", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "searchable_snapshots.mount") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Mount query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Mount query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a mount.Response -func (r Mount) Do(ctx context.Context) (*Response, error) { +func (r Mount) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "searchable_snapshots.mount") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -224,6 +282,9 @@ func (r Mount) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -233,6 +294,9 @@ func (r Mount) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -240,6 +304,9 @@ func (r Mount) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/mount/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/mount/request.go index 45432a1af..ace49d843 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/mount/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/mount/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package mount @@ -27,7 +27,7 @@ import ( // Request holds the request body struct for the package mount // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/searchable_snapshots/mount/SearchableSnapshotsMountRequest.ts#L26-L49 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/searchable_snapshots/mount/SearchableSnapshotsMountRequest.ts#L26-L49 type Request struct { IgnoreIndexSettings []string `json:"ignore_index_settings,omitempty"` Index string `json:"index"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/mount/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/mount/response.go index 1891fef9d..4c4fc9fd4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/mount/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/mount/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package mount @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package mount // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/searchable_snapshots/mount/SearchableSnapshotsMountResponse.ts#L22-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/searchable_snapshots/mount/SearchableSnapshotsMountResponse.ts#L22-L26 type Response struct { Snapshot types.MountedSnapshot `json:"snapshot"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/stats/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/stats/response.go index a193f6740..1009f6ec9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/stats/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/stats/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package stats @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package stats // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/searchable_snapshots/stats/SearchableSnapshotsStatsResponse.ts#L22-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/searchable_snapshots/stats/SearchableSnapshotsStatsResponse.ts#L22-L27 type Response struct { Stats json.RawMessage `json:"stats,omitempty"` Total json.RawMessage `json:"total,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/stats/stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/stats/stats.go index ba2ef9a5d..aeacf59e5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/stats/stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchablesnapshots/stats/stats.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieve shard-level statistics about searchable snapshots. package stats import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type Stats struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int index string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewStats type alias for index. @@ -80,7 +83,12 @@ func New(tp elastictransport.Interface) *Stats { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,6 +116,9 @@ func (r *Stats) HttpRequest(ctx context.Context) (*http.Request, error) { case r.paramSet == indexMask: path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "index", r.index) + } path.WriteString(r.index) path.WriteString("/") path.WriteString("_searchable_snapshots") @@ -125,9 +136,9 @@ func (r *Stats) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -144,27 +155,66 @@ func (r *Stats) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Stats) Perform(ctx context.Context) (*http.Response, error) { +func (r Stats) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "searchable_snapshots.stats") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "searchable_snapshots.stats") + if reader := instrument.RecordRequestBody(ctx, "searchable_snapshots.stats", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "searchable_snapshots.stats") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Stats query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Stats query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a stats.Response -func (r Stats) Do(ctx context.Context) (*Response, error) { +func (r Stats) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "searchable_snapshots.stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -172,6 +222,9 @@ func (r Stats) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -181,6 +234,9 @@ func (r Stats) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -188,12 +244,25 @@ func (r Stats) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Stats) IsSuccess(ctx context.Context) (bool, error) { +func (r Stats) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "searchable_snapshots.stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -209,6 +278,14 @@ func (r Stats) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Stats query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/delete/delete.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/delete/delete.go index 2537858fb..d5f887c3f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/delete/delete.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/delete/delete.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes a search application. package delete import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type Delete struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDelete type alias for index. @@ -75,13 +78,18 @@ func NewDeleteFunc(tp elastictransport.Interface) NewDelete { // Deletes a search application. // -// https://www.elastic.co/guide/en/elasticsearch/reference/current/put-search-application.html +// https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-search-application.html func New(tp elastictransport.Interface) *Delete { r := &Delete{ transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *Delete) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("search_application") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodDelete @@ -119,9 +130,9 @@ func (r *Delete) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -138,27 +149,66 @@ func (r *Delete) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Delete) Perform(ctx context.Context) (*http.Response, error) { +func (r Delete) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "search_application.delete") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "search_application.delete") + if reader := instrument.RecordRequestBody(ctx, "search_application.delete", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "search_application.delete") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Delete query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Delete query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a delete.Response -func (r Delete) Do(ctx context.Context) (*Response, error) { +func (r Delete) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "search_application.delete") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -166,6 +216,9 @@ func (r Delete) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,6 +228,9 @@ func (r Delete) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,12 +238,25 @@ func (r Delete) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Delete) IsSuccess(ctx context.Context) (bool, error) { +func (r Delete) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "search_application.delete") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -203,6 +272,14 @@ func (r Delete) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Delete query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/delete/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/delete/response.go index 0961ed4cc..b548e048f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/delete/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/delete/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package delete // Response holds the response body struct for the package delete // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/search_application/delete/SearchApplicationsDeleteResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/search_application/delete/SearchApplicationsDeleteResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/deletebehavioralanalytics/delete_behavioral_analytics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/deletebehavioralanalytics/delete_behavioral_analytics.go index c06fbf1d3..58aba7628 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/deletebehavioralanalytics/delete_behavioral_analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/deletebehavioralanalytics/delete_behavioral_analytics.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Delete a behavioral analytics collection. package deletebehavioralanalytics import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type DeleteBehavioralAnalytics struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteBehavioralAnalytics type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *DeleteBehavioralAnalytics { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *DeleteBehavioralAnalytics) HttpRequest(ctx context.Context) (*http.Requ path.WriteString("analytics") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodDelete @@ -119,9 +130,9 @@ func (r *DeleteBehavioralAnalytics) HttpRequest(ctx context.Context) (*http.Requ } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -138,27 +149,66 @@ func (r *DeleteBehavioralAnalytics) HttpRequest(ctx context.Context) (*http.Requ } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteBehavioralAnalytics) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteBehavioralAnalytics) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "search_application.delete_behavioral_analytics") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "search_application.delete_behavioral_analytics") + if reader := instrument.RecordRequestBody(ctx, "search_application.delete_behavioral_analytics", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "search_application.delete_behavioral_analytics") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteBehavioralAnalytics query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteBehavioralAnalytics query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deletebehavioralanalytics.Response -func (r DeleteBehavioralAnalytics) Do(ctx context.Context) (*Response, error) { +func (r DeleteBehavioralAnalytics) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "search_application.delete_behavioral_analytics") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -166,6 +216,9 @@ func (r DeleteBehavioralAnalytics) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,6 +228,9 @@ func (r DeleteBehavioralAnalytics) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,12 +238,25 @@ func (r DeleteBehavioralAnalytics) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteBehavioralAnalytics) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteBehavioralAnalytics) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "search_application.delete_behavioral_analytics") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -203,6 +272,14 @@ func (r DeleteBehavioralAnalytics) IsSuccess(ctx context.Context) (bool, error) return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteBehavioralAnalytics query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/deletebehavioralanalytics/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/deletebehavioralanalytics/response.go index 61410d3b4..50fc17a45 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/deletebehavioralanalytics/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/deletebehavioralanalytics/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deletebehavioralanalytics // Response holds the response body struct for the package deletebehavioralanalytics // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/search_application/delete_behavioral_analytics/BehavioralAnalyticsDeleteResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/search_application/delete_behavioral_analytics/BehavioralAnalyticsDeleteResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/get/get.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/get/get.go index db430ed41..bd31f6548 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/get/get.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/get/get.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns the details about a search application. package get import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type Get struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGet type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *Get { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *Get) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("search_application") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodGet @@ -119,9 +130,9 @@ func (r *Get) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -138,27 +149,66 @@ func (r *Get) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Get) Perform(ctx context.Context) (*http.Response, error) { +func (r Get) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "search_application.get") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "search_application.get") + if reader := instrument.RecordRequestBody(ctx, "search_application.get", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "search_application.get") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Get query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Get query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a get.Response -func (r Get) Do(ctx context.Context) (*Response, error) { +func (r Get) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "search_application.get") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -166,6 +216,9 @@ func (r Get) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,6 +228,9 @@ func (r Get) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,12 +238,25 @@ func (r Get) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Get) IsSuccess(ctx context.Context) (bool, error) { +func (r Get) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "search_application.get") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -203,6 +272,14 @@ func (r Get) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Get query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/get/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/get/response.go index b7d6f05aa..d19670f36 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/get/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/get/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package get @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package get // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/search_application/get/SearchApplicationsGetResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/search_application/get/SearchApplicationsGetResponse.ts#L22-L24 type Response struct { // AnalyticsCollectionName Analytics collection associated to the Search Application. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/getbehavioralanalytics/get_behavioral_analytics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/getbehavioralanalytics/get_behavioral_analytics.go index 2f053cdb2..d7b90bd19 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/getbehavioralanalytics/get_behavioral_analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/getbehavioralanalytics/get_behavioral_analytics.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns the existing behavioral analytics collections. package getbehavioralanalytics import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type GetBehavioralAnalytics struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetBehavioralAnalytics type alias for index. @@ -79,7 +82,12 @@ func New(tp elastictransport.Interface) *GetBehavioralAnalytics { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -111,6 +119,9 @@ func (r *GetBehavioralAnalytics) HttpRequest(ctx context.Context) (*http.Request path.WriteString("analytics") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodGet @@ -124,9 +135,9 @@ func (r *GetBehavioralAnalytics) HttpRequest(ctx context.Context) (*http.Request } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -143,27 +154,66 @@ func (r *GetBehavioralAnalytics) HttpRequest(ctx context.Context) (*http.Request } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetBehavioralAnalytics) Perform(ctx context.Context) (*http.Response, error) { +func (r GetBehavioralAnalytics) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "search_application.get_behavioral_analytics") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "search_application.get_behavioral_analytics") + if reader := instrument.RecordRequestBody(ctx, "search_application.get_behavioral_analytics", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "search_application.get_behavioral_analytics") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetBehavioralAnalytics query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetBehavioralAnalytics query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getbehavioralanalytics.Response -func (r GetBehavioralAnalytics) Do(ctx context.Context) (Response, error) { +func (r GetBehavioralAnalytics) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "search_application.get_behavioral_analytics") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -171,6 +221,9 @@ func (r GetBehavioralAnalytics) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -180,6 +233,9 @@ func (r GetBehavioralAnalytics) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -187,12 +243,25 @@ func (r GetBehavioralAnalytics) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetBehavioralAnalytics) IsSuccess(ctx context.Context) (bool, error) { +func (r GetBehavioralAnalytics) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "search_application.get_behavioral_analytics") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -208,6 +277,14 @@ func (r GetBehavioralAnalytics) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetBehavioralAnalytics query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/getbehavioralanalytics/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/getbehavioralanalytics/response.go index fd9548a27..907071325 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/getbehavioralanalytics/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/getbehavioralanalytics/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getbehavioralanalytics @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getbehavioralanalytics // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/search_application/get_behavioral_analytics/BehavioralAnalyticsGetResponse.ts#L24-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/search_application/get_behavioral_analytics/BehavioralAnalyticsGetResponse.ts#L24-L26 type Response map[string]types.AnalyticsCollection diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/list/list.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/list/list.go index 696f0961b..d6d4ef0c4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/list/list.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/list/list.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns the existing search applications. package list import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -48,9 +47,13 @@ type List struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewList type alias for index. @@ -74,7 +77,12 @@ func New(tp elastictransport.Interface) *List { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -109,9 +117,9 @@ func (r *List) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -128,27 +136,66 @@ func (r *List) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r List) Perform(ctx context.Context) (*http.Response, error) { +func (r List) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "search_application.list") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "search_application.list") + if reader := instrument.RecordRequestBody(ctx, "search_application.list", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "search_application.list") + } if err != nil { - return nil, fmt.Errorf("an error happened during the List query execution: %w", err) + localErr := fmt.Errorf("an error happened during the List query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a list.Response -func (r List) Do(ctx context.Context) (*Response, error) { +func (r List) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "search_application.list") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -156,6 +203,9 @@ func (r List) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -165,6 +215,9 @@ func (r List) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -172,12 +225,25 @@ func (r List) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r List) IsSuccess(ctx context.Context) (bool, error) { +func (r List) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "search_application.list") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -193,6 +259,14 @@ func (r List) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the List query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/list/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/list/response.go index b2b168eaa..4d9234766 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/list/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/list/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package list @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package list // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/search_application/list/SearchApplicationsListResponse.ts#L24-L29 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/search_application/list/SearchApplicationsListResponse.ts#L24-L29 type Response struct { Count int64 `json:"count"` Results []types.SearchApplicationListItem `json:"results"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/put/put.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/put/put.go index e0d8e9fc1..15a2ee962 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/put/put.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/put/put.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates or updates a search application. package put @@ -51,15 +51,19 @@ type Put struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPut type alias for index. @@ -85,7 +89,14 @@ func New(tp elastictransport.Interface) *Put { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -124,9 +135,7 @@ func (r *Put) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -138,6 +147,10 @@ func (r *Put) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -148,6 +161,9 @@ func (r *Put) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("search_application") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodPut @@ -161,15 +177,15 @@ func (r *Put) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -186,27 +202,66 @@ func (r *Put) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Put) Perform(ctx context.Context) (*http.Response, error) { +func (r Put) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "search_application.put") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "search_application.put") + if reader := instrument.RecordRequestBody(ctx, "search_application.put", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "search_application.put") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Put query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Put query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a put.Response -func (r Put) Do(ctx context.Context) (*Response, error) { +func (r Put) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "search_application.put") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -214,6 +269,9 @@ func (r Put) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -223,6 +281,9 @@ func (r Put) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -230,6 +291,9 @@ func (r Put) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/put/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/put/request.go index acc925fb1..f2573f15a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/put/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/put/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package put @@ -26,5 +26,5 @@ import ( // Request holds the request body struct for the package put // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/search_application/put/SearchApplicationsPutRequest.ts#L23-L48 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/search_application/put/SearchApplicationsPutRequest.ts#L23-L48 type Request = types.SearchApplication diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/put/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/put/response.go index 4a927cd88..4a856f07c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/put/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/put/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package put @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package put // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/search_application/put/SearchApplicationsPutResponse.ts#L22-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/search_application/put/SearchApplicationsPutResponse.ts#L22-L26 type Response struct { Result result.Result `json:"result"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/putbehavioralanalytics/put_behavioral_analytics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/putbehavioralanalytics/put_behavioral_analytics.go index 0008c9c8e..5f45591e3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/putbehavioralanalytics/put_behavioral_analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/putbehavioralanalytics/put_behavioral_analytics.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates a behavioral analytics collection. package putbehavioralanalytics import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type PutBehavioralAnalytics struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutBehavioralAnalytics type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *PutBehavioralAnalytics { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *PutBehavioralAnalytics) HttpRequest(ctx context.Context) (*http.Request path.WriteString("analytics") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodPut @@ -119,9 +130,9 @@ func (r *PutBehavioralAnalytics) HttpRequest(ctx context.Context) (*http.Request } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -138,27 +149,66 @@ func (r *PutBehavioralAnalytics) HttpRequest(ctx context.Context) (*http.Request } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutBehavioralAnalytics) Perform(ctx context.Context) (*http.Response, error) { +func (r PutBehavioralAnalytics) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "search_application.put_behavioral_analytics") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "search_application.put_behavioral_analytics") + if reader := instrument.RecordRequestBody(ctx, "search_application.put_behavioral_analytics", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "search_application.put_behavioral_analytics") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutBehavioralAnalytics query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutBehavioralAnalytics query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a putbehavioralanalytics.Response -func (r PutBehavioralAnalytics) Do(ctx context.Context) (*Response, error) { +func (r PutBehavioralAnalytics) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "search_application.put_behavioral_analytics") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -166,6 +216,9 @@ func (r PutBehavioralAnalytics) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,6 +228,9 @@ func (r PutBehavioralAnalytics) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,12 +238,25 @@ func (r PutBehavioralAnalytics) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r PutBehavioralAnalytics) IsSuccess(ctx context.Context) (bool, error) { +func (r PutBehavioralAnalytics) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "search_application.put_behavioral_analytics") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -203,6 +272,14 @@ func (r PutBehavioralAnalytics) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the PutBehavioralAnalytics query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/putbehavioralanalytics/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/putbehavioralanalytics/response.go index 8a6982e81..dcb6e7d2b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/putbehavioralanalytics/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/putbehavioralanalytics/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putbehavioralanalytics // Response holds the response body struct for the package putbehavioralanalytics // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/search_application/put_behavioral_analytics/BehavioralAnalyticsPutResponse.ts#L24-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/search_application/put_behavioral_analytics/BehavioralAnalyticsPutResponse.ts#L24-L26 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/search/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/search/request.go index f32fcd320..e1aab9b76 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/search/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/search/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package search @@ -27,7 +27,7 @@ import ( // Request holds the request body struct for the package search // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/search_application/search/SearchApplicationsSearchRequest.ts#L24-L43 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/search_application/search/SearchApplicationsSearchRequest.ts#L24-L43 type Request struct { // Params Query parameters specific to this request, which will override any defaults diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/search/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/search/response.go index 42fd95bf3..0eb91165c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/search/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/search/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package search @@ -33,7 +33,7 @@ import ( // Response holds the response body struct for the package search // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/search_application/search/SearchApplicationsSearchResponse.ts#L23-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/search_application/search/SearchApplicationsSearchResponse.ts#L23-L25 type Response struct { Aggregations map[string]types.Aggregate `json:"aggregations,omitempty"` Clusters_ *types.ClusterStatistics `json:"_clusters,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/search/search.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/search/search.go index e7a8f4839..a2b733bc0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/search/search.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/searchapplication/search/search.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Perform a search against a search application package search @@ -50,15 +50,19 @@ type Search struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewSearch type alias for index. @@ -84,11 +88,18 @@ func New(tp elastictransport.Interface) *Search { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -125,9 +136,7 @@ func (r *Search) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -139,6 +148,10 @@ func (r *Search) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -149,6 +162,9 @@ func (r *Search) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("search_application") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) path.WriteString("/") path.WriteString("_search") @@ -164,15 +180,15 @@ func (r *Search) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -189,27 +205,66 @@ func (r *Search) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Search) Perform(ctx context.Context) (*http.Response, error) { +func (r Search) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "search_application.search") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "search_application.search") + if reader := instrument.RecordRequestBody(ctx, "search_application.search", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "search_application.search") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Search query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Search query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a search.Response -func (r Search) Do(ctx context.Context) (*Response, error) { +func (r Search) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "search_application.search") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -217,6 +272,9 @@ func (r Search) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -226,6 +284,9 @@ func (r Search) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -233,6 +294,9 @@ func (r Search) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/activateuserprofile/activate_user_profile.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/activateuserprofile/activate_user_profile.go index 1ca59e9e0..c36d90678 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/activateuserprofile/activate_user_profile.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/activateuserprofile/activate_user_profile.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates or updates the user profile on behalf of another user. package activateuserprofile @@ -47,13 +47,17 @@ type ActivateUserProfile struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewActivateUserProfile type alias for index. @@ -77,11 +81,18 @@ func New(tp elastictransport.Interface) *ActivateUserProfile { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -118,9 +129,7 @@ func (r *ActivateUserProfile) HttpRequest(ctx context.Context) (*http.Request, e } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -132,6 +141,10 @@ func (r *ActivateUserProfile) HttpRequest(ctx context.Context) (*http.Request, e } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -154,15 +167,15 @@ func (r *ActivateUserProfile) HttpRequest(ctx context.Context) (*http.Request, e } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -179,27 +192,66 @@ func (r *ActivateUserProfile) HttpRequest(ctx context.Context) (*http.Request, e } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ActivateUserProfile) Perform(ctx context.Context) (*http.Response, error) { +func (r ActivateUserProfile) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.activate_user_profile") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.activate_user_profile") + if reader := instrument.RecordRequestBody(ctx, "security.activate_user_profile", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.activate_user_profile") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ActivateUserProfile query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ActivateUserProfile query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a activateuserprofile.Response -func (r ActivateUserProfile) Do(ctx context.Context) (*Response, error) { +func (r ActivateUserProfile) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.activate_user_profile") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -207,6 +259,9 @@ func (r ActivateUserProfile) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -216,6 +271,9 @@ func (r ActivateUserProfile) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -223,6 +281,9 @@ func (r ActivateUserProfile) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/activateuserprofile/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/activateuserprofile/request.go index 323796351..b474c77bd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/activateuserprofile/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/activateuserprofile/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package activateuserprofile @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package activateuserprofile // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/activate_user_profile/Request.ts#L23-L37 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/activate_user_profile/Request.ts#L23-L37 type Request struct { AccessToken *string `json:"access_token,omitempty"` GrantType granttype.GrantType `json:"grant_type"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/activateuserprofile/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/activateuserprofile/response.go index d32f4f8d2..47c24a01d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/activateuserprofile/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/activateuserprofile/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package activateuserprofile @@ -28,7 +28,7 @@ import ( // Response holds the response body struct for the package activateuserprofile // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/activate_user_profile/Response.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/activate_user_profile/Response.ts#L22-L24 type Response struct { Data map[string]json.RawMessage `json:"data"` Doc_ types.UserProfileHitMetadata `json:"_doc"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/authenticate/authenticate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/authenticate/authenticate.go index 34a57e584..366d6495d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/authenticate/authenticate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/authenticate/authenticate.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Enables authentication as a user and retrieve information about the // authenticated user. package authenticate import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -48,9 +47,13 @@ type Authenticate struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewAuthenticate type alias for index. @@ -75,7 +78,12 @@ func New(tp elastictransport.Interface) *Authenticate { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -110,9 +118,9 @@ func (r *Authenticate) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -129,27 +137,66 @@ func (r *Authenticate) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Authenticate) Perform(ctx context.Context) (*http.Response, error) { +func (r Authenticate) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.authenticate") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.authenticate") + if reader := instrument.RecordRequestBody(ctx, "security.authenticate", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.authenticate") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Authenticate query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Authenticate query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a authenticate.Response -func (r Authenticate) Do(ctx context.Context) (*Response, error) { +func (r Authenticate) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.authenticate") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -157,6 +204,9 @@ func (r Authenticate) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -166,6 +216,9 @@ func (r Authenticate) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -173,12 +226,25 @@ func (r Authenticate) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Authenticate) IsSuccess(ctx context.Context) (bool, error) { +func (r Authenticate) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.authenticate") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -194,6 +260,14 @@ func (r Authenticate) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Authenticate query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/authenticate/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/authenticate/response.go index ff5f6688b..8f3134fea 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/authenticate/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/authenticate/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package authenticate @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package authenticate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/authenticate/SecurityAuthenticateResponse.ts#L25-L43 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/authenticate/SecurityAuthenticateResponse.ts#L25-L43 type Response struct { ApiKey *types.ApiKey `json:"api_key,omitempty"` AuthenticationRealm types.RealmInfo `json:"authentication_realm"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/bulkupdateapikeys/bulk_update_api_keys.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/bulkupdateapikeys/bulk_update_api_keys.go index afffef321..7fd068308 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/bulkupdateapikeys/bulk_update_api_keys.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/bulkupdateapikeys/bulk_update_api_keys.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Updates the attributes of multiple existing API keys. package bulkupdateapikeys import ( - gobytes "bytes" "context" "errors" "fmt" @@ -45,9 +44,13 @@ type BulkUpdateApiKeys struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewBulkUpdateApiKeys type alias for index. @@ -71,7 +74,12 @@ func New(tp elastictransport.Interface) *BulkUpdateApiKeys { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,15 +116,15 @@ func (r *BulkUpdateApiKeys) HttpRequest(ctx context.Context) (*http.Request, err } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -133,15 +141,42 @@ func (r *BulkUpdateApiKeys) HttpRequest(ctx context.Context) (*http.Request, err } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r BulkUpdateApiKeys) Perform(ctx context.Context) (*http.Response, error) { +func (r BulkUpdateApiKeys) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.bulk_update_api_keys") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.bulk_update_api_keys") + if reader := instrument.RecordRequestBody(ctx, "security.bulk_update_api_keys", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.bulk_update_api_keys") + } if err != nil { - return nil, fmt.Errorf("an error happened during the BulkUpdateApiKeys query execution: %w", err) + localErr := fmt.Errorf("an error happened during the BulkUpdateApiKeys query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil @@ -154,7 +189,17 @@ func (r BulkUpdateApiKeys) Do(ctx context.Context) (bool, error) { // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r BulkUpdateApiKeys) IsSuccess(ctx context.Context) (bool, error) { +func (r BulkUpdateApiKeys) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.bulk_update_api_keys") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -170,6 +215,14 @@ func (r BulkUpdateApiKeys) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the BulkUpdateApiKeys query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/changepassword/change_password.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/changepassword/change_password.go index 88e9c3a2b..0e55dbaed 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/changepassword/change_password.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/changepassword/change_password.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Changes the passwords of users in the native realm and built-in users. package changepassword @@ -51,15 +51,19 @@ type ChangePassword struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int username string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewChangePassword type alias for index. @@ -83,11 +87,18 @@ func New(tp elastictransport.Interface) *ChangePassword { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -124,9 +135,7 @@ func (r *ChangePassword) HttpRequest(ctx context.Context) (*http.Request, error) } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -138,6 +147,10 @@ func (r *ChangePassword) HttpRequest(ctx context.Context) (*http.Request, error) } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -148,6 +161,9 @@ func (r *ChangePassword) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("user") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "username", r.username) + } path.WriteString(r.username) path.WriteString("/") path.WriteString("_password") @@ -172,15 +188,15 @@ func (r *ChangePassword) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -197,27 +213,66 @@ func (r *ChangePassword) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ChangePassword) Perform(ctx context.Context) (*http.Response, error) { +func (r ChangePassword) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.change_password") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.change_password") + if reader := instrument.RecordRequestBody(ctx, "security.change_password", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.change_password") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ChangePassword query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ChangePassword query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a changepassword.Response -func (r ChangePassword) Do(ctx context.Context) (*Response, error) { +func (r ChangePassword) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.change_password") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -225,6 +280,9 @@ func (r ChangePassword) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -234,6 +292,9 @@ func (r ChangePassword) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -241,6 +302,9 @@ func (r ChangePassword) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/changepassword/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/changepassword/request.go index 29e032108..17563d6fa 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/changepassword/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/changepassword/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package changepassword @@ -27,7 +27,7 @@ import ( // Request holds the request body struct for the package changepassword // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/change_password/SecurityChangePasswordRequest.ts#L23-L51 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/change_password/SecurityChangePasswordRequest.ts#L23-L51 type Request struct { // Password The new password value. Passwords must be at least 6 characters long. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/changepassword/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/changepassword/response.go index 0409a5ad0..f4a5cbb44 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/changepassword/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/changepassword/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package changepassword // Response holds the response body struct for the package changepassword // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/change_password/SecurityChangePasswordResponse.ts#L20-L22 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/change_password/SecurityChangePasswordResponse.ts#L20-L22 type Response struct { } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearapikeycache/clear_api_key_cache.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearapikeycache/clear_api_key_cache.go index 94c4475ed..219d1bad7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearapikeycache/clear_api_key_cache.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearapikeycache/clear_api_key_cache.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Clear a subset or all entries from the API key cache. package clearapikeycache import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type ClearApiKeyCache struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int ids string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewClearApiKeyCache type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *ClearApiKeyCache { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *ClearApiKeyCache) HttpRequest(ctx context.Context) (*http.Request, erro path.WriteString("api_key") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "ids", r.ids) + } path.WriteString(r.ids) path.WriteString("/") path.WriteString("_clear_cache") @@ -121,9 +132,9 @@ func (r *ClearApiKeyCache) HttpRequest(ctx context.Context) (*http.Request, erro } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -140,27 +151,66 @@ func (r *ClearApiKeyCache) HttpRequest(ctx context.Context) (*http.Request, erro } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ClearApiKeyCache) Perform(ctx context.Context) (*http.Response, error) { +func (r ClearApiKeyCache) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.clear_api_key_cache") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.clear_api_key_cache") + if reader := instrument.RecordRequestBody(ctx, "security.clear_api_key_cache", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.clear_api_key_cache") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ClearApiKeyCache query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ClearApiKeyCache query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a clearapikeycache.Response -func (r ClearApiKeyCache) Do(ctx context.Context) (*Response, error) { +func (r ClearApiKeyCache) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.clear_api_key_cache") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -168,6 +218,9 @@ func (r ClearApiKeyCache) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -177,6 +230,9 @@ func (r ClearApiKeyCache) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,12 +240,25 @@ func (r ClearApiKeyCache) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ClearApiKeyCache) IsSuccess(ctx context.Context) (bool, error) { +func (r ClearApiKeyCache) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.clear_api_key_cache") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -205,6 +274,14 @@ func (r ClearApiKeyCache) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ClearApiKeyCache query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearapikeycache/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearapikeycache/response.go index 4b861fd55..78dce14c8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearapikeycache/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearapikeycache/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package clearapikeycache @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package clearapikeycache // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/clear_api_key_cache/SecurityClearApiKeyCacheResponse.ts#L25-L32 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/clear_api_key_cache/SecurityClearApiKeyCacheResponse.ts#L25-L32 type Response struct { ClusterName string `json:"cluster_name"` NodeStats types.NodeStatistics `json:"_nodes"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearcachedprivileges/clear_cached_privileges.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearcachedprivileges/clear_cached_privileges.go index 5d1124593..c944aca0a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearcachedprivileges/clear_cached_privileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearcachedprivileges/clear_cached_privileges.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Evicts application privileges from the native application privileges cache. package clearcachedprivileges import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type ClearCachedPrivileges struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int application string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewClearCachedPrivileges type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *ClearCachedPrivileges { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *ClearCachedPrivileges) HttpRequest(ctx context.Context) (*http.Request, path.WriteString("privilege") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "application", r.application) + } path.WriteString(r.application) path.WriteString("/") path.WriteString("_clear_cache") @@ -121,9 +132,9 @@ func (r *ClearCachedPrivileges) HttpRequest(ctx context.Context) (*http.Request, } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -140,27 +151,66 @@ func (r *ClearCachedPrivileges) HttpRequest(ctx context.Context) (*http.Request, } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ClearCachedPrivileges) Perform(ctx context.Context) (*http.Response, error) { +func (r ClearCachedPrivileges) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.clear_cached_privileges") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.clear_cached_privileges") + if reader := instrument.RecordRequestBody(ctx, "security.clear_cached_privileges", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.clear_cached_privileges") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ClearCachedPrivileges query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ClearCachedPrivileges query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a clearcachedprivileges.Response -func (r ClearCachedPrivileges) Do(ctx context.Context) (*Response, error) { +func (r ClearCachedPrivileges) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.clear_cached_privileges") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -168,6 +218,9 @@ func (r ClearCachedPrivileges) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -177,6 +230,9 @@ func (r ClearCachedPrivileges) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,12 +240,25 @@ func (r ClearCachedPrivileges) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ClearCachedPrivileges) IsSuccess(ctx context.Context) (bool, error) { +func (r ClearCachedPrivileges) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.clear_cached_privileges") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -205,6 +274,14 @@ func (r ClearCachedPrivileges) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ClearCachedPrivileges query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearcachedprivileges/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearcachedprivileges/response.go index 654e432c3..89c485dfd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearcachedprivileges/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearcachedprivileges/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package clearcachedprivileges @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package clearcachedprivileges // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/clear_cached_privileges/SecurityClearCachedPrivilegesResponse.ts#L25-L32 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/clear_cached_privileges/SecurityClearCachedPrivilegesResponse.ts#L25-L32 type Response struct { ClusterName string `json:"cluster_name"` NodeStats types.NodeStatistics `json:"_nodes"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearcachedrealms/clear_cached_realms.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearcachedrealms/clear_cached_realms.go index a8470d567..7adbdd4a6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearcachedrealms/clear_cached_realms.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearcachedrealms/clear_cached_realms.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Evicts users from the user cache. Can completely clear the cache or evict // specific users. package clearcachedrealms import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type ClearCachedRealms struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int realms string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewClearCachedRealms type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *ClearCachedRealms { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,6 +116,9 @@ func (r *ClearCachedRealms) HttpRequest(ctx context.Context) (*http.Request, err path.WriteString("realm") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "realms", r.realms) + } path.WriteString(r.realms) path.WriteString("/") path.WriteString("_clear_cache") @@ -123,9 +134,9 @@ func (r *ClearCachedRealms) HttpRequest(ctx context.Context) (*http.Request, err } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -142,27 +153,66 @@ func (r *ClearCachedRealms) HttpRequest(ctx context.Context) (*http.Request, err } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ClearCachedRealms) Perform(ctx context.Context) (*http.Response, error) { +func (r ClearCachedRealms) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.clear_cached_realms") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.clear_cached_realms") + if reader := instrument.RecordRequestBody(ctx, "security.clear_cached_realms", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.clear_cached_realms") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ClearCachedRealms query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ClearCachedRealms query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a clearcachedrealms.Response -func (r ClearCachedRealms) Do(ctx context.Context) (*Response, error) { +func (r ClearCachedRealms) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.clear_cached_realms") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -170,6 +220,9 @@ func (r ClearCachedRealms) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -179,6 +232,9 @@ func (r ClearCachedRealms) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -186,12 +242,25 @@ func (r ClearCachedRealms) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ClearCachedRealms) IsSuccess(ctx context.Context) (bool, error) { +func (r ClearCachedRealms) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.clear_cached_realms") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -207,6 +276,14 @@ func (r ClearCachedRealms) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ClearCachedRealms query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearcachedrealms/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearcachedrealms/response.go index 513f91b46..2737c2dee 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearcachedrealms/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearcachedrealms/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package clearcachedrealms @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package clearcachedrealms // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/clear_cached_realms/SecurityClearCachedRealmsResponse.ts#L25-L32 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/clear_cached_realms/SecurityClearCachedRealmsResponse.ts#L25-L32 type Response struct { ClusterName string `json:"cluster_name"` NodeStats types.NodeStatistics `json:"_nodes"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearcachedroles/clear_cached_roles.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearcachedroles/clear_cached_roles.go index b5bd5b298..eb4d5ceae 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearcachedroles/clear_cached_roles.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearcachedroles/clear_cached_roles.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Evicts roles from the native role cache. package clearcachedroles import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type ClearCachedRoles struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewClearCachedRoles type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *ClearCachedRoles { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *ClearCachedRoles) HttpRequest(ctx context.Context) (*http.Request, erro path.WriteString("role") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) path.WriteString("/") path.WriteString("_clear_cache") @@ -121,9 +132,9 @@ func (r *ClearCachedRoles) HttpRequest(ctx context.Context) (*http.Request, erro } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -140,27 +151,66 @@ func (r *ClearCachedRoles) HttpRequest(ctx context.Context) (*http.Request, erro } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ClearCachedRoles) Perform(ctx context.Context) (*http.Response, error) { +func (r ClearCachedRoles) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.clear_cached_roles") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.clear_cached_roles") + if reader := instrument.RecordRequestBody(ctx, "security.clear_cached_roles", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.clear_cached_roles") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ClearCachedRoles query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ClearCachedRoles query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a clearcachedroles.Response -func (r ClearCachedRoles) Do(ctx context.Context) (*Response, error) { +func (r ClearCachedRoles) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.clear_cached_roles") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -168,6 +218,9 @@ func (r ClearCachedRoles) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -177,6 +230,9 @@ func (r ClearCachedRoles) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,12 +240,25 @@ func (r ClearCachedRoles) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ClearCachedRoles) IsSuccess(ctx context.Context) (bool, error) { +func (r ClearCachedRoles) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.clear_cached_roles") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -205,6 +274,14 @@ func (r ClearCachedRoles) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ClearCachedRoles query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearcachedroles/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearcachedroles/response.go index 5bffd4588..7b531bdcf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearcachedroles/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearcachedroles/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package clearcachedroles @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package clearcachedroles // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/clear_cached_roles/ClearCachedRolesResponse.ts#L25-L32 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/clear_cached_roles/ClearCachedRolesResponse.ts#L25-L32 type Response struct { ClusterName string `json:"cluster_name"` NodeStats types.NodeStatistics `json:"_nodes"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearcachedservicetokens/clear_cached_service_tokens.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearcachedservicetokens/clear_cached_service_tokens.go index 6a96492f4..c4d64cae2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearcachedservicetokens/clear_cached_service_tokens.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearcachedservicetokens/clear_cached_service_tokens.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Evicts tokens from the service account token caches. package clearcachedservicetokens import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -55,13 +54,17 @@ type ClearCachedServiceTokens struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int namespace string service string name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewClearCachedServiceTokens type alias for index. @@ -91,7 +94,12 @@ func New(tp elastictransport.Interface) *ClearCachedServiceTokens { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -116,9 +124,15 @@ func (r *ClearCachedServiceTokens) HttpRequest(ctx context.Context) (*http.Reque path.WriteString("service") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "namespace", r.namespace) + } path.WriteString(r.namespace) path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "service", r.service) + } path.WriteString(r.service) path.WriteString("/") path.WriteString("credential") @@ -126,6 +140,9 @@ func (r *ClearCachedServiceTokens) HttpRequest(ctx context.Context) (*http.Reque path.WriteString("token") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) path.WriteString("/") path.WriteString("_clear_cache") @@ -141,9 +158,9 @@ func (r *ClearCachedServiceTokens) HttpRequest(ctx context.Context) (*http.Reque } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -160,27 +177,66 @@ func (r *ClearCachedServiceTokens) HttpRequest(ctx context.Context) (*http.Reque } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ClearCachedServiceTokens) Perform(ctx context.Context) (*http.Response, error) { +func (r ClearCachedServiceTokens) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.clear_cached_service_tokens") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.clear_cached_service_tokens") + if reader := instrument.RecordRequestBody(ctx, "security.clear_cached_service_tokens", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.clear_cached_service_tokens") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ClearCachedServiceTokens query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ClearCachedServiceTokens query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a clearcachedservicetokens.Response -func (r ClearCachedServiceTokens) Do(ctx context.Context) (*Response, error) { +func (r ClearCachedServiceTokens) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.clear_cached_service_tokens") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -188,6 +244,9 @@ func (r ClearCachedServiceTokens) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -197,6 +256,9 @@ func (r ClearCachedServiceTokens) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -204,12 +266,25 @@ func (r ClearCachedServiceTokens) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ClearCachedServiceTokens) IsSuccess(ctx context.Context) (bool, error) { +func (r ClearCachedServiceTokens) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.clear_cached_service_tokens") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -225,6 +300,14 @@ func (r ClearCachedServiceTokens) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ClearCachedServiceTokens query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearcachedservicetokens/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearcachedservicetokens/response.go index f13b6ce25..2433f00a2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearcachedservicetokens/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/clearcachedservicetokens/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package clearcachedservicetokens @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package clearcachedservicetokens // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/clear_cached_service_tokens/ClearCachedServiceTokensResponse.ts#L25-L32 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/clear_cached_service_tokens/ClearCachedServiceTokensResponse.ts#L25-L32 type Response struct { ClusterName string `json:"cluster_name"` NodeStats types.NodeStatistics `json:"_nodes"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/createapikey/create_api_key.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/createapikey/create_api_key.go index 35c232ca3..77022f6a8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/createapikey/create_api_key.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/createapikey/create_api_key.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates an API key for access without requiring basic authentication. package createapikey @@ -47,13 +47,17 @@ type CreateApiKey struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewCreateApiKey type alias for index. @@ -77,11 +81,18 @@ func New(tp elastictransport.Interface) *CreateApiKey { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -118,9 +129,7 @@ func (r *CreateApiKey) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -132,6 +141,10 @@ func (r *CreateApiKey) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -152,15 +165,15 @@ func (r *CreateApiKey) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -177,27 +190,66 @@ func (r *CreateApiKey) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r CreateApiKey) Perform(ctx context.Context) (*http.Response, error) { +func (r CreateApiKey) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.create_api_key") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.create_api_key") + if reader := instrument.RecordRequestBody(ctx, "security.create_api_key", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.create_api_key") + } if err != nil { - return nil, fmt.Errorf("an error happened during the CreateApiKey query execution: %w", err) + localErr := fmt.Errorf("an error happened during the CreateApiKey query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a createapikey.Response -func (r CreateApiKey) Do(ctx context.Context) (*Response, error) { +func (r CreateApiKey) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.create_api_key") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -205,6 +257,9 @@ func (r CreateApiKey) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -214,6 +269,9 @@ func (r CreateApiKey) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -221,6 +279,9 @@ func (r CreateApiKey) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/createapikey/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/createapikey/request.go index 1686d06ce..004d4f972 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/createapikey/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/createapikey/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package createapikey @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package createapikey // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/create_api_key/SecurityCreateApiKeyRequest.ts#L26-L58 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/create_api_key/SecurityCreateApiKeyRequest.ts#L26-L58 type Request struct { // Expiration Expiration time for the API key. By default, API keys never expire. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/createapikey/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/createapikey/response.go index a6529a204..4e4d7d783 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/createapikey/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/createapikey/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package createapikey // Response holds the response body struct for the package createapikey // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/create_api_key/SecurityCreateApiKeyResponse.ts#L23-L50 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/create_api_key/SecurityCreateApiKeyResponse.ts#L23-L50 type Response struct { // ApiKey Generated API key. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/createcrossclusterapikey/create_cross_cluster_api_key.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/createcrossclusterapikey/create_cross_cluster_api_key.go index 67a1f9c55..99fccd262 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/createcrossclusterapikey/create_cross_cluster_api_key.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/createcrossclusterapikey/create_cross_cluster_api_key.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates a cross-cluster API key for API key based remote cluster access. package createcrossclusterapikey import ( - gobytes "bytes" "context" "errors" "fmt" @@ -45,9 +44,13 @@ type CreateCrossClusterApiKey struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewCreateCrossClusterApiKey type alias for index. @@ -71,7 +74,12 @@ func New(tp elastictransport.Interface) *CreateCrossClusterApiKey { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,15 +116,15 @@ func (r *CreateCrossClusterApiKey) HttpRequest(ctx context.Context) (*http.Reque } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -133,15 +141,42 @@ func (r *CreateCrossClusterApiKey) HttpRequest(ctx context.Context) (*http.Reque } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r CreateCrossClusterApiKey) Perform(ctx context.Context) (*http.Response, error) { +func (r CreateCrossClusterApiKey) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.create_cross_cluster_api_key") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.create_cross_cluster_api_key") + if reader := instrument.RecordRequestBody(ctx, "security.create_cross_cluster_api_key", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.create_cross_cluster_api_key") + } if err != nil { - return nil, fmt.Errorf("an error happened during the CreateCrossClusterApiKey query execution: %w", err) + localErr := fmt.Errorf("an error happened during the CreateCrossClusterApiKey query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil @@ -154,7 +189,17 @@ func (r CreateCrossClusterApiKey) Do(ctx context.Context) (bool, error) { // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r CreateCrossClusterApiKey) IsSuccess(ctx context.Context) (bool, error) { +func (r CreateCrossClusterApiKey) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.create_cross_cluster_api_key") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -170,6 +215,14 @@ func (r CreateCrossClusterApiKey) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the CreateCrossClusterApiKey query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/createservicetoken/create_service_token.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/createservicetoken/create_service_token.go index 18cad7fd6..125c27a63 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/createservicetoken/create_service_token.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/createservicetoken/create_service_token.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates a service account token for access without requiring basic // authentication. package createservicetoken import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -57,13 +56,17 @@ type CreateServiceToken struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int namespace string service string name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewCreateServiceToken type alias for index. @@ -92,7 +95,12 @@ func New(tp elastictransport.Interface) *CreateServiceToken { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -117,9 +125,15 @@ func (r *CreateServiceToken) HttpRequest(ctx context.Context) (*http.Request, er path.WriteString("service") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "namespace", r.namespace) + } path.WriteString(r.namespace) path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "service", r.service) + } path.WriteString(r.service) path.WriteString("/") path.WriteString("credential") @@ -127,6 +141,9 @@ func (r *CreateServiceToken) HttpRequest(ctx context.Context) (*http.Request, er path.WriteString("token") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodPut @@ -137,9 +154,15 @@ func (r *CreateServiceToken) HttpRequest(ctx context.Context) (*http.Request, er path.WriteString("service") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "namespace", r.namespace) + } path.WriteString(r.namespace) path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "service", r.service) + } path.WriteString(r.service) path.WriteString("/") path.WriteString("credential") @@ -157,9 +180,9 @@ func (r *CreateServiceToken) HttpRequest(ctx context.Context) (*http.Request, er } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -176,27 +199,66 @@ func (r *CreateServiceToken) HttpRequest(ctx context.Context) (*http.Request, er } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r CreateServiceToken) Perform(ctx context.Context) (*http.Response, error) { +func (r CreateServiceToken) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.create_service_token") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.create_service_token") + if reader := instrument.RecordRequestBody(ctx, "security.create_service_token", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.create_service_token") + } if err != nil { - return nil, fmt.Errorf("an error happened during the CreateServiceToken query execution: %w", err) + localErr := fmt.Errorf("an error happened during the CreateServiceToken query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a createservicetoken.Response -func (r CreateServiceToken) Do(ctx context.Context) (*Response, error) { +func (r CreateServiceToken) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.create_service_token") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -204,6 +266,9 @@ func (r CreateServiceToken) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -213,6 +278,9 @@ func (r CreateServiceToken) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -220,12 +288,25 @@ func (r CreateServiceToken) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r CreateServiceToken) IsSuccess(ctx context.Context) (bool, error) { +func (r CreateServiceToken) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.create_service_token") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -241,6 +322,14 @@ func (r CreateServiceToken) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the CreateServiceToken query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/createservicetoken/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/createservicetoken/response.go index a68f89a3d..a1e40effb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/createservicetoken/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/createservicetoken/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package createservicetoken @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package createservicetoken // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/create_service_token/CreateServiceTokenResponse.ts#L22-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/create_service_token/CreateServiceTokenResponse.ts#L22-L27 type Response struct { Created bool `json:"created"` Token types.ServiceToken `json:"token"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleteprivileges/delete_privileges.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleteprivileges/delete_privileges.go index 5fb2246fb..7c02bf4f8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleteprivileges/delete_privileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleteprivileges/delete_privileges.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Removes application privileges. package deleteprivileges import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -54,12 +53,16 @@ type DeletePrivileges struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int application string name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeletePrivileges type alias for index. @@ -87,7 +90,12 @@ func New(tp elastictransport.Interface) *DeletePrivileges { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -112,9 +120,15 @@ func (r *DeletePrivileges) HttpRequest(ctx context.Context) (*http.Request, erro path.WriteString("privilege") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "application", r.application) + } path.WriteString(r.application) path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodDelete @@ -128,9 +142,9 @@ func (r *DeletePrivileges) HttpRequest(ctx context.Context) (*http.Request, erro } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -147,27 +161,66 @@ func (r *DeletePrivileges) HttpRequest(ctx context.Context) (*http.Request, erro } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeletePrivileges) Perform(ctx context.Context) (*http.Response, error) { +func (r DeletePrivileges) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.delete_privileges") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.delete_privileges") + if reader := instrument.RecordRequestBody(ctx, "security.delete_privileges", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.delete_privileges") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeletePrivileges query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeletePrivileges query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deleteprivileges.Response -func (r DeletePrivileges) Do(ctx context.Context) (Response, error) { +func (r DeletePrivileges) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.delete_privileges") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -175,6 +228,9 @@ func (r DeletePrivileges) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,6 +240,9 @@ func (r DeletePrivileges) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -191,12 +250,25 @@ func (r DeletePrivileges) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeletePrivileges) IsSuccess(ctx context.Context) (bool, error) { +func (r DeletePrivileges) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.delete_privileges") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -212,6 +284,14 @@ func (r DeletePrivileges) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeletePrivileges query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleteprivileges/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleteprivileges/response.go index 7f2da19c5..a783ceda2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleteprivileges/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleteprivileges/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deleteprivileges @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package deleteprivileges // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/delete_privileges/SecurityDeletePrivilegesResponse.ts#L23-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/delete_privileges/SecurityDeletePrivilegesResponse.ts#L23-L25 type Response map[string]map[string]types.FoundStatus diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleterole/delete_role.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleterole/delete_role.go index 0966f9fac..55a129e2b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleterole/delete_role.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleterole/delete_role.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Removes roles in the native realm. package deleterole import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type DeleteRole struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteRole type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *DeleteRole { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -107,6 +115,9 @@ func (r *DeleteRole) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("role") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodDelete @@ -120,9 +131,9 @@ func (r *DeleteRole) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -139,27 +150,66 @@ func (r *DeleteRole) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteRole) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteRole) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.delete_role") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.delete_role") + if reader := instrument.RecordRequestBody(ctx, "security.delete_role", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.delete_role") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteRole query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteRole query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deleterole.Response -func (r DeleteRole) Do(ctx context.Context) (*Response, error) { +func (r DeleteRole) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.delete_role") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -167,6 +217,9 @@ func (r DeleteRole) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -176,6 +229,9 @@ func (r DeleteRole) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -183,12 +239,25 @@ func (r DeleteRole) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteRole) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteRole) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.delete_role") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -204,6 +273,14 @@ func (r DeleteRole) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteRole query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleterole/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleterole/response.go index 8b3ccd594..978723edc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleterole/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleterole/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deleterole // Response holds the response body struct for the package deleterole // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/delete_role/SecurityDeleteRoleResponse.ts#L20-L22 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/delete_role/SecurityDeleteRoleResponse.ts#L20-L22 type Response struct { Found bool `json:"found"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleterolemapping/delete_role_mapping.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleterolemapping/delete_role_mapping.go index 99c7b3479..9be014b76 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleterolemapping/delete_role_mapping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleterolemapping/delete_role_mapping.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Removes role mappings. package deleterolemapping import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type DeleteRoleMapping struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteRoleMapping type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *DeleteRoleMapping { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -107,6 +115,9 @@ func (r *DeleteRoleMapping) HttpRequest(ctx context.Context) (*http.Request, err path.WriteString("role_mapping") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodDelete @@ -120,9 +131,9 @@ func (r *DeleteRoleMapping) HttpRequest(ctx context.Context) (*http.Request, err } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -139,27 +150,66 @@ func (r *DeleteRoleMapping) HttpRequest(ctx context.Context) (*http.Request, err } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteRoleMapping) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteRoleMapping) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.delete_role_mapping") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.delete_role_mapping") + if reader := instrument.RecordRequestBody(ctx, "security.delete_role_mapping", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.delete_role_mapping") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteRoleMapping query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteRoleMapping query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deleterolemapping.Response -func (r DeleteRoleMapping) Do(ctx context.Context) (*Response, error) { +func (r DeleteRoleMapping) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.delete_role_mapping") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -167,6 +217,9 @@ func (r DeleteRoleMapping) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -176,6 +229,9 @@ func (r DeleteRoleMapping) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -183,12 +239,25 @@ func (r DeleteRoleMapping) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteRoleMapping) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteRoleMapping) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.delete_role_mapping") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -204,6 +273,14 @@ func (r DeleteRoleMapping) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteRoleMapping query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleterolemapping/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleterolemapping/response.go index 4d0b091fd..bc221ed56 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleterolemapping/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleterolemapping/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deleterolemapping // Response holds the response body struct for the package deleterolemapping // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/delete_role_mapping/SecurityDeleteRoleMappingResponse.ts#L20-L22 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/delete_role_mapping/SecurityDeleteRoleMappingResponse.ts#L20-L22 type Response struct { Found bool `json:"found"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleteservicetoken/delete_service_token.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleteservicetoken/delete_service_token.go index e7ca62af3..240906b31 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleteservicetoken/delete_service_token.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleteservicetoken/delete_service_token.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes a service account token. package deleteservicetoken import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -56,13 +55,17 @@ type DeleteServiceToken struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int namespace string service string name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteServiceToken type alias for index. @@ -92,7 +95,12 @@ func New(tp elastictransport.Interface) *DeleteServiceToken { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -117,9 +125,15 @@ func (r *DeleteServiceToken) HttpRequest(ctx context.Context) (*http.Request, er path.WriteString("service") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "namespace", r.namespace) + } path.WriteString(r.namespace) path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "service", r.service) + } path.WriteString(r.service) path.WriteString("/") path.WriteString("credential") @@ -127,6 +141,9 @@ func (r *DeleteServiceToken) HttpRequest(ctx context.Context) (*http.Request, er path.WriteString("token") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodDelete @@ -140,9 +157,9 @@ func (r *DeleteServiceToken) HttpRequest(ctx context.Context) (*http.Request, er } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -159,27 +176,66 @@ func (r *DeleteServiceToken) HttpRequest(ctx context.Context) (*http.Request, er } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteServiceToken) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteServiceToken) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.delete_service_token") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.delete_service_token") + if reader := instrument.RecordRequestBody(ctx, "security.delete_service_token", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.delete_service_token") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteServiceToken query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteServiceToken query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deleteservicetoken.Response -func (r DeleteServiceToken) Do(ctx context.Context) (*Response, error) { +func (r DeleteServiceToken) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.delete_service_token") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -187,6 +243,9 @@ func (r DeleteServiceToken) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -196,6 +255,9 @@ func (r DeleteServiceToken) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -203,12 +265,25 @@ func (r DeleteServiceToken) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteServiceToken) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteServiceToken) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.delete_service_token") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -224,6 +299,14 @@ func (r DeleteServiceToken) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteServiceToken query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleteservicetoken/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleteservicetoken/response.go index 2b183a1a7..89c04e314 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleteservicetoken/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleteservicetoken/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deleteservicetoken // Response holds the response body struct for the package deleteservicetoken // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/delete_service_token/DeleteServiceTokenResponse.ts#L20-L22 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/delete_service_token/DeleteServiceTokenResponse.ts#L20-L22 type Response struct { Found bool `json:"found"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleteuser/delete_user.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleteuser/delete_user.go index 68cc84c17..5e20c6985 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleteuser/delete_user.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleteuser/delete_user.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes users from the native realm. package deleteuser import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type DeleteUser struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int username string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteUser type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *DeleteUser { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -107,6 +115,9 @@ func (r *DeleteUser) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("user") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "username", r.username) + } path.WriteString(r.username) method = http.MethodDelete @@ -120,9 +131,9 @@ func (r *DeleteUser) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -139,27 +150,66 @@ func (r *DeleteUser) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteUser) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteUser) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.delete_user") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.delete_user") + if reader := instrument.RecordRequestBody(ctx, "security.delete_user", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.delete_user") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteUser query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteUser query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deleteuser.Response -func (r DeleteUser) Do(ctx context.Context) (*Response, error) { +func (r DeleteUser) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.delete_user") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -167,6 +217,9 @@ func (r DeleteUser) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -176,6 +229,9 @@ func (r DeleteUser) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -183,12 +239,25 @@ func (r DeleteUser) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteUser) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteUser) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.delete_user") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -204,6 +273,14 @@ func (r DeleteUser) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteUser query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleteuser/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleteuser/response.go index 1decc2c8f..9594b348e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleteuser/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/deleteuser/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deleteuser // Response holds the response body struct for the package deleteuser // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/delete_user/SecurityDeleteUserResponse.ts#L20-L22 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/delete_user/SecurityDeleteUserResponse.ts#L20-L22 type Response struct { Found bool `json:"found"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/disableuser/disable_user.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/disableuser/disable_user.go index dc2131222..42f14ad23 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/disableuser/disable_user.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/disableuser/disable_user.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Disables users in the native realm. package disableuser import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type DisableUser struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int username string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDisableUser type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *DisableUser { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -107,6 +115,9 @@ func (r *DisableUser) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("user") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "username", r.username) + } path.WriteString(r.username) path.WriteString("/") path.WriteString("_disable") @@ -122,9 +133,9 @@ func (r *DisableUser) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -141,27 +152,66 @@ func (r *DisableUser) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DisableUser) Perform(ctx context.Context) (*http.Response, error) { +func (r DisableUser) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.disable_user") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.disable_user") + if reader := instrument.RecordRequestBody(ctx, "security.disable_user", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.disable_user") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DisableUser query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DisableUser query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a disableuser.Response -func (r DisableUser) Do(ctx context.Context) (*Response, error) { +func (r DisableUser) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.disable_user") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -169,6 +219,9 @@ func (r DisableUser) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -178,6 +231,9 @@ func (r DisableUser) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -185,12 +241,25 @@ func (r DisableUser) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DisableUser) IsSuccess(ctx context.Context) (bool, error) { +func (r DisableUser) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.disable_user") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -206,6 +275,14 @@ func (r DisableUser) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DisableUser query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/disableuser/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/disableuser/response.go index ebf22b38d..279508781 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/disableuser/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/disableuser/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package disableuser // Response holds the response body struct for the package disableuser // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/disable_user/SecurityDisableUserResponse.ts#L20-L22 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/disable_user/SecurityDisableUserResponse.ts#L20-L22 type Response struct { } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/disableuserprofile/disable_user_profile.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/disableuserprofile/disable_user_profile.go index ec6468f02..402451d45 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/disableuserprofile/disable_user_profile.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/disableuserprofile/disable_user_profile.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Disables a user profile so it's not visible in user profile searches. package disableuserprofile import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type DisableUserProfile struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int uid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDisableUserProfile type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *DisableUserProfile { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -107,6 +115,9 @@ func (r *DisableUserProfile) HttpRequest(ctx context.Context) (*http.Request, er path.WriteString("profile") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "uid", r.uid) + } path.WriteString(r.uid) path.WriteString("/") path.WriteString("_disable") @@ -122,9 +133,9 @@ func (r *DisableUserProfile) HttpRequest(ctx context.Context) (*http.Request, er } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -141,27 +152,66 @@ func (r *DisableUserProfile) HttpRequest(ctx context.Context) (*http.Request, er } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DisableUserProfile) Perform(ctx context.Context) (*http.Response, error) { +func (r DisableUserProfile) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.disable_user_profile") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.disable_user_profile") + if reader := instrument.RecordRequestBody(ctx, "security.disable_user_profile", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.disable_user_profile") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DisableUserProfile query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DisableUserProfile query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a disableuserprofile.Response -func (r DisableUserProfile) Do(ctx context.Context) (*Response, error) { +func (r DisableUserProfile) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.disable_user_profile") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -169,6 +219,9 @@ func (r DisableUserProfile) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -178,6 +231,9 @@ func (r DisableUserProfile) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -185,12 +241,25 @@ func (r DisableUserProfile) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DisableUserProfile) IsSuccess(ctx context.Context) (bool, error) { +func (r DisableUserProfile) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.disable_user_profile") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -206,6 +275,14 @@ func (r DisableUserProfile) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DisableUserProfile query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/disableuserprofile/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/disableuserprofile/response.go index 6aa9c5e23..89ecdf0c7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/disableuserprofile/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/disableuserprofile/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package disableuserprofile // Response holds the response body struct for the package disableuserprofile // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/disable_user_profile/Response.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/disable_user_profile/Response.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/enableuser/enable_user.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/enableuser/enable_user.go index 4e7cbc6b9..3c0aa9fa5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/enableuser/enable_user.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/enableuser/enable_user.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Enables users in the native realm. package enableuser import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type EnableUser struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int username string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewEnableUser type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *EnableUser { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -107,6 +115,9 @@ func (r *EnableUser) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("user") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "username", r.username) + } path.WriteString(r.username) path.WriteString("/") path.WriteString("_enable") @@ -122,9 +133,9 @@ func (r *EnableUser) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -141,27 +152,66 @@ func (r *EnableUser) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r EnableUser) Perform(ctx context.Context) (*http.Response, error) { +func (r EnableUser) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.enable_user") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.enable_user") + if reader := instrument.RecordRequestBody(ctx, "security.enable_user", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.enable_user") + } if err != nil { - return nil, fmt.Errorf("an error happened during the EnableUser query execution: %w", err) + localErr := fmt.Errorf("an error happened during the EnableUser query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a enableuser.Response -func (r EnableUser) Do(ctx context.Context) (*Response, error) { +func (r EnableUser) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.enable_user") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -169,6 +219,9 @@ func (r EnableUser) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -178,6 +231,9 @@ func (r EnableUser) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -185,12 +241,25 @@ func (r EnableUser) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r EnableUser) IsSuccess(ctx context.Context) (bool, error) { +func (r EnableUser) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.enable_user") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -206,6 +275,14 @@ func (r EnableUser) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the EnableUser query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/enableuser/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/enableuser/response.go index fa2fd97b3..ffecf4b2d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/enableuser/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/enableuser/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package enableuser // Response holds the response body struct for the package enableuser // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/enable_user/SecurityEnableUserResponse.ts#L20-L22 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/enable_user/SecurityEnableUserResponse.ts#L20-L22 type Response struct { } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/enableuserprofile/enable_user_profile.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/enableuserprofile/enable_user_profile.go index ec8858d82..c7df76e13 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/enableuserprofile/enable_user_profile.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/enableuserprofile/enable_user_profile.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Enables a user profile so it's visible in user profile searches. package enableuserprofile import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type EnableUserProfile struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int uid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewEnableUserProfile type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *EnableUserProfile { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -107,6 +115,9 @@ func (r *EnableUserProfile) HttpRequest(ctx context.Context) (*http.Request, err path.WriteString("profile") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "uid", r.uid) + } path.WriteString(r.uid) path.WriteString("/") path.WriteString("_enable") @@ -122,9 +133,9 @@ func (r *EnableUserProfile) HttpRequest(ctx context.Context) (*http.Request, err } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -141,27 +152,66 @@ func (r *EnableUserProfile) HttpRequest(ctx context.Context) (*http.Request, err } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r EnableUserProfile) Perform(ctx context.Context) (*http.Response, error) { +func (r EnableUserProfile) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.enable_user_profile") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.enable_user_profile") + if reader := instrument.RecordRequestBody(ctx, "security.enable_user_profile", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.enable_user_profile") + } if err != nil { - return nil, fmt.Errorf("an error happened during the EnableUserProfile query execution: %w", err) + localErr := fmt.Errorf("an error happened during the EnableUserProfile query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a enableuserprofile.Response -func (r EnableUserProfile) Do(ctx context.Context) (*Response, error) { +func (r EnableUserProfile) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.enable_user_profile") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -169,6 +219,9 @@ func (r EnableUserProfile) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -178,6 +231,9 @@ func (r EnableUserProfile) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -185,12 +241,25 @@ func (r EnableUserProfile) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r EnableUserProfile) IsSuccess(ctx context.Context) (bool, error) { +func (r EnableUserProfile) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.enable_user_profile") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -206,6 +275,14 @@ func (r EnableUserProfile) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the EnableUserProfile query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/enableuserprofile/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/enableuserprofile/response.go index 06b31cad2..57a22deb8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/enableuserprofile/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/enableuserprofile/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package enableuserprofile // Response holds the response body struct for the package enableuserprofile // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/enable_user_profile/Response.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/enable_user_profile/Response.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/enrollkibana/enroll_kibana.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/enrollkibana/enroll_kibana.go index bd4019db5..f67f67621 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/enrollkibana/enroll_kibana.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/enrollkibana/enroll_kibana.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Allows a kibana instance to configure itself to communicate with a secured // elasticsearch cluster. package enrollkibana import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -48,9 +47,13 @@ type EnrollKibana struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewEnrollKibana type alias for index. @@ -75,7 +78,12 @@ func New(tp elastictransport.Interface) *EnrollKibana { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -112,15 +120,15 @@ func (r *EnrollKibana) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -137,27 +145,66 @@ func (r *EnrollKibana) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r EnrollKibana) Perform(ctx context.Context) (*http.Response, error) { +func (r EnrollKibana) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.enroll_kibana") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.enroll_kibana") + if reader := instrument.RecordRequestBody(ctx, "security.enroll_kibana", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.enroll_kibana") + } if err != nil { - return nil, fmt.Errorf("an error happened during the EnrollKibana query execution: %w", err) + localErr := fmt.Errorf("an error happened during the EnrollKibana query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a enrollkibana.Response -func (r EnrollKibana) Do(ctx context.Context) (*Response, error) { +func (r EnrollKibana) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.enroll_kibana") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -165,6 +212,9 @@ func (r EnrollKibana) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -174,6 +224,9 @@ func (r EnrollKibana) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -181,12 +234,25 @@ func (r EnrollKibana) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r EnrollKibana) IsSuccess(ctx context.Context) (bool, error) { +func (r EnrollKibana) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.enroll_kibana") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -202,6 +268,14 @@ func (r EnrollKibana) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the EnrollKibana query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/enrollkibana/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/enrollkibana/response.go index f1de584cd..6b5c4ee89 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/enrollkibana/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/enrollkibana/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package enrollkibana @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package enrollkibana // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/enroll_kibana/Response.ts#L20-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/enroll_kibana/Response.ts#L20-L25 type Response struct { HttpCa string `json:"http_ca"` Token types.KibanaToken `json:"token"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/enrollnode/enroll_node.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/enrollnode/enroll_node.go index 6c0a07be8..b738c8bbc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/enrollnode/enroll_node.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/enrollnode/enroll_node.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Allows a new node to enroll to an existing cluster with security enabled. package enrollnode import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -47,9 +46,13 @@ type EnrollNode struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewEnrollNode type alias for index. @@ -73,7 +76,12 @@ func New(tp elastictransport.Interface) *EnrollNode { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -110,15 +118,15 @@ func (r *EnrollNode) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -135,27 +143,66 @@ func (r *EnrollNode) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r EnrollNode) Perform(ctx context.Context) (*http.Response, error) { +func (r EnrollNode) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.enroll_node") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.enroll_node") + if reader := instrument.RecordRequestBody(ctx, "security.enroll_node", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.enroll_node") + } if err != nil { - return nil, fmt.Errorf("an error happened during the EnrollNode query execution: %w", err) + localErr := fmt.Errorf("an error happened during the EnrollNode query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a enrollnode.Response -func (r EnrollNode) Do(ctx context.Context) (*Response, error) { +func (r EnrollNode) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.enroll_node") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -163,6 +210,9 @@ func (r EnrollNode) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -172,6 +222,9 @@ func (r EnrollNode) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -179,12 +232,25 @@ func (r EnrollNode) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r EnrollNode) IsSuccess(ctx context.Context) (bool, error) { +func (r EnrollNode) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.enroll_node") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -200,6 +266,14 @@ func (r EnrollNode) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the EnrollNode query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/enrollnode/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/enrollnode/response.go index 8e7aeb209..da10689b3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/enrollnode/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/enrollnode/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package enrollnode // Response holds the response body struct for the package enrollnode // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/enroll_node/Response.ts#L20-L29 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/enroll_node/Response.ts#L20-L29 type Response struct { HttpCaCert string `json:"http_ca_cert"` HttpCaKey string `json:"http_ca_key"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getapikey/get_api_key.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getapikey/get_api_key.go index 1ee37e86b..2e7a0dc44 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getapikey/get_api_key.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getapikey/get_api_key.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves information for one or more API keys. package getapikey import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -48,9 +47,13 @@ type GetApiKey struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetApiKey type alias for index. @@ -74,7 +77,12 @@ func New(tp elastictransport.Interface) *GetApiKey { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -109,9 +117,9 @@ func (r *GetApiKey) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -128,27 +136,66 @@ func (r *GetApiKey) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetApiKey) Perform(ctx context.Context) (*http.Response, error) { +func (r GetApiKey) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.get_api_key") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.get_api_key") + if reader := instrument.RecordRequestBody(ctx, "security.get_api_key", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.get_api_key") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetApiKey query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetApiKey query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getapikey.Response -func (r GetApiKey) Do(ctx context.Context) (*Response, error) { +func (r GetApiKey) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_api_key") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -156,6 +203,9 @@ func (r GetApiKey) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -165,6 +215,9 @@ func (r GetApiKey) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -172,12 +225,25 @@ func (r GetApiKey) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetApiKey) IsSuccess(ctx context.Context) (bool, error) { +func (r GetApiKey) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_api_key") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -193,6 +259,14 @@ func (r GetApiKey) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetApiKey query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } @@ -264,3 +338,15 @@ func (r *GetApiKey) WithLimitedBy(withlimitedby bool) *GetApiKey { return r } + +// ActiveOnly A boolean flag that can be used to query API keys that are currently active. +// An API key is considered active if it is neither invalidated, nor expired at +// query time. You can specify this together with other parameters such as +// `owner` or `name`. If `active_only` is false, the response will include both +// active and inactive (expired or invalidated) keys. +// API name: active_only +func (r *GetApiKey) ActiveOnly(activeonly bool) *GetApiKey { + r.values.Set("active_only", strconv.FormatBool(activeonly)) + + return r +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getapikey/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getapikey/response.go index 21a0fdfdc..cbf78bab6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getapikey/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getapikey/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getapikey @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getapikey // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/get_api_key/SecurityGetApiKeyResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/get_api_key/SecurityGetApiKeyResponse.ts#L22-L24 type Response struct { ApiKeys []types.ApiKey `json:"api_keys"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getbuiltinprivileges/get_builtin_privileges.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getbuiltinprivileges/get_builtin_privileges.go index 18ea84a0a..162a25592 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getbuiltinprivileges/get_builtin_privileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getbuiltinprivileges/get_builtin_privileges.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves the list of cluster privileges and index privileges that are // available in this version of Elasticsearch. package getbuiltinprivileges import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -48,9 +47,13 @@ type GetBuiltinPrivileges struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetBuiltinPrivileges type alias for index. @@ -75,7 +78,12 @@ func New(tp elastictransport.Interface) *GetBuiltinPrivileges { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -112,9 +120,9 @@ func (r *GetBuiltinPrivileges) HttpRequest(ctx context.Context) (*http.Request, } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -131,27 +139,66 @@ func (r *GetBuiltinPrivileges) HttpRequest(ctx context.Context) (*http.Request, } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetBuiltinPrivileges) Perform(ctx context.Context) (*http.Response, error) { +func (r GetBuiltinPrivileges) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.get_builtin_privileges") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.get_builtin_privileges") + if reader := instrument.RecordRequestBody(ctx, "security.get_builtin_privileges", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.get_builtin_privileges") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetBuiltinPrivileges query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetBuiltinPrivileges query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getbuiltinprivileges.Response -func (r GetBuiltinPrivileges) Do(ctx context.Context) (*Response, error) { +func (r GetBuiltinPrivileges) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_builtin_privileges") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -159,6 +206,9 @@ func (r GetBuiltinPrivileges) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -168,6 +218,9 @@ func (r GetBuiltinPrivileges) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,12 +228,25 @@ func (r GetBuiltinPrivileges) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetBuiltinPrivileges) IsSuccess(ctx context.Context) (bool, error) { +func (r GetBuiltinPrivileges) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_builtin_privileges") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -196,6 +262,14 @@ func (r GetBuiltinPrivileges) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetBuiltinPrivileges query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getbuiltinprivileges/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getbuiltinprivileges/response.go index ae66c5ec8..6ca3ce068 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getbuiltinprivileges/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getbuiltinprivileges/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getbuiltinprivileges @@ -29,7 +29,7 @@ import ( // Response holds the response body struct for the package getbuiltinprivileges // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/get_builtin_privileges/SecurityGetBuiltinPrivilegesResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/get_builtin_privileges/SecurityGetBuiltinPrivilegesResponse.ts#L22-L24 type Response struct { Cluster []string `json:"cluster"` Index []string `json:"index"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getprivileges/get_privileges.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getprivileges/get_privileges.go index d8e08859a..3f28e590f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getprivileges/get_privileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getprivileges/get_privileges.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves application privileges. package getprivileges import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,12 +52,16 @@ type GetPrivileges struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int application string name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetPrivileges type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *GetPrivileges { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -114,6 +122,9 @@ func (r *GetPrivileges) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("privilege") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "application", r.application) + } path.WriteString(r.application) method = http.MethodGet @@ -124,9 +135,15 @@ func (r *GetPrivileges) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("privilege") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "application", r.application) + } path.WriteString(r.application) path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodGet @@ -140,9 +157,9 @@ func (r *GetPrivileges) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -159,27 +176,66 @@ func (r *GetPrivileges) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetPrivileges) Perform(ctx context.Context) (*http.Response, error) { +func (r GetPrivileges) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.get_privileges") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.get_privileges") + if reader := instrument.RecordRequestBody(ctx, "security.get_privileges", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.get_privileges") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetPrivileges query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetPrivileges query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getprivileges.Response -func (r GetPrivileges) Do(ctx context.Context) (Response, error) { +func (r GetPrivileges) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_privileges") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -187,6 +243,9 @@ func (r GetPrivileges) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -196,6 +255,9 @@ func (r GetPrivileges) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -203,12 +265,25 @@ func (r GetPrivileges) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetPrivileges) IsSuccess(ctx context.Context) (bool, error) { +func (r GetPrivileges) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_privileges") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -224,6 +299,14 @@ func (r GetPrivileges) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetPrivileges query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getprivileges/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getprivileges/response.go index 553388e48..b6a916a2b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getprivileges/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getprivileges/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getprivileges @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getprivileges // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/get_privileges/SecurityGetPrivilegesResponse.ts#L23-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/get_privileges/SecurityGetPrivilegesResponse.ts#L23-L25 type Response map[string]map[string]types.PrivilegesActions diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getrole/get_role.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getrole/get_role.go index f6e9dab98..72e68c0c2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getrole/get_role.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getrole/get_role.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves roles in the native realm. package getrole import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type GetRole struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetRole type alias for index. @@ -79,7 +82,12 @@ func New(tp elastictransport.Interface) *GetRole { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *GetRole) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("role") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodGet @@ -124,9 +135,9 @@ func (r *GetRole) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -143,27 +154,66 @@ func (r *GetRole) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetRole) Perform(ctx context.Context) (*http.Response, error) { +func (r GetRole) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.get_role") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.get_role") + if reader := instrument.RecordRequestBody(ctx, "security.get_role", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.get_role") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetRole query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetRole query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getrole.Response -func (r GetRole) Do(ctx context.Context) (Response, error) { +func (r GetRole) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_role") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -171,6 +221,9 @@ func (r GetRole) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -180,6 +233,9 @@ func (r GetRole) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -187,12 +243,25 @@ func (r GetRole) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetRole) IsSuccess(ctx context.Context) (bool, error) { +func (r GetRole) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_role") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -208,6 +277,14 @@ func (r GetRole) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetRole query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getrole/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getrole/response.go index 67f734b89..c485c04dd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getrole/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getrole/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getrole @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getrole // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/get_role/SecurityGetRoleResponse.ts#L23-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/get_role/SecurityGetRoleResponse.ts#L23-L25 type Response map[string]types.Role diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getrolemapping/get_role_mapping.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getrolemapping/get_role_mapping.go index 68ba8d744..3ca65106d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getrolemapping/get_role_mapping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getrolemapping/get_role_mapping.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves role mappings. package getrolemapping import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type GetRoleMapping struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetRoleMapping type alias for index. @@ -79,7 +82,12 @@ func New(tp elastictransport.Interface) *GetRoleMapping { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *GetRoleMapping) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("role_mapping") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodGet @@ -124,9 +135,9 @@ func (r *GetRoleMapping) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -143,27 +154,66 @@ func (r *GetRoleMapping) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetRoleMapping) Perform(ctx context.Context) (*http.Response, error) { +func (r GetRoleMapping) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.get_role_mapping") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.get_role_mapping") + if reader := instrument.RecordRequestBody(ctx, "security.get_role_mapping", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.get_role_mapping") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetRoleMapping query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetRoleMapping query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getrolemapping.Response -func (r GetRoleMapping) Do(ctx context.Context) (Response, error) { +func (r GetRoleMapping) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_role_mapping") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -171,6 +221,9 @@ func (r GetRoleMapping) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -180,6 +233,9 @@ func (r GetRoleMapping) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -187,12 +243,25 @@ func (r GetRoleMapping) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetRoleMapping) IsSuccess(ctx context.Context) (bool, error) { +func (r GetRoleMapping) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_role_mapping") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -208,6 +277,14 @@ func (r GetRoleMapping) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetRoleMapping query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getrolemapping/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getrolemapping/response.go index f9a49a99a..4aa3a5805 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getrolemapping/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getrolemapping/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getrolemapping @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getrolemapping // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/get_role_mapping/SecurityGetRoleMappingResponse.ts#L23-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/get_role_mapping/SecurityGetRoleMappingResponse.ts#L23-L25 type Response map[string]types.SecurityRoleMapping diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getserviceaccounts/get_service_accounts.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getserviceaccounts/get_service_accounts.go index f30719721..ec10b1c42 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getserviceaccounts/get_service_accounts.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getserviceaccounts/get_service_accounts.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves information about service accounts. package getserviceaccounts import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,12 +52,16 @@ type GetServiceAccounts struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int namespace string service string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetServiceAccounts type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *GetServiceAccounts { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -107,9 +115,15 @@ func (r *GetServiceAccounts) HttpRequest(ctx context.Context) (*http.Request, er path.WriteString("service") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "namespace", r.namespace) + } path.WriteString(r.namespace) path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "service", r.service) + } path.WriteString(r.service) method = http.MethodGet @@ -120,6 +134,9 @@ func (r *GetServiceAccounts) HttpRequest(ctx context.Context) (*http.Request, er path.WriteString("service") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "namespace", r.namespace) + } path.WriteString(r.namespace) method = http.MethodGet @@ -140,9 +157,9 @@ func (r *GetServiceAccounts) HttpRequest(ctx context.Context) (*http.Request, er } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -159,27 +176,66 @@ func (r *GetServiceAccounts) HttpRequest(ctx context.Context) (*http.Request, er } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetServiceAccounts) Perform(ctx context.Context) (*http.Response, error) { +func (r GetServiceAccounts) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.get_service_accounts") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.get_service_accounts") + if reader := instrument.RecordRequestBody(ctx, "security.get_service_accounts", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.get_service_accounts") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetServiceAccounts query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetServiceAccounts query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getserviceaccounts.Response -func (r GetServiceAccounts) Do(ctx context.Context) (Response, error) { +func (r GetServiceAccounts) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_service_accounts") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -187,6 +243,9 @@ func (r GetServiceAccounts) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -196,6 +255,9 @@ func (r GetServiceAccounts) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -203,12 +265,25 @@ func (r GetServiceAccounts) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetServiceAccounts) IsSuccess(ctx context.Context) (bool, error) { +func (r GetServiceAccounts) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_service_accounts") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -224,6 +299,14 @@ func (r GetServiceAccounts) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetServiceAccounts query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getserviceaccounts/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getserviceaccounts/response.go index de8ce991c..44b04999e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getserviceaccounts/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getserviceaccounts/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getserviceaccounts @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getserviceaccounts // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/get_service_accounts/GetServiceAccountsResponse.ts#L23-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/get_service_accounts/GetServiceAccountsResponse.ts#L23-L25 type Response map[string]types.RoleDescriptorWrapper diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getservicecredentials/get_service_credentials.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getservicecredentials/get_service_credentials.go index f93a746ed..614bac2fb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getservicecredentials/get_service_credentials.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getservicecredentials/get_service_credentials.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves information of all service credentials for a service account. package getservicecredentials import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,12 +52,16 @@ type GetServiceCredentials struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int namespace string service string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetServiceCredentials type alias for index. @@ -86,7 +89,12 @@ func New(tp elastictransport.Interface) *GetServiceCredentials { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -111,9 +119,15 @@ func (r *GetServiceCredentials) HttpRequest(ctx context.Context) (*http.Request, path.WriteString("service") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "namespace", r.namespace) + } path.WriteString(r.namespace) path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "service", r.service) + } path.WriteString(r.service) path.WriteString("/") path.WriteString("credential") @@ -129,9 +143,9 @@ func (r *GetServiceCredentials) HttpRequest(ctx context.Context) (*http.Request, } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -148,27 +162,66 @@ func (r *GetServiceCredentials) HttpRequest(ctx context.Context) (*http.Request, } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetServiceCredentials) Perform(ctx context.Context) (*http.Response, error) { +func (r GetServiceCredentials) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.get_service_credentials") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.get_service_credentials") + if reader := instrument.RecordRequestBody(ctx, "security.get_service_credentials", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.get_service_credentials") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetServiceCredentials query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetServiceCredentials query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getservicecredentials.Response -func (r GetServiceCredentials) Do(ctx context.Context) (*Response, error) { +func (r GetServiceCredentials) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_service_credentials") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -176,6 +229,9 @@ func (r GetServiceCredentials) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -185,6 +241,9 @@ func (r GetServiceCredentials) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -192,12 +251,25 @@ func (r GetServiceCredentials) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetServiceCredentials) IsSuccess(ctx context.Context) (bool, error) { +func (r GetServiceCredentials) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_service_credentials") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -213,6 +285,14 @@ func (r GetServiceCredentials) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetServiceCredentials query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getservicecredentials/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getservicecredentials/response.go index 1c2ef1315..4547da80e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getservicecredentials/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getservicecredentials/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getservicecredentials @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getservicecredentials // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/get_service_credentials/GetServiceCredentialsResponse.ts#L25-L33 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/get_service_credentials/GetServiceCredentialsResponse.ts#L25-L33 type Response struct { Count int `json:"count"` // NodesCredentials Contains service account credentials collected from all nodes of the cluster diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getsettings/get_settings.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getsettings/get_settings.go new file mode 100644 index 000000000..37418747f --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getsettings/get_settings.go @@ -0,0 +1,232 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated from the elasticsearch-specification DO NOT EDIT. +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c + +// Retrieve settings for the security system indices +package getsettings + +import ( + "context" + "errors" + "fmt" + "io" + "io/ioutil" + "net/http" + "net/url" + "strings" + + "github.com/elastic/elastic-transport-go/v8/elastictransport" +) + +// ErrBuildPath is returned in case of missing parameters within the build of the request. +var ErrBuildPath = errors.New("cannot build path, check for missing path parameters") + +type GetSettings struct { + transport elastictransport.Interface + + headers http.Header + values url.Values + path url.URL + + raw io.Reader + + paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation +} + +// NewGetSettings type alias for index. +type NewGetSettings func() *GetSettings + +// NewGetSettingsFunc returns a new instance of GetSettings with the provided transport. +// Used in the index of the library this allows to retrieve every apis in once place. +func NewGetSettingsFunc(tp elastictransport.Interface) NewGetSettings { + return func() *GetSettings { + n := New(tp) + + return n + } +} + +// Retrieve settings for the security system indices +// +// https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-settings.html +func New(tp elastictransport.Interface) *GetSettings { + r := &GetSettings{ + transport: tp, + values: make(url.Values), + headers: make(http.Header), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + + return r +} + +// HttpRequest returns the http.Request object built from the +// given parameters. +func (r *GetSettings) HttpRequest(ctx context.Context) (*http.Request, error) { + var path strings.Builder + var method string + var req *http.Request + + var err error + + r.path.Scheme = "http" + + switch { + case r.paramSet == 0: + path.WriteString("/") + path.WriteString("_security") + path.WriteString("/") + path.WriteString("settings") + + method = http.MethodGet + } + + r.path.Path = path.String() + r.path.RawQuery = r.values.Encode() + + if r.path.Path == "" { + return nil, ErrBuildPath + } + + if ctx != nil { + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) + } else { + req, err = http.NewRequest(method, r.path.String(), r.raw) + } + + req.Header = r.headers.Clone() + + if req.Header.Get("Content-Type") == "" { + if r.raw != nil { + req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") + } + } + + if req.Header.Get("Accept") == "" { + req.Header.Set("Accept", "application/vnd.elasticsearch+json;compatible-with=8") + } + + if err != nil { + return req, fmt.Errorf("could not build http.Request: %w", err) + } + + return req, nil +} + +// Perform runs the http.Request through the provided transport and returns an http.Response. +func (r GetSettings) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.get_settings") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + + req, err := r.HttpRequest(ctx) + if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.get_settings") + if reader := instrument.RecordRequestBody(ctx, "security.get_settings", r.raw); reader != nil { + req.Body = reader + } + } + res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.get_settings") + } + if err != nil { + localErr := fmt.Errorf("an error happened during the GetSettings query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr + } + + return res, nil +} + +// Do runs the request through the transport, handle the response and returns a getsettings.Response +func (r GetSettings) Do(ctx context.Context) (bool, error) { + return r.IsSuccess(ctx) +} + +// IsSuccess allows to run a query with a context and retrieve the result as a boolean. +// This only exists for endpoints without a request payload and allows for quick control flow. +func (r GetSettings) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_settings") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + res, err := r.Perform(ctx) + + if err != nil { + return false, err + } + io.Copy(ioutil.Discard, res.Body) + err = res.Body.Close() + if err != nil { + return false, err + } + + if res.StatusCode >= 200 && res.StatusCode < 300 { + return true, nil + } + + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetSettings query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + + return false, nil +} + +// Header set a key, value pair in the GetSettings headers map. +func (r *GetSettings) Header(key, value string) *GetSettings { + r.headers.Set(key, value) + + return r +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/gettoken/get_token.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/gettoken/get_token.go index 2abb372b4..9af5a6851 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/gettoken/get_token.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/gettoken/get_token.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates a bearer token for access without requiring basic authentication. package gettoken @@ -47,13 +47,17 @@ type GetToken struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetToken type alias for index. @@ -77,11 +81,18 @@ func New(tp elastictransport.Interface) *GetToken { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -118,9 +129,7 @@ func (r *GetToken) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -132,6 +141,10 @@ func (r *GetToken) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -154,15 +167,15 @@ func (r *GetToken) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -179,27 +192,66 @@ func (r *GetToken) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetToken) Perform(ctx context.Context) (*http.Response, error) { +func (r GetToken) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.get_token") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.get_token") + if reader := instrument.RecordRequestBody(ctx, "security.get_token", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.get_token") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetToken query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetToken query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a gettoken.Response -func (r GetToken) Do(ctx context.Context) (*Response, error) { +func (r GetToken) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_token") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -207,6 +259,9 @@ func (r GetToken) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -216,6 +271,9 @@ func (r GetToken) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -223,6 +281,9 @@ func (r GetToken) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/gettoken/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/gettoken/request.go index 434410cd4..bdc8ee963 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/gettoken/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/gettoken/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package gettoken @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package gettoken // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/get_token/GetUserAccessTokenRequest.ts#L25-L39 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/get_token/GetUserAccessTokenRequest.ts#L25-L39 type Request struct { GrantType *accesstokengranttype.AccessTokenGrantType `json:"grant_type,omitempty"` KerberosTicket *string `json:"kerberos_ticket,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/gettoken/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/gettoken/response.go index 8c9748209..b68b1eefe 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/gettoken/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/gettoken/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package gettoken @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package gettoken // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/get_token/GetUserAccessTokenResponse.ts#L23-L33 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/get_token/GetUserAccessTokenResponse.ts#L23-L33 type Response struct { AccessToken string `json:"access_token"` Authentication types.AuthenticatedUser `json:"authentication"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getuser/get_user.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getuser/get_user.go index 8ba256523..cbd065d41 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getuser/get_user.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getuser/get_user.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves information about users in the native realm and built-in users. package getuser import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type GetUser struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int username string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetUser type alias for index. @@ -80,7 +83,12 @@ func New(tp elastictransport.Interface) *GetUser { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -105,6 +113,9 @@ func (r *GetUser) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("user") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "username", r.username) + } path.WriteString(r.username) method = http.MethodGet @@ -125,9 +136,9 @@ func (r *GetUser) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -144,27 +155,66 @@ func (r *GetUser) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetUser) Perform(ctx context.Context) (*http.Response, error) { +func (r GetUser) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.get_user") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.get_user") + if reader := instrument.RecordRequestBody(ctx, "security.get_user", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.get_user") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetUser query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetUser query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getuser.Response -func (r GetUser) Do(ctx context.Context) (Response, error) { +func (r GetUser) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_user") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -172,6 +222,9 @@ func (r GetUser) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -181,6 +234,9 @@ func (r GetUser) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -188,12 +244,25 @@ func (r GetUser) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetUser) IsSuccess(ctx context.Context) (bool, error) { +func (r GetUser) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_user") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -209,6 +278,14 @@ func (r GetUser) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetUser query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getuser/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getuser/response.go index 2113d0076..d04b8462a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getuser/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getuser/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getuser @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getuser // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/get_user/SecurityGetUserResponse.ts#L23-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/get_user/SecurityGetUserResponse.ts#L23-L25 type Response map[string]types.User diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getuserprivileges/get_user_privileges.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getuserprivileges/get_user_privileges.go index bddcbc89a..c8b21651e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getuserprivileges/get_user_privileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getuserprivileges/get_user_privileges.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves security privileges for the logged in user. package getuserprivileges import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -47,9 +46,13 @@ type GetUserPrivileges struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetUserPrivileges type alias for index. @@ -73,7 +76,12 @@ func New(tp elastictransport.Interface) *GetUserPrivileges { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -110,9 +118,9 @@ func (r *GetUserPrivileges) HttpRequest(ctx context.Context) (*http.Request, err } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -129,27 +137,66 @@ func (r *GetUserPrivileges) HttpRequest(ctx context.Context) (*http.Request, err } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetUserPrivileges) Perform(ctx context.Context) (*http.Response, error) { +func (r GetUserPrivileges) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.get_user_privileges") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.get_user_privileges") + if reader := instrument.RecordRequestBody(ctx, "security.get_user_privileges", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.get_user_privileges") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetUserPrivileges query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetUserPrivileges query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getuserprivileges.Response -func (r GetUserPrivileges) Do(ctx context.Context) (*Response, error) { +func (r GetUserPrivileges) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_user_privileges") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -157,6 +204,9 @@ func (r GetUserPrivileges) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -166,6 +216,9 @@ func (r GetUserPrivileges) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -173,12 +226,25 @@ func (r GetUserPrivileges) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetUserPrivileges) IsSuccess(ctx context.Context) (bool, error) { +func (r GetUserPrivileges) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_user_privileges") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -194,6 +260,14 @@ func (r GetUserPrivileges) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetUserPrivileges query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getuserprivileges/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getuserprivileges/response.go index 7e3bb3ea0..ec65ef729 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getuserprivileges/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getuserprivileges/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getuserprivileges @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getuserprivileges // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/get_user_privileges/SecurityGetUserPrivilegesResponse.ts#L27-L35 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/get_user_privileges/SecurityGetUserPrivilegesResponse.ts#L27-L35 type Response struct { Applications []types.ApplicationPrivileges `json:"applications"` Cluster []string `json:"cluster"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getuserprofile/get_user_profile.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getuserprofile/get_user_profile.go index 8cee00b24..a8b743c08 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getuserprofile/get_user_profile.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getuserprofile/get_user_profile.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves user profiles for the given unique ID(s). package getuserprofile import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type GetUserProfile struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int uid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetUserProfile type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *GetUserProfile { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *GetUserProfile) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("profile") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "uid", r.uid) + } path.WriteString(r.uid) method = http.MethodGet @@ -119,9 +130,9 @@ func (r *GetUserProfile) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -138,27 +149,66 @@ func (r *GetUserProfile) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetUserProfile) Perform(ctx context.Context) (*http.Response, error) { +func (r GetUserProfile) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.get_user_profile") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.get_user_profile") + if reader := instrument.RecordRequestBody(ctx, "security.get_user_profile", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.get_user_profile") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetUserProfile query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetUserProfile query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getuserprofile.Response -func (r GetUserProfile) Do(ctx context.Context) (*Response, error) { +func (r GetUserProfile) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_user_profile") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -166,6 +216,9 @@ func (r GetUserProfile) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,6 +228,9 @@ func (r GetUserProfile) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,12 +238,25 @@ func (r GetUserProfile) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetUserProfile) IsSuccess(ctx context.Context) (bool, error) { +func (r GetUserProfile) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.get_user_profile") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -203,6 +272,14 @@ func (r GetUserProfile) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetUserProfile query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getuserprofile/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getuserprofile/response.go index 9a0fb2d07..023e9e734 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getuserprofile/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/getuserprofile/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getuserprofile @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getuserprofile // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/get_user_profile/Response.ts#L23-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/get_user_profile/Response.ts#L23-L28 type Response struct { Errors *types.GetUserProfileErrors `json:"errors,omitempty"` Profiles []types.UserProfileWithMetadata `json:"profiles"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/grantapikey/grant_api_key.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/grantapikey/grant_api_key.go index e70857784..beccff998 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/grantapikey/grant_api_key.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/grantapikey/grant_api_key.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates an API key on behalf of another user. package grantapikey @@ -47,13 +47,17 @@ type GrantApiKey struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGrantApiKey type alias for index. @@ -77,11 +81,18 @@ func New(tp elastictransport.Interface) *GrantApiKey { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -118,9 +129,7 @@ func (r *GrantApiKey) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -132,6 +141,10 @@ func (r *GrantApiKey) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -154,15 +167,15 @@ func (r *GrantApiKey) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -179,27 +192,66 @@ func (r *GrantApiKey) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GrantApiKey) Perform(ctx context.Context) (*http.Response, error) { +func (r GrantApiKey) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.grant_api_key") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.grant_api_key") + if reader := instrument.RecordRequestBody(ctx, "security.grant_api_key", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.grant_api_key") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GrantApiKey query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GrantApiKey query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a grantapikey.Response -func (r GrantApiKey) Do(ctx context.Context) (*Response, error) { +func (r GrantApiKey) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.grant_api_key") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -207,6 +259,9 @@ func (r GrantApiKey) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -216,6 +271,9 @@ func (r GrantApiKey) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -223,6 +281,9 @@ func (r GrantApiKey) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/grantapikey/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/grantapikey/request.go index 607ecc0d0..3a7aaec3b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/grantapikey/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/grantapikey/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package grantapikey @@ -30,7 +30,7 @@ import ( // Request holds the request body struct for the package grantapikey // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/grant_api_key/SecurityGrantApiKeyRequest.ts#L24-L75 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/grant_api_key/SecurityGrantApiKeyRequest.ts#L24-L75 type Request struct { // AccessToken The user’s access token. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/grantapikey/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/grantapikey/response.go index 44d0d30b5..6a327e9c8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/grantapikey/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/grantapikey/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package grantapikey // Response holds the response body struct for the package grantapikey // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/grant_api_key/SecurityGrantApiKeyResponse.ts#L23-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/grant_api_key/SecurityGrantApiKeyResponse.ts#L23-L31 type Response struct { ApiKey string `json:"api_key"` Encoded string `json:"encoded"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/hasprivileges/has_privileges.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/hasprivileges/has_privileges.go index 82ce97bd8..b8fea4998 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/hasprivileges/has_privileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/hasprivileges/has_privileges.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Determines whether the specified user has a specified list of privileges. package hasprivileges @@ -51,15 +51,19 @@ type HasPrivileges struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int user string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewHasPrivileges type alias for index. @@ -83,11 +87,18 @@ func New(tp elastictransport.Interface) *HasPrivileges { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -124,9 +135,7 @@ func (r *HasPrivileges) HttpRequest(ctx context.Context) (*http.Request, error) } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -138,6 +147,10 @@ func (r *HasPrivileges) HttpRequest(ctx context.Context) (*http.Request, error) } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -157,6 +170,9 @@ func (r *HasPrivileges) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("user") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "user", r.user) + } path.WriteString(r.user) path.WriteString("/") path.WriteString("_has_privileges") @@ -172,15 +188,15 @@ func (r *HasPrivileges) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -197,27 +213,66 @@ func (r *HasPrivileges) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r HasPrivileges) Perform(ctx context.Context) (*http.Response, error) { +func (r HasPrivileges) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.has_privileges") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.has_privileges") + if reader := instrument.RecordRequestBody(ctx, "security.has_privileges", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.has_privileges") + } if err != nil { - return nil, fmt.Errorf("an error happened during the HasPrivileges query execution: %w", err) + localErr := fmt.Errorf("an error happened during the HasPrivileges query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a hasprivileges.Response -func (r HasPrivileges) Do(ctx context.Context) (*Response, error) { +func (r HasPrivileges) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.has_privileges") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -225,6 +280,9 @@ func (r HasPrivileges) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -234,6 +292,9 @@ func (r HasPrivileges) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -241,6 +302,9 @@ func (r HasPrivileges) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/hasprivileges/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/hasprivileges/request.go index 753b29987..2c7404bd8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/hasprivileges/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/hasprivileges/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package hasprivileges @@ -30,7 +30,7 @@ import ( // Request holds the request body struct for the package hasprivileges // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/has_privileges/SecurityHasPrivilegesRequest.ts#L25-L42 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/has_privileges/SecurityHasPrivilegesRequest.ts#L25-L42 type Request struct { Application []types.ApplicationPrivilegesCheck `json:"application,omitempty"` // Cluster A list of the cluster privileges that you want to check. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/hasprivileges/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/hasprivileges/response.go index 5dadfc461..dbbd4ab23 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/hasprivileges/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/hasprivileges/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package hasprivileges @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package hasprivileges // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/has_privileges/SecurityHasPrivilegesResponse.ts#L24-L32 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/has_privileges/SecurityHasPrivilegesResponse.ts#L24-L32 type Response struct { Application types.ApplicationsPrivileges `json:"application"` Cluster map[string]bool `json:"cluster"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/hasprivilegesuserprofile/has_privileges_user_profile.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/hasprivilegesuserprofile/has_privileges_user_profile.go index 09cb3ba8e..18faff31c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/hasprivilegesuserprofile/has_privileges_user_profile.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/hasprivilegesuserprofile/has_privileges_user_profile.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Determines whether the users associated with the specified profile IDs have // all the requested privileges. @@ -47,13 +47,17 @@ type HasPrivilegesUserProfile struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewHasPrivilegesUserProfile type alias for index. @@ -78,11 +82,18 @@ func New(tp elastictransport.Interface) *HasPrivilegesUserProfile { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -119,9 +130,7 @@ func (r *HasPrivilegesUserProfile) HttpRequest(ctx context.Context) (*http.Reque } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -133,6 +142,10 @@ func (r *HasPrivilegesUserProfile) HttpRequest(ctx context.Context) (*http.Reque } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -155,15 +168,15 @@ func (r *HasPrivilegesUserProfile) HttpRequest(ctx context.Context) (*http.Reque } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -180,27 +193,66 @@ func (r *HasPrivilegesUserProfile) HttpRequest(ctx context.Context) (*http.Reque } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r HasPrivilegesUserProfile) Perform(ctx context.Context) (*http.Response, error) { +func (r HasPrivilegesUserProfile) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.has_privileges_user_profile") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.has_privileges_user_profile") + if reader := instrument.RecordRequestBody(ctx, "security.has_privileges_user_profile", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.has_privileges_user_profile") + } if err != nil { - return nil, fmt.Errorf("an error happened during the HasPrivilegesUserProfile query execution: %w", err) + localErr := fmt.Errorf("an error happened during the HasPrivilegesUserProfile query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a hasprivilegesuserprofile.Response -func (r HasPrivilegesUserProfile) Do(ctx context.Context) (*Response, error) { +func (r HasPrivilegesUserProfile) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.has_privileges_user_profile") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -208,6 +260,9 @@ func (r HasPrivilegesUserProfile) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -217,6 +272,9 @@ func (r HasPrivilegesUserProfile) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -224,6 +282,9 @@ func (r HasPrivilegesUserProfile) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/hasprivilegesuserprofile/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/hasprivilegesuserprofile/request.go index 69ed9cba0..3ccac475c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/hasprivilegesuserprofile/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/hasprivilegesuserprofile/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package hasprivilegesuserprofile @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package hasprivilegesuserprofile // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/has_privileges_user_profile/Request.ts#L24-L38 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/has_privileges_user_profile/Request.ts#L24-L38 type Request struct { Privileges types.PrivilegesCheck `json:"privileges"` // Uids A list of profile IDs. The privileges are checked for associated users of the diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/hasprivilegesuserprofile/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/hasprivilegesuserprofile/response.go index 817a45c32..c5f1f6c73 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/hasprivilegesuserprofile/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/hasprivilegesuserprofile/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package hasprivilegesuserprofile @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package hasprivilegesuserprofile // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/has_privileges_user_profile/Response.ts#L23-L38 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/has_privileges_user_profile/Response.ts#L23-L38 type Response struct { // Errors The subset of the requested profile IDs for which an error diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/invalidateapikey/invalidate_api_key.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/invalidateapikey/invalidate_api_key.go index a413e6ab4..d72af8fea 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/invalidateapikey/invalidate_api_key.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/invalidateapikey/invalidate_api_key.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Invalidates one or more API keys. package invalidateapikey @@ -46,13 +46,17 @@ type InvalidateApiKey struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewInvalidateApiKey type alias for index. @@ -76,11 +80,18 @@ func New(tp elastictransport.Interface) *InvalidateApiKey { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -117,9 +128,7 @@ func (r *InvalidateApiKey) HttpRequest(ctx context.Context) (*http.Request, erro } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -131,6 +140,10 @@ func (r *InvalidateApiKey) HttpRequest(ctx context.Context) (*http.Request, erro } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -151,15 +164,15 @@ func (r *InvalidateApiKey) HttpRequest(ctx context.Context) (*http.Request, erro } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -176,27 +189,66 @@ func (r *InvalidateApiKey) HttpRequest(ctx context.Context) (*http.Request, erro } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r InvalidateApiKey) Perform(ctx context.Context) (*http.Response, error) { +func (r InvalidateApiKey) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.invalidate_api_key") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.invalidate_api_key") + if reader := instrument.RecordRequestBody(ctx, "security.invalidate_api_key", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.invalidate_api_key") + } if err != nil { - return nil, fmt.Errorf("an error happened during the InvalidateApiKey query execution: %w", err) + localErr := fmt.Errorf("an error happened during the InvalidateApiKey query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a invalidateapikey.Response -func (r InvalidateApiKey) Do(ctx context.Context) (*Response, error) { +func (r InvalidateApiKey) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.invalidate_api_key") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -204,6 +256,9 @@ func (r InvalidateApiKey) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -213,6 +268,9 @@ func (r InvalidateApiKey) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -220,6 +278,9 @@ func (r InvalidateApiKey) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/invalidateapikey/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/invalidateapikey/request.go index 79bf171f9..0d8873a53 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/invalidateapikey/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/invalidateapikey/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package invalidateapikey @@ -27,7 +27,7 @@ import ( // Request holds the request body struct for the package invalidateapikey // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/invalidate_api_key/SecurityInvalidateApiKeyRequest.ts#L23-L66 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/invalidate_api_key/SecurityInvalidateApiKeyRequest.ts#L23-L66 type Request struct { Id *string `json:"id,omitempty"` // Ids A list of API key ids. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/invalidateapikey/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/invalidateapikey/response.go index 12a7865dd..fb60d7d9c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/invalidateapikey/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/invalidateapikey/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package invalidateapikey @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package invalidateapikey // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/invalidate_api_key/SecurityInvalidateApiKeyResponse.ts#L23-L30 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/invalidate_api_key/SecurityInvalidateApiKeyResponse.ts#L23-L30 type Response struct { ErrorCount int `json:"error_count"` ErrorDetails []types.ErrorCause `json:"error_details,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/invalidatetoken/invalidate_token.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/invalidatetoken/invalidate_token.go index ebff48e5a..06ab92c59 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/invalidatetoken/invalidate_token.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/invalidatetoken/invalidate_token.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Invalidates one or more access tokens or refresh tokens. package invalidatetoken @@ -46,13 +46,17 @@ type InvalidateToken struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewInvalidateToken type alias for index. @@ -76,11 +80,18 @@ func New(tp elastictransport.Interface) *InvalidateToken { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -117,9 +128,7 @@ func (r *InvalidateToken) HttpRequest(ctx context.Context) (*http.Request, error } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -131,6 +140,10 @@ func (r *InvalidateToken) HttpRequest(ctx context.Context) (*http.Request, error } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -153,15 +166,15 @@ func (r *InvalidateToken) HttpRequest(ctx context.Context) (*http.Request, error } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -178,27 +191,66 @@ func (r *InvalidateToken) HttpRequest(ctx context.Context) (*http.Request, error } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r InvalidateToken) Perform(ctx context.Context) (*http.Response, error) { +func (r InvalidateToken) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.invalidate_token") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.invalidate_token") + if reader := instrument.RecordRequestBody(ctx, "security.invalidate_token", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.invalidate_token") + } if err != nil { - return nil, fmt.Errorf("an error happened during the InvalidateToken query execution: %w", err) + localErr := fmt.Errorf("an error happened during the InvalidateToken query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a invalidatetoken.Response -func (r InvalidateToken) Do(ctx context.Context) (*Response, error) { +func (r InvalidateToken) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.invalidate_token") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -206,6 +258,9 @@ func (r InvalidateToken) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -215,6 +270,9 @@ func (r InvalidateToken) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -222,6 +280,9 @@ func (r InvalidateToken) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/invalidatetoken/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/invalidatetoken/request.go index 191793552..12b73cae9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/invalidatetoken/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/invalidatetoken/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package invalidatetoken @@ -27,7 +27,7 @@ import ( // Request holds the request body struct for the package invalidatetoken // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/invalidate_token/SecurityInvalidateTokenRequest.ts#L23-L35 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/invalidate_token/SecurityInvalidateTokenRequest.ts#L23-L35 type Request struct { RealmName *string `json:"realm_name,omitempty"` RefreshToken *string `json:"refresh_token,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/invalidatetoken/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/invalidatetoken/response.go index 4fff40725..8f66f97a1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/invalidatetoken/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/invalidatetoken/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package invalidatetoken @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package invalidatetoken // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/invalidate_token/SecurityInvalidateTokenResponse.ts#L23-L30 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/invalidate_token/SecurityInvalidateTokenResponse.ts#L23-L30 type Response struct { ErrorCount int64 `json:"error_count"` ErrorDetails []types.ErrorCause `json:"error_details,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/oidcauthenticate/oidc_authenticate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/oidcauthenticate/oidc_authenticate.go index 8618ef346..622e74e75 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/oidcauthenticate/oidc_authenticate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/oidcauthenticate/oidc_authenticate.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Exchanges an OpenID Connection authentication response message for an // Elasticsearch access token and refresh token pair package oidcauthenticate import ( - gobytes "bytes" "context" "errors" "fmt" @@ -46,9 +45,13 @@ type OidcAuthenticate struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewOidcAuthenticate type alias for index. @@ -73,7 +76,12 @@ func New(tp elastictransport.Interface) *OidcAuthenticate { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -110,15 +118,15 @@ func (r *OidcAuthenticate) HttpRequest(ctx context.Context) (*http.Request, erro } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -135,15 +143,42 @@ func (r *OidcAuthenticate) HttpRequest(ctx context.Context) (*http.Request, erro } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r OidcAuthenticate) Perform(ctx context.Context) (*http.Response, error) { +func (r OidcAuthenticate) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.oidc_authenticate") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.oidc_authenticate") + if reader := instrument.RecordRequestBody(ctx, "security.oidc_authenticate", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.oidc_authenticate") + } if err != nil { - return nil, fmt.Errorf("an error happened during the OidcAuthenticate query execution: %w", err) + localErr := fmt.Errorf("an error happened during the OidcAuthenticate query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil @@ -156,7 +191,17 @@ func (r OidcAuthenticate) Do(ctx context.Context) (bool, error) { // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r OidcAuthenticate) IsSuccess(ctx context.Context) (bool, error) { +func (r OidcAuthenticate) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.oidc_authenticate") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -172,6 +217,14 @@ func (r OidcAuthenticate) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the OidcAuthenticate query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/oidclogout/oidc_logout.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/oidclogout/oidc_logout.go index 2ff7b016f..92509a7f3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/oidclogout/oidc_logout.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/oidclogout/oidc_logout.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Invalidates a refresh token and access token that was generated from the // OpenID Connect Authenticate API package oidclogout import ( - gobytes "bytes" "context" "errors" "fmt" @@ -46,9 +45,13 @@ type OidcLogout struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewOidcLogout type alias for index. @@ -73,7 +76,12 @@ func New(tp elastictransport.Interface) *OidcLogout { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -110,15 +118,15 @@ func (r *OidcLogout) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -135,15 +143,42 @@ func (r *OidcLogout) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r OidcLogout) Perform(ctx context.Context) (*http.Response, error) { +func (r OidcLogout) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.oidc_logout") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.oidc_logout") + if reader := instrument.RecordRequestBody(ctx, "security.oidc_logout", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.oidc_logout") + } if err != nil { - return nil, fmt.Errorf("an error happened during the OidcLogout query execution: %w", err) + localErr := fmt.Errorf("an error happened during the OidcLogout query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil @@ -156,7 +191,17 @@ func (r OidcLogout) Do(ctx context.Context) (bool, error) { // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r OidcLogout) IsSuccess(ctx context.Context) (bool, error) { +func (r OidcLogout) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.oidc_logout") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -172,6 +217,14 @@ func (r OidcLogout) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the OidcLogout query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/oidcprepareauthentication/oidc_prepare_authentication.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/oidcprepareauthentication/oidc_prepare_authentication.go index 96e537bd5..fef4847fe 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/oidcprepareauthentication/oidc_prepare_authentication.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/oidcprepareauthentication/oidc_prepare_authentication.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates an OAuth 2.0 authentication request as a URL string package oidcprepareauthentication import ( - gobytes "bytes" "context" "errors" "fmt" @@ -45,9 +44,13 @@ type OidcPrepareAuthentication struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewOidcPrepareAuthentication type alias for index. @@ -71,7 +74,12 @@ func New(tp elastictransport.Interface) *OidcPrepareAuthentication { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,15 +116,15 @@ func (r *OidcPrepareAuthentication) HttpRequest(ctx context.Context) (*http.Requ } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -133,15 +141,42 @@ func (r *OidcPrepareAuthentication) HttpRequest(ctx context.Context) (*http.Requ } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r OidcPrepareAuthentication) Perform(ctx context.Context) (*http.Response, error) { +func (r OidcPrepareAuthentication) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.oidc_prepare_authentication") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.oidc_prepare_authentication") + if reader := instrument.RecordRequestBody(ctx, "security.oidc_prepare_authentication", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.oidc_prepare_authentication") + } if err != nil { - return nil, fmt.Errorf("an error happened during the OidcPrepareAuthentication query execution: %w", err) + localErr := fmt.Errorf("an error happened during the OidcPrepareAuthentication query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil @@ -154,7 +189,17 @@ func (r OidcPrepareAuthentication) Do(ctx context.Context) (bool, error) { // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r OidcPrepareAuthentication) IsSuccess(ctx context.Context) (bool, error) { +func (r OidcPrepareAuthentication) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.oidc_prepare_authentication") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -170,6 +215,14 @@ func (r OidcPrepareAuthentication) IsSuccess(ctx context.Context) (bool, error) return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the OidcPrepareAuthentication query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putprivileges/put_privileges.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putprivileges/put_privileges.go index 7f304e3e6..abe6804b5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putprivileges/put_privileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putprivileges/put_privileges.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Adds or updates application privileges. package putprivileges @@ -47,13 +47,17 @@ type PutPrivileges struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutPrivileges type alias for index. @@ -77,7 +81,14 @@ func New(tp elastictransport.Interface) *PutPrivileges { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -116,9 +127,7 @@ func (r *PutPrivileges) HttpRequest(ctx context.Context) (*http.Request, error) } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -130,6 +139,10 @@ func (r *PutPrivileges) HttpRequest(ctx context.Context) (*http.Request, error) } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -150,15 +163,15 @@ func (r *PutPrivileges) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -175,27 +188,66 @@ func (r *PutPrivileges) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutPrivileges) Perform(ctx context.Context) (*http.Response, error) { +func (r PutPrivileges) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.put_privileges") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.put_privileges") + if reader := instrument.RecordRequestBody(ctx, "security.put_privileges", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.put_privileges") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutPrivileges query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutPrivileges query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a putprivileges.Response -func (r PutPrivileges) Do(ctx context.Context) (Response, error) { +func (r PutPrivileges) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.put_privileges") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -203,6 +255,9 @@ func (r PutPrivileges) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -212,6 +267,9 @@ func (r PutPrivileges) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -219,6 +277,9 @@ func (r PutPrivileges) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putprivileges/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putprivileges/request.go index ec85a4141..1ad83dcc4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putprivileges/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putprivileges/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putprivileges @@ -26,5 +26,5 @@ import ( // Request holds the request body struct for the package putprivileges // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/put_privileges/SecurityPutPrivilegesRequest.ts#L25-L37 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/put_privileges/SecurityPutPrivilegesRequest.ts#L25-L37 type Request = map[string]map[string]types.PrivilegesActions diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putprivileges/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putprivileges/response.go index 09c70e881..0e60b6af9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putprivileges/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putprivileges/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putprivileges @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package putprivileges // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/put_privileges/SecurityPutPrivilegesResponse.ts#L23-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/put_privileges/SecurityPutPrivilegesResponse.ts#L23-L25 type Response map[string]map[string]types.CreatedStatus diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putrole/put_role.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putrole/put_role.go index 3df523033..a4c2b9790 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putrole/put_role.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putrole/put_role.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Adds and updates roles in the native realm. package putrole @@ -52,15 +52,19 @@ type PutRole struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutRole type alias for index. @@ -86,11 +90,18 @@ func New(tp elastictransport.Interface) *PutRole { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -127,9 +138,7 @@ func (r *PutRole) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -141,6 +150,10 @@ func (r *PutRole) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -151,6 +164,9 @@ func (r *PutRole) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("role") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodPut @@ -164,15 +180,15 @@ func (r *PutRole) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -189,27 +205,66 @@ func (r *PutRole) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutRole) Perform(ctx context.Context) (*http.Response, error) { +func (r PutRole) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.put_role") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.put_role") + if reader := instrument.RecordRequestBody(ctx, "security.put_role", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.put_role") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutRole query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutRole query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a putrole.Response -func (r PutRole) Do(ctx context.Context) (*Response, error) { +func (r PutRole) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.put_role") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -217,6 +272,9 @@ func (r PutRole) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -226,6 +284,9 @@ func (r PutRole) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -233,6 +294,9 @@ func (r PutRole) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putrole/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putrole/request.go index c9b621e12..3e097388b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putrole/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putrole/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putrole @@ -30,7 +30,7 @@ import ( // Request holds the request body struct for the package putrole // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/put_role/SecurityPutRoleRequest.ts#L31-L80 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/put_role/SecurityPutRoleRequest.ts#L31-L80 type Request struct { // Applications A list of application privilege entries. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putrole/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putrole/response.go index deb9ddcc5..98e2a9561 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putrole/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putrole/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putrole @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package putrole // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/put_role/SecurityPutRoleResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/put_role/SecurityPutRoleResponse.ts#L22-L24 type Response struct { Role types.CreatedStatus `json:"role"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putrolemapping/put_role_mapping.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putrolemapping/put_role_mapping.go index 46124ad6c..6a1ee336e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putrolemapping/put_role_mapping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putrolemapping/put_role_mapping.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates and updates role mappings. package putrolemapping @@ -51,15 +51,19 @@ type PutRoleMapping struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int name string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutRoleMapping type alias for index. @@ -85,11 +89,18 @@ func New(tp elastictransport.Interface) *PutRoleMapping { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -126,9 +137,7 @@ func (r *PutRoleMapping) HttpRequest(ctx context.Context) (*http.Request, error) } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -140,6 +149,10 @@ func (r *PutRoleMapping) HttpRequest(ctx context.Context) (*http.Request, error) } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -150,6 +163,9 @@ func (r *PutRoleMapping) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("role_mapping") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "name", r.name) + } path.WriteString(r.name) method = http.MethodPut @@ -163,15 +179,15 @@ func (r *PutRoleMapping) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -188,27 +204,66 @@ func (r *PutRoleMapping) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutRoleMapping) Perform(ctx context.Context) (*http.Response, error) { +func (r PutRoleMapping) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.put_role_mapping") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.put_role_mapping") + if reader := instrument.RecordRequestBody(ctx, "security.put_role_mapping", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.put_role_mapping") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutRoleMapping query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutRoleMapping query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a putrolemapping.Response -func (r PutRoleMapping) Do(ctx context.Context) (*Response, error) { +func (r PutRoleMapping) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.put_role_mapping") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -216,6 +271,9 @@ func (r PutRoleMapping) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -225,6 +283,9 @@ func (r PutRoleMapping) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -232,6 +293,9 @@ func (r PutRoleMapping) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } @@ -275,6 +339,13 @@ func (r *PutRoleMapping) Metadata(metadata types.Metadata) *PutRoleMapping { return r } +// API name: role_templates +func (r *PutRoleMapping) RoleTemplates(roletemplates ...types.RoleTemplate) *PutRoleMapping { + r.req.RoleTemplates = roletemplates + + return r +} + // API name: roles func (r *PutRoleMapping) Roles(roles ...string) *PutRoleMapping { r.req.Roles = roles diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putrolemapping/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putrolemapping/request.go index 98b30aa50..a678e8923 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putrolemapping/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putrolemapping/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putrolemapping @@ -29,13 +29,14 @@ import ( // Request holds the request body struct for the package putrolemapping // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/put_role_mapping/SecurityPutRoleMappingRequest.ts#L24-L43 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/put_role_mapping/SecurityPutRoleMappingRequest.ts#L25-L45 type Request struct { - Enabled *bool `json:"enabled,omitempty"` - Metadata types.Metadata `json:"metadata,omitempty"` - Roles []string `json:"roles,omitempty"` - Rules *types.RoleMappingRule `json:"rules,omitempty"` - RunAs []string `json:"run_as,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Metadata types.Metadata `json:"metadata,omitempty"` + RoleTemplates []types.RoleTemplate `json:"role_templates,omitempty"` + Roles []string `json:"roles,omitempty"` + Rules *types.RoleMappingRule `json:"rules,omitempty"` + RunAs []string `json:"run_as,omitempty"` } // NewRequest returns a Request diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putrolemapping/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putrolemapping/response.go index c94541cf6..26e516a55 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putrolemapping/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putrolemapping/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putrolemapping @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package putrolemapping // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/put_role_mapping/SecurityPutRoleMappingResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/put_role_mapping/SecurityPutRoleMappingResponse.ts#L22-L24 type Response struct { Created *bool `json:"created,omitempty"` RoleMapping types.CreatedStatus `json:"role_mapping"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putuser/put_user.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putuser/put_user.go index 671e19383..f9733f37d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putuser/put_user.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putuser/put_user.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Adds and updates users in the native realm. These users are commonly referred // to as native users. @@ -52,15 +52,19 @@ type PutUser struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int username string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutUser type alias for index. @@ -87,11 +91,18 @@ func New(tp elastictransport.Interface) *PutUser { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -128,9 +139,7 @@ func (r *PutUser) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -142,6 +151,10 @@ func (r *PutUser) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -152,6 +165,9 @@ func (r *PutUser) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("user") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "username", r.username) + } path.WriteString(r.username) method = http.MethodPut @@ -165,15 +181,15 @@ func (r *PutUser) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -190,27 +206,66 @@ func (r *PutUser) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutUser) Perform(ctx context.Context) (*http.Response, error) { +func (r PutUser) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.put_user") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.put_user") + if reader := instrument.RecordRequestBody(ctx, "security.put_user", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.put_user") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutUser query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutUser query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a putuser.Response -func (r PutUser) Do(ctx context.Context) (*Response, error) { +func (r PutUser) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.put_user") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -218,6 +273,9 @@ func (r PutUser) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -227,6 +285,9 @@ func (r PutUser) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -234,6 +295,9 @@ func (r PutUser) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putuser/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putuser/request.go index 750e76e18..13971ca12 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putuser/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putuser/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putuser @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package putuser // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/put_user/SecurityPutUserRequest.ts#L23-L44 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/put_user/SecurityPutUserRequest.ts#L23-L44 type Request struct { Email string `json:"email,omitempty"` Enabled *bool `json:"enabled,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putuser/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putuser/response.go index 5a2222be4..586d765a2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putuser/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/putuser/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putuser // Response holds the response body struct for the package putuser // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/put_user/SecurityPutUserResponse.ts#L20-L22 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/put_user/SecurityPutUserResponse.ts#L20-L22 type Response struct { Created bool `json:"created"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/queryapikeys/query_api_keys.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/queryapikeys/query_api_keys.go index 21492342a..27f49aa1d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/queryapikeys/query_api_keys.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/queryapikeys/query_api_keys.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves information for API keys using a subset of query DSL package queryapikeys @@ -47,13 +47,17 @@ type QueryApiKeys struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewQueryApiKeys type alias for index. @@ -77,11 +81,18 @@ func New(tp elastictransport.Interface) *QueryApiKeys { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -118,9 +129,7 @@ func (r *QueryApiKeys) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -132,6 +141,10 @@ func (r *QueryApiKeys) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -154,15 +167,15 @@ func (r *QueryApiKeys) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -179,27 +192,66 @@ func (r *QueryApiKeys) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r QueryApiKeys) Perform(ctx context.Context) (*http.Response, error) { +func (r QueryApiKeys) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.query_api_keys") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.query_api_keys") + if reader := instrument.RecordRequestBody(ctx, "security.query_api_keys", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.query_api_keys") + } if err != nil { - return nil, fmt.Errorf("an error happened during the QueryApiKeys query execution: %w", err) + localErr := fmt.Errorf("an error happened during the QueryApiKeys query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a queryapikeys.Response -func (r QueryApiKeys) Do(ctx context.Context) (*Response, error) { +func (r QueryApiKeys) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.query_api_keys") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -207,6 +259,9 @@ func (r QueryApiKeys) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -216,6 +271,9 @@ func (r QueryApiKeys) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -223,6 +281,9 @@ func (r QueryApiKeys) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/queryapikeys/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/queryapikeys/request.go index 9e92b1e44..b98892dd1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/queryapikeys/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/queryapikeys/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package queryapikeys @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package queryapikeys // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/query_api_keys/QueryApiKeysRequest.ts#L25-L74 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/query_api_keys/QueryApiKeysRequest.ts#L25-L74 type Request struct { // From Starting document offset. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/queryapikeys/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/queryapikeys/response.go index fd0318490..7bd3182e8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/queryapikeys/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/queryapikeys/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package queryapikeys @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package queryapikeys // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/query_api_keys/QueryApiKeysResponse.ts#L23-L38 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/query_api_keys/QueryApiKeysResponse.ts#L23-L38 type Response struct { // ApiKeys A list of API key information. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlauthenticate/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlauthenticate/request.go index d6835905d..cf86577e9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlauthenticate/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlauthenticate/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package samlauthenticate @@ -27,7 +27,7 @@ import ( // Request holds the request body struct for the package samlauthenticate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/saml_authenticate/Request.ts#L23-L38 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/saml_authenticate/Request.ts#L23-L38 type Request struct { // Content The SAML response as it was sent by the user’s browser, usually a Base64 diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlauthenticate/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlauthenticate/response.go index c58a5af07..8c878f895 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlauthenticate/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlauthenticate/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package samlauthenticate // Response holds the response body struct for the package samlauthenticate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/saml_authenticate/Response.ts#L22-L30 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/saml_authenticate/Response.ts#L22-L30 type Response struct { AccessToken string `json:"access_token"` ExpiresIn int `json:"expires_in"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlauthenticate/saml_authenticate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlauthenticate/saml_authenticate.go index d30f2182e..0226fa2b5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlauthenticate/saml_authenticate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlauthenticate/saml_authenticate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Exchanges a SAML Response message for an Elasticsearch access token and // refresh token pair @@ -47,13 +47,17 @@ type SamlAuthenticate struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewSamlAuthenticate type alias for index. @@ -78,11 +82,18 @@ func New(tp elastictransport.Interface) *SamlAuthenticate { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -119,9 +130,7 @@ func (r *SamlAuthenticate) HttpRequest(ctx context.Context) (*http.Request, erro } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -133,6 +142,10 @@ func (r *SamlAuthenticate) HttpRequest(ctx context.Context) (*http.Request, erro } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -155,15 +168,15 @@ func (r *SamlAuthenticate) HttpRequest(ctx context.Context) (*http.Request, erro } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -180,27 +193,66 @@ func (r *SamlAuthenticate) HttpRequest(ctx context.Context) (*http.Request, erro } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r SamlAuthenticate) Perform(ctx context.Context) (*http.Response, error) { +func (r SamlAuthenticate) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.saml_authenticate") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.saml_authenticate") + if reader := instrument.RecordRequestBody(ctx, "security.saml_authenticate", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.saml_authenticate") + } if err != nil { - return nil, fmt.Errorf("an error happened during the SamlAuthenticate query execution: %w", err) + localErr := fmt.Errorf("an error happened during the SamlAuthenticate query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a samlauthenticate.Response -func (r SamlAuthenticate) Do(ctx context.Context) (*Response, error) { +func (r SamlAuthenticate) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.saml_authenticate") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -208,6 +260,9 @@ func (r SamlAuthenticate) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -217,6 +272,9 @@ func (r SamlAuthenticate) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -224,6 +282,9 @@ func (r SamlAuthenticate) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlcompletelogout/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlcompletelogout/request.go index 8aad38412..be877ac1e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlcompletelogout/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlcompletelogout/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package samlcompletelogout @@ -27,7 +27,7 @@ import ( // Request holds the request body struct for the package samlcompletelogout // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/saml_complete_logout/Request.ts#L23-L40 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/saml_complete_logout/Request.ts#L23-L40 type Request struct { // Content If the SAML IdP sends the logout response with the HTTP-Post binding, this diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlcompletelogout/saml_complete_logout.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlcompletelogout/saml_complete_logout.go index 1c2583649..099ac0487 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlcompletelogout/saml_complete_logout.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlcompletelogout/saml_complete_logout.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Verifies the logout response sent from the SAML IdP package samlcompletelogout @@ -45,13 +45,17 @@ type SamlCompleteLogout struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewSamlCompleteLogout type alias for index. @@ -75,11 +79,18 @@ func New(tp elastictransport.Interface) *SamlCompleteLogout { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -116,9 +127,7 @@ func (r *SamlCompleteLogout) HttpRequest(ctx context.Context) (*http.Request, er } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -130,6 +139,10 @@ func (r *SamlCompleteLogout) HttpRequest(ctx context.Context) (*http.Request, er } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -152,15 +165,15 @@ func (r *SamlCompleteLogout) HttpRequest(ctx context.Context) (*http.Request, er } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -177,15 +190,42 @@ func (r *SamlCompleteLogout) HttpRequest(ctx context.Context) (*http.Request, er } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r SamlCompleteLogout) Perform(ctx context.Context) (*http.Response, error) { +func (r SamlCompleteLogout) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.saml_complete_logout") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.saml_complete_logout") + if reader := instrument.RecordRequestBody(ctx, "security.saml_complete_logout", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.saml_complete_logout") + } if err != nil { - return nil, fmt.Errorf("an error happened during the SamlCompleteLogout query execution: %w", err) + localErr := fmt.Errorf("an error happened during the SamlCompleteLogout query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlinvalidate/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlinvalidate/request.go index 81aa69cb8..9dc6eba01 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlinvalidate/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlinvalidate/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package samlinvalidate @@ -27,7 +27,7 @@ import ( // Request holds the request body struct for the package samlinvalidate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/saml_invalidate/Request.ts#L22-L43 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/saml_invalidate/Request.ts#L22-L43 type Request struct { // Acs The Assertion Consumer Service URL that matches the one of the SAML realm in diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlinvalidate/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlinvalidate/response.go index 841dc0b93..3916418eb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlinvalidate/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlinvalidate/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package samlinvalidate // Response holds the response body struct for the package samlinvalidate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/saml_invalidate/Response.ts#L22-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/saml_invalidate/Response.ts#L22-L28 type Response struct { Invalidated int `json:"invalidated"` Realm string `json:"realm"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlinvalidate/saml_invalidate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlinvalidate/saml_invalidate.go index 1d0d07ea2..7305d4342 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlinvalidate/saml_invalidate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlinvalidate/saml_invalidate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Consumes a SAML LogoutRequest package samlinvalidate @@ -46,13 +46,17 @@ type SamlInvalidate struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewSamlInvalidate type alias for index. @@ -76,11 +80,18 @@ func New(tp elastictransport.Interface) *SamlInvalidate { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -117,9 +128,7 @@ func (r *SamlInvalidate) HttpRequest(ctx context.Context) (*http.Request, error) } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -131,6 +140,10 @@ func (r *SamlInvalidate) HttpRequest(ctx context.Context) (*http.Request, error) } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -153,15 +166,15 @@ func (r *SamlInvalidate) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -178,27 +191,66 @@ func (r *SamlInvalidate) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r SamlInvalidate) Perform(ctx context.Context) (*http.Response, error) { +func (r SamlInvalidate) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.saml_invalidate") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.saml_invalidate") + if reader := instrument.RecordRequestBody(ctx, "security.saml_invalidate", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.saml_invalidate") + } if err != nil { - return nil, fmt.Errorf("an error happened during the SamlInvalidate query execution: %w", err) + localErr := fmt.Errorf("an error happened during the SamlInvalidate query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a samlinvalidate.Response -func (r SamlInvalidate) Do(ctx context.Context) (*Response, error) { +func (r SamlInvalidate) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.saml_invalidate") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -206,6 +258,9 @@ func (r SamlInvalidate) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -215,6 +270,9 @@ func (r SamlInvalidate) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -222,6 +280,9 @@ func (r SamlInvalidate) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samllogout/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samllogout/request.go index 3a1879ed8..7e8dccfa7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samllogout/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samllogout/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package samllogout @@ -27,7 +27,7 @@ import ( // Request holds the request body struct for the package samllogout // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/saml_logout/Request.ts#L22-L41 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/saml_logout/Request.ts#L22-L41 type Request struct { // RefreshToken The refresh token that was returned as a response to calling the SAML diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samllogout/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samllogout/response.go index c717e8311..52792a7ca 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samllogout/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samllogout/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package samllogout // Response holds the response body struct for the package samllogout // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/saml_logout/Response.ts#L20-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/saml_logout/Response.ts#L20-L24 type Response struct { Redirect string `json:"redirect"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samllogout/saml_logout.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samllogout/saml_logout.go index e4a8674d1..4dd441007 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samllogout/saml_logout.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samllogout/saml_logout.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Invalidates an access token and a refresh token that were generated via the // SAML Authenticate API @@ -47,13 +47,17 @@ type SamlLogout struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewSamlLogout type alias for index. @@ -78,11 +82,18 @@ func New(tp elastictransport.Interface) *SamlLogout { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -119,9 +130,7 @@ func (r *SamlLogout) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -133,6 +142,10 @@ func (r *SamlLogout) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -155,15 +168,15 @@ func (r *SamlLogout) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -180,27 +193,66 @@ func (r *SamlLogout) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r SamlLogout) Perform(ctx context.Context) (*http.Response, error) { +func (r SamlLogout) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.saml_logout") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.saml_logout") + if reader := instrument.RecordRequestBody(ctx, "security.saml_logout", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.saml_logout") + } if err != nil { - return nil, fmt.Errorf("an error happened during the SamlLogout query execution: %w", err) + localErr := fmt.Errorf("an error happened during the SamlLogout query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a samllogout.Response -func (r SamlLogout) Do(ctx context.Context) (*Response, error) { +func (r SamlLogout) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.saml_logout") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -208,6 +260,9 @@ func (r SamlLogout) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -217,6 +272,9 @@ func (r SamlLogout) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -224,6 +282,9 @@ func (r SamlLogout) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlprepareauthentication/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlprepareauthentication/request.go index 184110c17..2ebd6faf7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlprepareauthentication/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlprepareauthentication/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package samlprepareauthentication @@ -27,7 +27,7 @@ import ( // Request holds the request body struct for the package samlprepareauthentication // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/saml_prepare_authentication/Request.ts#L22-L46 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/saml_prepare_authentication/Request.ts#L22-L46 type Request struct { // Acs The Assertion Consumer Service URL that matches the one of the SAML realms in diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlprepareauthentication/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlprepareauthentication/response.go index 6c1e326d1..925e5b9c0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlprepareauthentication/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlprepareauthentication/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package samlprepareauthentication // Response holds the response body struct for the package samlprepareauthentication // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/saml_prepare_authentication/Response.ts#L22-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/saml_prepare_authentication/Response.ts#L22-L28 type Response struct { Id string `json:"id"` Realm string `json:"realm"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlprepareauthentication/saml_prepare_authentication.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlprepareauthentication/saml_prepare_authentication.go index 0bd57f017..a1f474143 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlprepareauthentication/saml_prepare_authentication.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlprepareauthentication/saml_prepare_authentication.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates a SAML authentication request package samlprepareauthentication @@ -46,13 +46,17 @@ type SamlPrepareAuthentication struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewSamlPrepareAuthentication type alias for index. @@ -76,11 +80,18 @@ func New(tp elastictransport.Interface) *SamlPrepareAuthentication { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -117,9 +128,7 @@ func (r *SamlPrepareAuthentication) HttpRequest(ctx context.Context) (*http.Requ } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -131,6 +140,10 @@ func (r *SamlPrepareAuthentication) HttpRequest(ctx context.Context) (*http.Requ } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -153,15 +166,15 @@ func (r *SamlPrepareAuthentication) HttpRequest(ctx context.Context) (*http.Requ } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -178,27 +191,66 @@ func (r *SamlPrepareAuthentication) HttpRequest(ctx context.Context) (*http.Requ } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r SamlPrepareAuthentication) Perform(ctx context.Context) (*http.Response, error) { +func (r SamlPrepareAuthentication) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.saml_prepare_authentication") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.saml_prepare_authentication") + if reader := instrument.RecordRequestBody(ctx, "security.saml_prepare_authentication", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.saml_prepare_authentication") + } if err != nil { - return nil, fmt.Errorf("an error happened during the SamlPrepareAuthentication query execution: %w", err) + localErr := fmt.Errorf("an error happened during the SamlPrepareAuthentication query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a samlprepareauthentication.Response -func (r SamlPrepareAuthentication) Do(ctx context.Context) (*Response, error) { +func (r SamlPrepareAuthentication) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.saml_prepare_authentication") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -206,6 +258,9 @@ func (r SamlPrepareAuthentication) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -215,6 +270,9 @@ func (r SamlPrepareAuthentication) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -222,6 +280,9 @@ func (r SamlPrepareAuthentication) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlserviceprovidermetadata/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlserviceprovidermetadata/response.go index 07a1e132b..7350119a3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlserviceprovidermetadata/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlserviceprovidermetadata/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package samlserviceprovidermetadata // Response holds the response body struct for the package samlserviceprovidermetadata // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/saml_service_provider_metadata/Response.ts#L20-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/saml_service_provider_metadata/Response.ts#L20-L24 type Response struct { Metadata string `json:"metadata"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlserviceprovidermetadata/saml_service_provider_metadata.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlserviceprovidermetadata/saml_service_provider_metadata.go index 4d428a4aa..db6899e0d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlserviceprovidermetadata/saml_service_provider_metadata.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/samlserviceprovidermetadata/saml_service_provider_metadata.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Generates SAML metadata for the Elastic stack SAML 2.0 Service Provider package samlserviceprovidermetadata import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type SamlServiceProviderMetadata struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int realmname string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewSamlServiceProviderMetadata type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *SamlServiceProviderMetadata { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,6 +116,9 @@ func (r *SamlServiceProviderMetadata) HttpRequest(ctx context.Context) (*http.Re path.WriteString("metadata") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "realmname", r.realmname) + } path.WriteString(r.realmname) method = http.MethodGet @@ -121,15 +132,15 @@ func (r *SamlServiceProviderMetadata) HttpRequest(ctx context.Context) (*http.Re } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -146,27 +157,66 @@ func (r *SamlServiceProviderMetadata) HttpRequest(ctx context.Context) (*http.Re } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r SamlServiceProviderMetadata) Perform(ctx context.Context) (*http.Response, error) { +func (r SamlServiceProviderMetadata) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.saml_service_provider_metadata") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.saml_service_provider_metadata") + if reader := instrument.RecordRequestBody(ctx, "security.saml_service_provider_metadata", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.saml_service_provider_metadata") + } if err != nil { - return nil, fmt.Errorf("an error happened during the SamlServiceProviderMetadata query execution: %w", err) + localErr := fmt.Errorf("an error happened during the SamlServiceProviderMetadata query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a samlserviceprovidermetadata.Response -func (r SamlServiceProviderMetadata) Do(ctx context.Context) (*Response, error) { +func (r SamlServiceProviderMetadata) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.saml_service_provider_metadata") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -174,6 +224,9 @@ func (r SamlServiceProviderMetadata) Do(ctx context.Context) (*Response, error) if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -183,6 +236,9 @@ func (r SamlServiceProviderMetadata) Do(ctx context.Context) (*Response, error) errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -190,12 +246,25 @@ func (r SamlServiceProviderMetadata) Do(ctx context.Context) (*Response, error) errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r SamlServiceProviderMetadata) IsSuccess(ctx context.Context) (bool, error) { +func (r SamlServiceProviderMetadata) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.saml_service_provider_metadata") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -211,6 +280,14 @@ func (r SamlServiceProviderMetadata) IsSuccess(ctx context.Context) (bool, error return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the SamlServiceProviderMetadata query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/suggestuserprofiles/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/suggestuserprofiles/request.go index a9a9667fe..c9e1f571f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/suggestuserprofiles/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/suggestuserprofiles/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package suggestuserprofiles @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package suggestuserprofiles // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/suggest_user_profiles/Request.ts#L24-L66 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/suggest_user_profiles/Request.ts#L24-L66 type Request struct { // Data List of filters for the `data` field of the profile document. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/suggestuserprofiles/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/suggestuserprofiles/response.go index 1d7adfd1e..e55737c3e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/suggestuserprofiles/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/suggestuserprofiles/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package suggestuserprofiles @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package suggestuserprofiles // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/suggest_user_profiles/Response.ts#L29-L35 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/suggest_user_profiles/Response.ts#L29-L35 type Response struct { Profiles []types.UserProfile `json:"profiles"` Took int64 `json:"took"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/suggestuserprofiles/suggest_user_profiles.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/suggestuserprofiles/suggest_user_profiles.go index 84bf1dfac..6faf616a1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/suggestuserprofiles/suggest_user_profiles.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/suggestuserprofiles/suggest_user_profiles.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Get suggestions for user profiles that match specified search criteria. package suggestuserprofiles @@ -46,13 +46,17 @@ type SuggestUserProfiles struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewSuggestUserProfiles type alias for index. @@ -76,11 +80,18 @@ func New(tp elastictransport.Interface) *SuggestUserProfiles { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -117,9 +128,7 @@ func (r *SuggestUserProfiles) HttpRequest(ctx context.Context) (*http.Request, e } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -131,6 +140,10 @@ func (r *SuggestUserProfiles) HttpRequest(ctx context.Context) (*http.Request, e } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -153,15 +166,15 @@ func (r *SuggestUserProfiles) HttpRequest(ctx context.Context) (*http.Request, e } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -178,27 +191,66 @@ func (r *SuggestUserProfiles) HttpRequest(ctx context.Context) (*http.Request, e } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r SuggestUserProfiles) Perform(ctx context.Context) (*http.Response, error) { +func (r SuggestUserProfiles) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.suggest_user_profiles") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.suggest_user_profiles") + if reader := instrument.RecordRequestBody(ctx, "security.suggest_user_profiles", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.suggest_user_profiles") + } if err != nil { - return nil, fmt.Errorf("an error happened during the SuggestUserProfiles query execution: %w", err) + localErr := fmt.Errorf("an error happened during the SuggestUserProfiles query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a suggestuserprofiles.Response -func (r SuggestUserProfiles) Do(ctx context.Context) (*Response, error) { +func (r SuggestUserProfiles) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.suggest_user_profiles") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -206,6 +258,9 @@ func (r SuggestUserProfiles) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -215,6 +270,9 @@ func (r SuggestUserProfiles) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -222,6 +280,9 @@ func (r SuggestUserProfiles) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/updateapikey/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/updateapikey/request.go index 902f600f6..6045c58b2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/updateapikey/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/updateapikey/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package updateapikey @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package updateapikey // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/update_api_key/Request.ts#L25-L62 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/update_api_key/Request.ts#L25-L62 type Request struct { // Metadata Arbitrary metadata that you want to associate with the API key. It supports diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/updateapikey/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/updateapikey/response.go index b5dc76512..69da7fe6b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/updateapikey/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/updateapikey/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package updateapikey // Response holds the response body struct for the package updateapikey // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/update_api_key/Response.ts#L20-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/update_api_key/Response.ts#L20-L28 type Response struct { // Updated If `true`, the API key was updated. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/updateapikey/update_api_key.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/updateapikey/update_api_key.go index 92a626248..ecc1ce1ce 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/updateapikey/update_api_key.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/updateapikey/update_api_key.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Updates attributes of an existing API key. package updateapikey @@ -50,15 +50,19 @@ type UpdateApiKey struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewUpdateApiKey type alias for index. @@ -84,11 +88,18 @@ func New(tp elastictransport.Interface) *UpdateApiKey { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -125,9 +136,7 @@ func (r *UpdateApiKey) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -139,6 +148,10 @@ func (r *UpdateApiKey) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -149,6 +162,9 @@ func (r *UpdateApiKey) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("api_key") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodPut @@ -162,15 +178,15 @@ func (r *UpdateApiKey) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -187,27 +203,66 @@ func (r *UpdateApiKey) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r UpdateApiKey) Perform(ctx context.Context) (*http.Response, error) { +func (r UpdateApiKey) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.update_api_key") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.update_api_key") + if reader := instrument.RecordRequestBody(ctx, "security.update_api_key", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.update_api_key") + } if err != nil { - return nil, fmt.Errorf("an error happened during the UpdateApiKey query execution: %w", err) + localErr := fmt.Errorf("an error happened during the UpdateApiKey query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a updateapikey.Response -func (r UpdateApiKey) Do(ctx context.Context) (*Response, error) { +func (r UpdateApiKey) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.update_api_key") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -215,6 +270,9 @@ func (r UpdateApiKey) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -224,6 +282,9 @@ func (r UpdateApiKey) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -231,6 +292,9 @@ func (r UpdateApiKey) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/updatesettings/update_settings.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/updatesettings/update_settings.go new file mode 100644 index 000000000..0a0b79963 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/updatesettings/update_settings.go @@ -0,0 +1,232 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated from the elasticsearch-specification DO NOT EDIT. +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c + +// Update settings for the security system index +package updatesettings + +import ( + "context" + "errors" + "fmt" + "io" + "io/ioutil" + "net/http" + "net/url" + "strings" + + "github.com/elastic/elastic-transport-go/v8/elastictransport" +) + +// ErrBuildPath is returned in case of missing parameters within the build of the request. +var ErrBuildPath = errors.New("cannot build path, check for missing path parameters") + +type UpdateSettings struct { + transport elastictransport.Interface + + headers http.Header + values url.Values + path url.URL + + raw io.Reader + + paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation +} + +// NewUpdateSettings type alias for index. +type NewUpdateSettings func() *UpdateSettings + +// NewUpdateSettingsFunc returns a new instance of UpdateSettings with the provided transport. +// Used in the index of the library this allows to retrieve every apis in once place. +func NewUpdateSettingsFunc(tp elastictransport.Interface) NewUpdateSettings { + return func() *UpdateSettings { + n := New(tp) + + return n + } +} + +// Update settings for the security system index +// +// https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-settings.html +func New(tp elastictransport.Interface) *UpdateSettings { + r := &UpdateSettings{ + transport: tp, + values: make(url.Values), + headers: make(http.Header), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + + return r +} + +// HttpRequest returns the http.Request object built from the +// given parameters. +func (r *UpdateSettings) HttpRequest(ctx context.Context) (*http.Request, error) { + var path strings.Builder + var method string + var req *http.Request + + var err error + + r.path.Scheme = "http" + + switch { + case r.paramSet == 0: + path.WriteString("/") + path.WriteString("_security") + path.WriteString("/") + path.WriteString("settings") + + method = http.MethodPut + } + + r.path.Path = path.String() + r.path.RawQuery = r.values.Encode() + + if r.path.Path == "" { + return nil, ErrBuildPath + } + + if ctx != nil { + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) + } else { + req, err = http.NewRequest(method, r.path.String(), r.raw) + } + + req.Header = r.headers.Clone() + + if req.Header.Get("Content-Type") == "" { + if r.raw != nil { + req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") + } + } + + if req.Header.Get("Accept") == "" { + req.Header.Set("Accept", "application/vnd.elasticsearch+json;compatible-with=8") + } + + if err != nil { + return req, fmt.Errorf("could not build http.Request: %w", err) + } + + return req, nil +} + +// Perform runs the http.Request through the provided transport and returns an http.Response. +func (r UpdateSettings) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.update_settings") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + + req, err := r.HttpRequest(ctx) + if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.update_settings") + if reader := instrument.RecordRequestBody(ctx, "security.update_settings", r.raw); reader != nil { + req.Body = reader + } + } + res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.update_settings") + } + if err != nil { + localErr := fmt.Errorf("an error happened during the UpdateSettings query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr + } + + return res, nil +} + +// Do runs the request through the transport, handle the response and returns a updatesettings.Response +func (r UpdateSettings) Do(ctx context.Context) (bool, error) { + return r.IsSuccess(ctx) +} + +// IsSuccess allows to run a query with a context and retrieve the result as a boolean. +// This only exists for endpoints without a request payload and allows for quick control flow. +func (r UpdateSettings) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.update_settings") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + res, err := r.Perform(ctx) + + if err != nil { + return false, err + } + io.Copy(ioutil.Discard, res.Body) + err = res.Body.Close() + if err != nil { + return false, err + } + + if res.StatusCode >= 200 && res.StatusCode < 300 { + return true, nil + } + + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the UpdateSettings query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + + return false, nil +} + +// Header set a key, value pair in the UpdateSettings headers map. +func (r *UpdateSettings) Header(key, value string) *UpdateSettings { + r.headers.Set(key, value) + + return r +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/updateuserprofiledata/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/updateuserprofiledata/request.go index ddb39987e..d4028a5ad 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/updateuserprofiledata/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/updateuserprofiledata/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package updateuserprofiledata @@ -27,7 +27,7 @@ import ( // Request holds the request body struct for the package updateuserprofiledata // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/update_user_profile_data/Request.ts#L27-L70 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/update_user_profile_data/Request.ts#L27-L70 type Request struct { // Data Non-searchable data that you want to associate with the user profile. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/updateuserprofiledata/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/updateuserprofiledata/response.go index 06934fae7..f776119e7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/updateuserprofiledata/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/updateuserprofiledata/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package updateuserprofiledata // Response holds the response body struct for the package updateuserprofiledata // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/update_user_profile_data/Response.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/update_user_profile_data/Response.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/updateuserprofiledata/update_user_profile_data.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/updateuserprofiledata/update_user_profile_data.go index b3051a8d0..b391c9c0f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/updateuserprofiledata/update_user_profile_data.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/security/updateuserprofiledata/update_user_profile_data.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Update application specific data for the user profile of the given unique ID. package updateuserprofiledata @@ -51,15 +51,19 @@ type UpdateUserProfileData struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int uid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewUpdateUserProfileData type alias for index. @@ -85,11 +89,18 @@ func New(tp elastictransport.Interface) *UpdateUserProfileData { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -126,9 +137,7 @@ func (r *UpdateUserProfileData) HttpRequest(ctx context.Context) (*http.Request, } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -140,6 +149,10 @@ func (r *UpdateUserProfileData) HttpRequest(ctx context.Context) (*http.Request, } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -150,6 +163,9 @@ func (r *UpdateUserProfileData) HttpRequest(ctx context.Context) (*http.Request, path.WriteString("profile") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "uid", r.uid) + } path.WriteString(r.uid) path.WriteString("/") path.WriteString("_data") @@ -165,15 +181,15 @@ func (r *UpdateUserProfileData) HttpRequest(ctx context.Context) (*http.Request, } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -190,27 +206,66 @@ func (r *UpdateUserProfileData) HttpRequest(ctx context.Context) (*http.Request, } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r UpdateUserProfileData) Perform(ctx context.Context) (*http.Response, error) { +func (r UpdateUserProfileData) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "security.update_user_profile_data") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "security.update_user_profile_data") + if reader := instrument.RecordRequestBody(ctx, "security.update_user_profile_data", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "security.update_user_profile_data") + } if err != nil { - return nil, fmt.Errorf("an error happened during the UpdateUserProfileData query execution: %w", err) + localErr := fmt.Errorf("an error happened during the UpdateUserProfileData query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a updateuserprofiledata.Response -func (r UpdateUserProfileData) Do(ctx context.Context) (*Response, error) { +func (r UpdateUserProfileData) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "security.update_user_profile_data") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -218,6 +273,9 @@ func (r UpdateUserProfileData) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -227,6 +285,9 @@ func (r UpdateUserProfileData) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -234,6 +295,9 @@ func (r UpdateUserProfileData) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/shutdown/deletenode/delete_node.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/shutdown/deletenode/delete_node.go index 02890617a..1696044a3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/shutdown/deletenode/delete_node.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/shutdown/deletenode/delete_node.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Removes a node from the shutdown list. Designed for indirect use by ECE/ESS // and ECK. Direct use is not supported. package deletenode import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,11 +52,15 @@ type DeleteNode struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int nodeid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteNode type alias for index. @@ -84,7 +87,12 @@ func New(tp elastictransport.Interface) *DeleteNode { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -107,6 +115,9 @@ func (r *DeleteNode) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_nodes") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "nodeid", r.nodeid) + } path.WriteString(r.nodeid) path.WriteString("/") path.WriteString("shutdown") @@ -122,15 +133,15 @@ func (r *DeleteNode) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -147,27 +158,66 @@ func (r *DeleteNode) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteNode) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteNode) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "shutdown.delete_node") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "shutdown.delete_node") + if reader := instrument.RecordRequestBody(ctx, "shutdown.delete_node", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "shutdown.delete_node") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteNode query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteNode query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deletenode.Response -func (r DeleteNode) Do(ctx context.Context) (*Response, error) { +func (r DeleteNode) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "shutdown.delete_node") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -175,6 +225,9 @@ func (r DeleteNode) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,6 +237,9 @@ func (r DeleteNode) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -191,12 +247,25 @@ func (r DeleteNode) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteNode) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteNode) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "shutdown.delete_node") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -212,6 +281,14 @@ func (r DeleteNode) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteNode query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/shutdown/deletenode/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/shutdown/deletenode/response.go index 9dfe75fdd..dae1da96f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/shutdown/deletenode/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/shutdown/deletenode/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deletenode // Response holds the response body struct for the package deletenode // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/shutdown/delete_node/ShutdownDeleteNodeResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/shutdown/delete_node/ShutdownDeleteNodeResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/shutdown/getnode/get_node.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/shutdown/getnode/get_node.go index d72205dbf..81de32857 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/shutdown/getnode/get_node.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/shutdown/getnode/get_node.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieve status of a node or nodes that are currently marked as shutting // down. Designed for indirect use by ECE/ESS and ECK. Direct use is not @@ -24,7 +24,6 @@ package getnode import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -54,11 +53,15 @@ type GetNode struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int nodeid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetNode type alias for index. @@ -84,7 +87,12 @@ func New(tp elastictransport.Interface) *GetNode { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -114,6 +122,9 @@ func (r *GetNode) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_nodes") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "nodeid", r.nodeid) + } path.WriteString(r.nodeid) path.WriteString("/") path.WriteString("shutdown") @@ -129,15 +140,15 @@ func (r *GetNode) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -154,27 +165,66 @@ func (r *GetNode) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetNode) Perform(ctx context.Context) (*http.Response, error) { +func (r GetNode) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "shutdown.get_node") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "shutdown.get_node") + if reader := instrument.RecordRequestBody(ctx, "shutdown.get_node", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "shutdown.get_node") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetNode query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetNode query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getnode.Response -func (r GetNode) Do(ctx context.Context) (*Response, error) { +func (r GetNode) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "shutdown.get_node") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -182,6 +232,9 @@ func (r GetNode) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -191,6 +244,9 @@ func (r GetNode) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -198,12 +254,25 @@ func (r GetNode) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetNode) IsSuccess(ctx context.Context) (bool, error) { +func (r GetNode) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "shutdown.get_node") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -219,6 +288,14 @@ func (r GetNode) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetNode query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/shutdown/getnode/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/shutdown/getnode/response.go index 16c49c9d9..bc09ef96d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/shutdown/getnode/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/shutdown/getnode/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getnode @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getnode // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/shutdown/get_node/ShutdownGetNodeResponse.ts#L23-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/shutdown/get_node/ShutdownGetNodeResponse.ts#L23-L27 type Response struct { Nodes []types.NodeShutdownStatus `json:"nodes"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/shutdown/putnode/put_node.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/shutdown/putnode/put_node.go index 628e122b2..ee68c3b4c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/shutdown/putnode/put_node.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/shutdown/putnode/put_node.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Adds a node to be shut down. Designed for indirect use by ECE/ESS and ECK. // Direct use is not supported. @@ -53,15 +53,19 @@ type PutNode struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int nodeid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutNode type alias for index. @@ -88,11 +92,18 @@ func New(tp elastictransport.Interface) *PutNode { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -129,9 +140,7 @@ func (r *PutNode) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -143,6 +152,10 @@ func (r *PutNode) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -151,6 +164,9 @@ func (r *PutNode) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_nodes") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "nodeid", r.nodeid) + } path.WriteString(r.nodeid) path.WriteString("/") path.WriteString("shutdown") @@ -166,15 +182,15 @@ func (r *PutNode) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -191,27 +207,66 @@ func (r *PutNode) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutNode) Perform(ctx context.Context) (*http.Response, error) { +func (r PutNode) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "shutdown.put_node") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "shutdown.put_node") + if reader := instrument.RecordRequestBody(ctx, "shutdown.put_node", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "shutdown.put_node") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutNode query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutNode query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a putnode.Response -func (r PutNode) Do(ctx context.Context) (*Response, error) { +func (r PutNode) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "shutdown.put_node") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -219,6 +274,9 @@ func (r PutNode) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -228,6 +286,9 @@ func (r PutNode) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -235,6 +296,9 @@ func (r PutNode) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/shutdown/putnode/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/shutdown/putnode/request.go index 7acbe7ecd..b59325a4b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/shutdown/putnode/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/shutdown/putnode/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putnode @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package putnode // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/shutdown/put_node/ShutdownPutNodeRequest.ts#L25-L76 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/shutdown/put_node/ShutdownPutNodeRequest.ts#L25-L76 type Request struct { // AllocationDelay Only valid if type is restart. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/shutdown/putnode/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/shutdown/putnode/response.go index f5e82c663..9e225b73d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/shutdown/putnode/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/shutdown/putnode/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putnode // Response holds the response body struct for the package putnode // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/shutdown/put_node/ShutdownPutNodeResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/shutdown/put_node/ShutdownPutNodeResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/deletelifecycle/delete_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/deletelifecycle/delete_lifecycle.go index 37dd4f666..211489bf7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/deletelifecycle/delete_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/deletelifecycle/delete_lifecycle.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes an existing snapshot lifecycle policy. package deletelifecycle import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type DeleteLifecycle struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int policyid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteLifecycle type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *DeleteLifecycle { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *DeleteLifecycle) HttpRequest(ctx context.Context) (*http.Request, error path.WriteString("policy") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "policyid", r.policyid) + } path.WriteString(r.policyid) method = http.MethodDelete @@ -119,9 +130,9 @@ func (r *DeleteLifecycle) HttpRequest(ctx context.Context) (*http.Request, error } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -138,27 +149,66 @@ func (r *DeleteLifecycle) HttpRequest(ctx context.Context) (*http.Request, error } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteLifecycle) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteLifecycle) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "slm.delete_lifecycle") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "slm.delete_lifecycle") + if reader := instrument.RecordRequestBody(ctx, "slm.delete_lifecycle", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "slm.delete_lifecycle") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteLifecycle query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteLifecycle query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deletelifecycle.Response -func (r DeleteLifecycle) Do(ctx context.Context) (*Response, error) { +func (r DeleteLifecycle) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "slm.delete_lifecycle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -166,6 +216,9 @@ func (r DeleteLifecycle) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,6 +228,9 @@ func (r DeleteLifecycle) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,12 +238,25 @@ func (r DeleteLifecycle) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteLifecycle) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteLifecycle) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "slm.delete_lifecycle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -203,6 +272,14 @@ func (r DeleteLifecycle) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteLifecycle query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/deletelifecycle/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/deletelifecycle/response.go index dffb8aee6..6420e0ffd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/deletelifecycle/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/deletelifecycle/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deletelifecycle // Response holds the response body struct for the package deletelifecycle // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/slm/delete_lifecycle/DeleteSnapshotLifecycleResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/slm/delete_lifecycle/DeleteSnapshotLifecycleResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/executelifecycle/execute_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/executelifecycle/execute_lifecycle.go index 01fef9af6..e26ee71e5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/executelifecycle/execute_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/executelifecycle/execute_lifecycle.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Immediately creates a snapshot according to the lifecycle policy, without // waiting for the scheduled time. package executelifecycle import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type ExecuteLifecycle struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int policyid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewExecuteLifecycle type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *ExecuteLifecycle { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,6 +116,9 @@ func (r *ExecuteLifecycle) HttpRequest(ctx context.Context) (*http.Request, erro path.WriteString("policy") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "policyid", r.policyid) + } path.WriteString(r.policyid) path.WriteString("/") path.WriteString("_execute") @@ -123,9 +134,9 @@ func (r *ExecuteLifecycle) HttpRequest(ctx context.Context) (*http.Request, erro } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -142,27 +153,66 @@ func (r *ExecuteLifecycle) HttpRequest(ctx context.Context) (*http.Request, erro } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ExecuteLifecycle) Perform(ctx context.Context) (*http.Response, error) { +func (r ExecuteLifecycle) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "slm.execute_lifecycle") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "slm.execute_lifecycle") + if reader := instrument.RecordRequestBody(ctx, "slm.execute_lifecycle", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "slm.execute_lifecycle") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ExecuteLifecycle query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ExecuteLifecycle query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a executelifecycle.Response -func (r ExecuteLifecycle) Do(ctx context.Context) (*Response, error) { +func (r ExecuteLifecycle) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "slm.execute_lifecycle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -170,6 +220,9 @@ func (r ExecuteLifecycle) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -179,6 +232,9 @@ func (r ExecuteLifecycle) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -186,12 +242,25 @@ func (r ExecuteLifecycle) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ExecuteLifecycle) IsSuccess(ctx context.Context) (bool, error) { +func (r ExecuteLifecycle) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "slm.execute_lifecycle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -207,6 +276,14 @@ func (r ExecuteLifecycle) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ExecuteLifecycle query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/executelifecycle/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/executelifecycle/response.go index a79f04554..69a8ca7e3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/executelifecycle/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/executelifecycle/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package executelifecycle // Response holds the response body struct for the package executelifecycle // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/slm/execute_lifecycle/ExecuteSnapshotLifecycleResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/slm/execute_lifecycle/ExecuteSnapshotLifecycleResponse.ts#L22-L24 type Response struct { SnapshotName string `json:"snapshot_name"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/executeretention/execute_retention.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/executeretention/execute_retention.go index 0f28f140d..78105e221 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/executeretention/execute_retention.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/executeretention/execute_retention.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes any snapshots that are expired according to the policy's retention // rules. package executeretention import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -48,9 +47,13 @@ type ExecuteRetention struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewExecuteRetention type alias for index. @@ -75,7 +78,12 @@ func New(tp elastictransport.Interface) *ExecuteRetention { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -110,9 +118,9 @@ func (r *ExecuteRetention) HttpRequest(ctx context.Context) (*http.Request, erro } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -129,27 +137,66 @@ func (r *ExecuteRetention) HttpRequest(ctx context.Context) (*http.Request, erro } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ExecuteRetention) Perform(ctx context.Context) (*http.Response, error) { +func (r ExecuteRetention) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "slm.execute_retention") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "slm.execute_retention") + if reader := instrument.RecordRequestBody(ctx, "slm.execute_retention", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "slm.execute_retention") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ExecuteRetention query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ExecuteRetention query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a executeretention.Response -func (r ExecuteRetention) Do(ctx context.Context) (*Response, error) { +func (r ExecuteRetention) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "slm.execute_retention") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -157,6 +204,9 @@ func (r ExecuteRetention) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -166,6 +216,9 @@ func (r ExecuteRetention) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -173,12 +226,25 @@ func (r ExecuteRetention) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ExecuteRetention) IsSuccess(ctx context.Context) (bool, error) { +func (r ExecuteRetention) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "slm.execute_retention") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -194,6 +260,14 @@ func (r ExecuteRetention) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ExecuteRetention query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/executeretention/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/executeretention/response.go index 036edb181..2a5c8da28 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/executeretention/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/executeretention/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package executeretention // Response holds the response body struct for the package executeretention // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/slm/execute_retention/ExecuteRetentionResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/slm/execute_retention/ExecuteRetentionResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/getlifecycle/get_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/getlifecycle/get_lifecycle.go index 58658b0d8..28867ac8f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/getlifecycle/get_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/getlifecycle/get_lifecycle.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves one or more snapshot lifecycle policy definitions and information // about the latest snapshot attempts. package getlifecycle import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type GetLifecycle struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int policyid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetLifecycle type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *GetLifecycle { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *GetLifecycle) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("policy") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "policyid", r.policyid) + } path.WriteString(r.policyid) method = http.MethodGet @@ -126,9 +137,9 @@ func (r *GetLifecycle) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -145,27 +156,66 @@ func (r *GetLifecycle) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetLifecycle) Perform(ctx context.Context) (*http.Response, error) { +func (r GetLifecycle) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "slm.get_lifecycle") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "slm.get_lifecycle") + if reader := instrument.RecordRequestBody(ctx, "slm.get_lifecycle", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "slm.get_lifecycle") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetLifecycle query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetLifecycle query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getlifecycle.Response -func (r GetLifecycle) Do(ctx context.Context) (Response, error) { +func (r GetLifecycle) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "slm.get_lifecycle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -173,6 +223,9 @@ func (r GetLifecycle) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,6 +235,9 @@ func (r GetLifecycle) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -189,12 +245,25 @@ func (r GetLifecycle) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetLifecycle) IsSuccess(ctx context.Context) (bool, error) { +func (r GetLifecycle) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "slm.get_lifecycle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -210,6 +279,14 @@ func (r GetLifecycle) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetLifecycle query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/getlifecycle/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/getlifecycle/response.go index 9a3c70389..5e7199760 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/getlifecycle/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/getlifecycle/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getlifecycle @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getlifecycle // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/slm/get_lifecycle/GetSnapshotLifecycleResponse.ts#L24-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/slm/get_lifecycle/GetSnapshotLifecycleResponse.ts#L24-L26 type Response map[string]types.SnapshotLifecycle diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/getstats/get_stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/getstats/get_stats.go index 12094ff8c..e5ef5bf69 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/getstats/get_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/getstats/get_stats.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns global and policy-level statistics about actions taken by snapshot // lifecycle management. package getstats import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -48,9 +47,13 @@ type GetStats struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetStats type alias for index. @@ -75,7 +78,12 @@ func New(tp elastictransport.Interface) *GetStats { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -110,9 +118,9 @@ func (r *GetStats) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -129,27 +137,66 @@ func (r *GetStats) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetStats) Perform(ctx context.Context) (*http.Response, error) { +func (r GetStats) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "slm.get_stats") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "slm.get_stats") + if reader := instrument.RecordRequestBody(ctx, "slm.get_stats", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "slm.get_stats") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetStats query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetStats query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getstats.Response -func (r GetStats) Do(ctx context.Context) (*Response, error) { +func (r GetStats) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "slm.get_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -157,6 +204,9 @@ func (r GetStats) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -166,6 +216,9 @@ func (r GetStats) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -173,12 +226,25 @@ func (r GetStats) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetStats) IsSuccess(ctx context.Context) (bool, error) { +func (r GetStats) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "slm.get_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -194,6 +260,14 @@ func (r GetStats) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetStats query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/getstats/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/getstats/response.go index b41914c42..c913c46f8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/getstats/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/getstats/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getstats @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getstats // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/slm/get_stats/GetSnapshotLifecycleStatsResponse.ts#L23-L36 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/slm/get_stats/GetSnapshotLifecycleStatsResponse.ts#L23-L36 type Response struct { PolicyStats []string `json:"policy_stats"` RetentionDeletionTime types.Duration `json:"retention_deletion_time"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/getstatus/get_status.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/getstatus/get_status.go index 952a7aacc..84f7a551e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/getstatus/get_status.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/getstatus/get_status.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves the status of snapshot lifecycle management (SLM). package getstatus import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -47,9 +46,13 @@ type GetStatus struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetStatus type alias for index. @@ -73,7 +76,12 @@ func New(tp elastictransport.Interface) *GetStatus { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,9 +116,9 @@ func (r *GetStatus) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -127,27 +135,66 @@ func (r *GetStatus) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetStatus) Perform(ctx context.Context) (*http.Response, error) { +func (r GetStatus) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "slm.get_status") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "slm.get_status") + if reader := instrument.RecordRequestBody(ctx, "slm.get_status", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "slm.get_status") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetStatus query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetStatus query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getstatus.Response -func (r GetStatus) Do(ctx context.Context) (*Response, error) { +func (r GetStatus) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "slm.get_status") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -155,6 +202,9 @@ func (r GetStatus) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -164,6 +214,9 @@ func (r GetStatus) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -171,12 +224,25 @@ func (r GetStatus) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetStatus) IsSuccess(ctx context.Context) (bool, error) { +func (r GetStatus) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "slm.get_status") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -192,6 +258,14 @@ func (r GetStatus) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetStatus query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/getstatus/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/getstatus/response.go index 7dbf6c628..69a3a6a74 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/getstatus/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/getstatus/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getstatus @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getstatus // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/slm/get_status/GetSnapshotLifecycleManagementStatusResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/slm/get_status/GetSnapshotLifecycleManagementStatusResponse.ts#L22-L24 type Response struct { OperationMode lifecycleoperationmode.LifecycleOperationMode `json:"operation_mode"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/putlifecycle/put_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/putlifecycle/put_lifecycle.go index d49ce2247..f68abde50 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/putlifecycle/put_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/putlifecycle/put_lifecycle.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates or updates a snapshot lifecycle policy. package putlifecycle @@ -50,15 +50,19 @@ type PutLifecycle struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int policyid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutLifecycle type alias for index. @@ -84,11 +88,18 @@ func New(tp elastictransport.Interface) *PutLifecycle { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -125,9 +136,7 @@ func (r *PutLifecycle) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -139,6 +148,10 @@ func (r *PutLifecycle) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -149,6 +162,9 @@ func (r *PutLifecycle) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("policy") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "policyid", r.policyid) + } path.WriteString(r.policyid) method = http.MethodPut @@ -162,15 +178,15 @@ func (r *PutLifecycle) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -187,27 +203,66 @@ func (r *PutLifecycle) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutLifecycle) Perform(ctx context.Context) (*http.Response, error) { +func (r PutLifecycle) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "slm.put_lifecycle") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "slm.put_lifecycle") + if reader := instrument.RecordRequestBody(ctx, "slm.put_lifecycle", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "slm.put_lifecycle") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutLifecycle query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutLifecycle query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a putlifecycle.Response -func (r PutLifecycle) Do(ctx context.Context) (*Response, error) { +func (r PutLifecycle) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "slm.put_lifecycle") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -215,6 +270,9 @@ func (r PutLifecycle) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -224,6 +282,9 @@ func (r PutLifecycle) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -231,6 +292,9 @@ func (r PutLifecycle) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/putlifecycle/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/putlifecycle/request.go index 2de058952..21e4d14e9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/putlifecycle/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/putlifecycle/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putlifecycle @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package putlifecycle // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/slm/put_lifecycle/PutSnapshotLifecycleRequest.ts#L26-L72 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/slm/put_lifecycle/PutSnapshotLifecycleRequest.ts#L26-L72 type Request struct { // Config Configuration for each snapshot created by the policy. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/putlifecycle/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/putlifecycle/response.go index 3fd5e0512..1ec30475c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/putlifecycle/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/putlifecycle/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putlifecycle // Response holds the response body struct for the package putlifecycle // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/slm/put_lifecycle/PutSnapshotLifecycleResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/slm/put_lifecycle/PutSnapshotLifecycleResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/start/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/start/response.go index 7411d3abb..5325aabc4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/start/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/start/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package start // Response holds the response body struct for the package start // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/slm/start/StartSnapshotLifecycleManagementResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/slm/start/StartSnapshotLifecycleManagementResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/start/start.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/start/start.go index 2cac54e85..8ef461400 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/start/start.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/start/start.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Turns on snapshot lifecycle management (SLM). package start import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -47,9 +46,13 @@ type Start struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewStart type alias for index. @@ -73,7 +76,12 @@ func New(tp elastictransport.Interface) *Start { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,9 +116,9 @@ func (r *Start) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -127,27 +135,66 @@ func (r *Start) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Start) Perform(ctx context.Context) (*http.Response, error) { +func (r Start) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "slm.start") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "slm.start") + if reader := instrument.RecordRequestBody(ctx, "slm.start", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "slm.start") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Start query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Start query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a start.Response -func (r Start) Do(ctx context.Context) (*Response, error) { +func (r Start) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "slm.start") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -155,6 +202,9 @@ func (r Start) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -164,6 +214,9 @@ func (r Start) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -171,12 +224,25 @@ func (r Start) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Start) IsSuccess(ctx context.Context) (bool, error) { +func (r Start) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "slm.start") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -192,6 +258,14 @@ func (r Start) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Start query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/stop/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/stop/response.go index ec6b6320b..429c0ff82 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/stop/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/stop/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package stop // Response holds the response body struct for the package stop // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/slm/stop/StopSnapshotLifecycleManagementResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/slm/stop/StopSnapshotLifecycleManagementResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/stop/stop.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/stop/stop.go index 3ff72c43c..40a0ca137 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/stop/stop.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/slm/stop/stop.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Turns off snapshot lifecycle management (SLM). package stop import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -47,9 +46,13 @@ type Stop struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewStop type alias for index. @@ -73,7 +76,12 @@ func New(tp elastictransport.Interface) *Stop { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,9 +116,9 @@ func (r *Stop) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -127,27 +135,66 @@ func (r *Stop) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Stop) Perform(ctx context.Context) (*http.Response, error) { +func (r Stop) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "slm.stop") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "slm.stop") + if reader := instrument.RecordRequestBody(ctx, "slm.stop", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "slm.stop") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Stop query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Stop query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a stop.Response -func (r Stop) Do(ctx context.Context) (*Response, error) { +func (r Stop) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "slm.stop") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -155,6 +202,9 @@ func (r Stop) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -164,6 +214,9 @@ func (r Stop) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -171,12 +224,25 @@ func (r Stop) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Stop) IsSuccess(ctx context.Context) (bool, error) { +func (r Stop) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "slm.stop") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -192,6 +258,14 @@ func (r Stop) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Stop query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/cleanuprepository/cleanup_repository.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/cleanuprepository/cleanup_repository.go index 2452b1b23..fcade8939 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/cleanuprepository/cleanup_repository.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/cleanuprepository/cleanup_repository.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Removes stale data from repository. package cleanuprepository import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type CleanupRepository struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int repository string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewCleanupRepository type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *CleanupRepository { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *CleanupRepository) HttpRequest(ctx context.Context) (*http.Request, err path.WriteString("_snapshot") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "repository", r.repository) + } path.WriteString(r.repository) path.WriteString("/") path.WriteString("_cleanup") @@ -119,9 +130,9 @@ func (r *CleanupRepository) HttpRequest(ctx context.Context) (*http.Request, err } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -138,27 +149,66 @@ func (r *CleanupRepository) HttpRequest(ctx context.Context) (*http.Request, err } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r CleanupRepository) Perform(ctx context.Context) (*http.Response, error) { +func (r CleanupRepository) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "snapshot.cleanup_repository") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "snapshot.cleanup_repository") + if reader := instrument.RecordRequestBody(ctx, "snapshot.cleanup_repository", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "snapshot.cleanup_repository") + } if err != nil { - return nil, fmt.Errorf("an error happened during the CleanupRepository query execution: %w", err) + localErr := fmt.Errorf("an error happened during the CleanupRepository query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a cleanuprepository.Response -func (r CleanupRepository) Do(ctx context.Context) (*Response, error) { +func (r CleanupRepository) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "snapshot.cleanup_repository") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -166,6 +216,9 @@ func (r CleanupRepository) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,6 +228,9 @@ func (r CleanupRepository) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,12 +238,25 @@ func (r CleanupRepository) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r CleanupRepository) IsSuccess(ctx context.Context) (bool, error) { +func (r CleanupRepository) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "snapshot.cleanup_repository") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -203,6 +272,14 @@ func (r CleanupRepository) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the CleanupRepository query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/cleanuprepository/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/cleanuprepository/response.go index e47e40e18..692d9fa96 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/cleanuprepository/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/cleanuprepository/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package cleanuprepository @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package cleanuprepository // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/cleanup_repository/SnapshotCleanupRepositoryResponse.ts#L22-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/cleanup_repository/SnapshotCleanupRepositoryResponse.ts#L22-L27 type Response struct { // Results Statistics for cleanup operations. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/clone/clone.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/clone/clone.go index 7924f001b..ac91e3fa7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/clone/clone.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/clone/clone.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Clones indices from one snapshot into another snapshot in the same // repository. @@ -55,17 +55,21 @@ type Clone struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int repository string snapshot string targetsnapshot string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewClone type alias for index. @@ -96,11 +100,18 @@ func New(tp elastictransport.Interface) *Clone { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -137,9 +148,7 @@ func (r *Clone) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -151,6 +160,10 @@ func (r *Clone) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -159,14 +172,23 @@ func (r *Clone) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_snapshot") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "repository", r.repository) + } path.WriteString(r.repository) path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "snapshot", r.snapshot) + } path.WriteString(r.snapshot) path.WriteString("/") path.WriteString("_clone") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "targetsnapshot", r.targetsnapshot) + } path.WriteString(r.targetsnapshot) method = http.MethodPut @@ -180,15 +202,15 @@ func (r *Clone) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -205,27 +227,66 @@ func (r *Clone) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Clone) Perform(ctx context.Context) (*http.Response, error) { +func (r Clone) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "snapshot.clone") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "snapshot.clone") + if reader := instrument.RecordRequestBody(ctx, "snapshot.clone", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "snapshot.clone") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Clone query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Clone query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a clone.Response -func (r Clone) Do(ctx context.Context) (*Response, error) { +func (r Clone) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "snapshot.clone") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -233,6 +294,9 @@ func (r Clone) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -242,6 +306,9 @@ func (r Clone) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -249,6 +316,9 @@ func (r Clone) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/clone/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/clone/request.go index ebcad4aa7..754ce4ca3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/clone/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/clone/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package clone @@ -27,7 +27,7 @@ import ( // Request holds the request body struct for the package clone // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/clone/SnapshotCloneRequest.ts#L24-L42 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/clone/SnapshotCloneRequest.ts#L24-L42 type Request struct { Indices string `json:"indices"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/clone/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/clone/response.go index 8a6fa476a..45f111acb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/clone/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/clone/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package clone // Response holds the response body struct for the package clone // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/clone/SnapshotCloneResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/clone/SnapshotCloneResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/create/create.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/create/create.go index 84e21bd1b..a14e19b05 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/create/create.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/create/create.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates a snapshot in a repository. package create @@ -53,16 +53,20 @@ type Create struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int repository string snapshot string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewCreate type alias for index. @@ -90,11 +94,18 @@ func New(tp elastictransport.Interface) *Create { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -131,9 +142,7 @@ func (r *Create) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -145,6 +154,10 @@ func (r *Create) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -153,9 +166,15 @@ func (r *Create) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_snapshot") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "repository", r.repository) + } path.WriteString(r.repository) path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "snapshot", r.snapshot) + } path.WriteString(r.snapshot) method = http.MethodPut @@ -169,15 +188,15 @@ func (r *Create) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -194,27 +213,66 @@ func (r *Create) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Create) Perform(ctx context.Context) (*http.Response, error) { +func (r Create) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "snapshot.create") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "snapshot.create") + if reader := instrument.RecordRequestBody(ctx, "snapshot.create", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "snapshot.create") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Create query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Create query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a create.Response -func (r Create) Do(ctx context.Context) (*Response, error) { +func (r Create) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "snapshot.create") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -222,6 +280,9 @@ func (r Create) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -231,6 +292,9 @@ func (r Create) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -238,6 +302,9 @@ func (r Create) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/create/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/create/request.go index da7cc869b..aa95698f3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/create/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/create/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package create @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package create // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/create/SnapshotCreateRequest.ts#L24-L81 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/create/SnapshotCreateRequest.ts#L24-L81 type Request struct { // FeatureStates Feature states to include in the snapshot. Each feature state includes one or diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/create/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/create/response.go index 351a50f1b..804a48317 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/create/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/create/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package create @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package create // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/create/SnapshotCreateResponse.ts#L22-L35 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/create/SnapshotCreateResponse.ts#L22-L35 type Response struct { // Accepted Equals `true` if the snapshot was accepted. Present when the request had diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/createrepository/create_repository.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/createrepository/create_repository.go index c2210c132..0b6262f41 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/createrepository/create_repository.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/createrepository/create_repository.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates a repository. package createrepository @@ -51,15 +51,19 @@ type CreateRepository struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int repository string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewCreateRepository type alias for index. @@ -85,11 +89,18 @@ func New(tp elastictransport.Interface) *CreateRepository { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -126,9 +137,7 @@ func (r *CreateRepository) HttpRequest(ctx context.Context) (*http.Request, erro } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -140,6 +149,10 @@ func (r *CreateRepository) HttpRequest(ctx context.Context) (*http.Request, erro } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -148,6 +161,9 @@ func (r *CreateRepository) HttpRequest(ctx context.Context) (*http.Request, erro path.WriteString("_snapshot") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "repository", r.repository) + } path.WriteString(r.repository) method = http.MethodPut @@ -161,15 +177,15 @@ func (r *CreateRepository) HttpRequest(ctx context.Context) (*http.Request, erro } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -186,27 +202,66 @@ func (r *CreateRepository) HttpRequest(ctx context.Context) (*http.Request, erro } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r CreateRepository) Perform(ctx context.Context) (*http.Response, error) { +func (r CreateRepository) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "snapshot.create_repository") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "snapshot.create_repository") + if reader := instrument.RecordRequestBody(ctx, "snapshot.create_repository", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "snapshot.create_repository") + } if err != nil { - return nil, fmt.Errorf("an error happened during the CreateRepository query execution: %w", err) + localErr := fmt.Errorf("an error happened during the CreateRepository query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a createrepository.Response -func (r CreateRepository) Do(ctx context.Context) (*Response, error) { +func (r CreateRepository) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "snapshot.create_repository") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -214,6 +269,9 @@ func (r CreateRepository) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -223,6 +281,9 @@ func (r CreateRepository) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -230,6 +291,9 @@ func (r CreateRepository) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/createrepository/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/createrepository/request.go index 0b16433a9..3227383c5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/createrepository/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/createrepository/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package createrepository @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package createrepository // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/create_repository/SnapshotCreateRepositoryRequest.ts#L28-L48 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/create_repository/SnapshotCreateRepositoryRequest.ts#L28-L48 type Request struct { Repository *types.Repository `json:"repository,omitempty"` Settings types.RepositorySettings `json:"settings"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/createrepository/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/createrepository/response.go index 978e167f9..d4a334bc6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/createrepository/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/createrepository/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package createrepository // Response holds the response body struct for the package createrepository // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/create_repository/SnapshotCreateRepositoryResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/create_repository/SnapshotCreateRepositoryResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/delete/delete.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/delete/delete.go index 0021c5c13..a6d15d39c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/delete/delete.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/delete/delete.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes one or more snapshots. package delete import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,12 +52,16 @@ type Delete struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int repository string snapshot string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDelete type alias for index. @@ -86,7 +89,12 @@ func New(tp elastictransport.Interface) *Delete { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -109,9 +117,15 @@ func (r *Delete) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_snapshot") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "repository", r.repository) + } path.WriteString(r.repository) path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "snapshot", r.snapshot) + } path.WriteString(r.snapshot) method = http.MethodDelete @@ -125,9 +139,9 @@ func (r *Delete) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -144,27 +158,66 @@ func (r *Delete) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Delete) Perform(ctx context.Context) (*http.Response, error) { +func (r Delete) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "snapshot.delete") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "snapshot.delete") + if reader := instrument.RecordRequestBody(ctx, "snapshot.delete", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "snapshot.delete") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Delete query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Delete query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a delete.Response -func (r Delete) Do(ctx context.Context) (*Response, error) { +func (r Delete) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "snapshot.delete") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -172,6 +225,9 @@ func (r Delete) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -181,6 +237,9 @@ func (r Delete) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -188,12 +247,25 @@ func (r Delete) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Delete) IsSuccess(ctx context.Context) (bool, error) { +func (r Delete) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "snapshot.delete") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -209,6 +281,14 @@ func (r Delete) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Delete query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/delete/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/delete/response.go index 4a18ef92d..1bfff420f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/delete/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/delete/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package delete // Response holds the response body struct for the package delete // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/delete/SnapshotDeleteResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/delete/SnapshotDeleteResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/deleterepository/delete_repository.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/deleterepository/delete_repository.go index dd18399f1..c8a1c0898 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/deleterepository/delete_repository.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/deleterepository/delete_repository.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes a repository. package deleterepository import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type DeleteRepository struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int repository string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteRepository type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *DeleteRepository { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *DeleteRepository) HttpRequest(ctx context.Context) (*http.Request, erro path.WriteString("_snapshot") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "repository", r.repository) + } path.WriteString(r.repository) method = http.MethodDelete @@ -117,9 +128,9 @@ func (r *DeleteRepository) HttpRequest(ctx context.Context) (*http.Request, erro } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -136,27 +147,66 @@ func (r *DeleteRepository) HttpRequest(ctx context.Context) (*http.Request, erro } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteRepository) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteRepository) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "snapshot.delete_repository") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "snapshot.delete_repository") + if reader := instrument.RecordRequestBody(ctx, "snapshot.delete_repository", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "snapshot.delete_repository") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteRepository query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteRepository query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deleterepository.Response -func (r DeleteRepository) Do(ctx context.Context) (*Response, error) { +func (r DeleteRepository) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "snapshot.delete_repository") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -164,6 +214,9 @@ func (r DeleteRepository) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -173,6 +226,9 @@ func (r DeleteRepository) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -180,12 +236,25 @@ func (r DeleteRepository) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteRepository) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteRepository) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "snapshot.delete_repository") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -201,6 +270,14 @@ func (r DeleteRepository) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteRepository query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/deleterepository/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/deleterepository/response.go index 32f3bdc8d..fca1eba12 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/deleterepository/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/deleterepository/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deleterepository // Response holds the response body struct for the package deleterepository // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/delete_repository/SnapshotDeleteRepositoryResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/delete_repository/SnapshotDeleteRepositoryResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/get/get.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/get/get.go index 9e040b8ed..74ee2aedc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/get/get.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/get/get.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns information about a snapshot. package get import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -56,12 +55,16 @@ type Get struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int repository string snapshot string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGet type alias for index. @@ -89,7 +92,12 @@ func New(tp elastictransport.Interface) *Get { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -112,9 +120,15 @@ func (r *Get) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_snapshot") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "repository", r.repository) + } path.WriteString(r.repository) path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "snapshot", r.snapshot) + } path.WriteString(r.snapshot) method = http.MethodGet @@ -128,9 +142,9 @@ func (r *Get) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -147,27 +161,66 @@ func (r *Get) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Get) Perform(ctx context.Context) (*http.Response, error) { +func (r Get) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "snapshot.get") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "snapshot.get") + if reader := instrument.RecordRequestBody(ctx, "snapshot.get", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "snapshot.get") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Get query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Get query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a get.Response -func (r Get) Do(ctx context.Context) (*Response, error) { +func (r Get) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "snapshot.get") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -175,6 +228,9 @@ func (r Get) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,6 +240,9 @@ func (r Get) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -191,12 +250,25 @@ func (r Get) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Get) IsSuccess(ctx context.Context) (bool, error) { +func (r Get) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "snapshot.get") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -212,6 +284,14 @@ func (r Get) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Get query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/get/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/get/response.go index 3be802e29..c96cc56ef 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/get/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/get/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package get @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package get // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/get/SnapshotGetResponse.ts#L25-L42 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/get/SnapshotGetResponse.ts#L25-L42 type Response struct { // Remaining The number of remaining snapshots that were not returned due to size limits diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/getrepository/get_repository.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/getrepository/get_repository.go index eb2a68df9..e40b725a6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/getrepository/get_repository.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/getrepository/get_repository.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns information about a repository. package getrepository import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type GetRepository struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int repository string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetRepository type alias for index. @@ -80,7 +83,12 @@ func New(tp elastictransport.Interface) *GetRepository { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,6 +116,9 @@ func (r *GetRepository) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("_snapshot") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "repository", r.repository) + } path.WriteString(r.repository) method = http.MethodGet @@ -121,9 +132,9 @@ func (r *GetRepository) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -140,27 +151,66 @@ func (r *GetRepository) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetRepository) Perform(ctx context.Context) (*http.Response, error) { +func (r GetRepository) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "snapshot.get_repository") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "snapshot.get_repository") + if reader := instrument.RecordRequestBody(ctx, "snapshot.get_repository", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "snapshot.get_repository") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetRepository query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetRepository query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getrepository.Response -func (r GetRepository) Do(ctx context.Context) (Response, error) { +func (r GetRepository) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "snapshot.get_repository") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -168,6 +218,9 @@ func (r GetRepository) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -177,6 +230,9 @@ func (r GetRepository) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,12 +240,25 @@ func (r GetRepository) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetRepository) IsSuccess(ctx context.Context) (bool, error) { +func (r GetRepository) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "snapshot.get_repository") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -205,6 +274,14 @@ func (r GetRepository) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetRepository query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/getrepository/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/getrepository/response.go index 2eb3ea73d..faacc0911 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/getrepository/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/getrepository/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getrepository @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getrepository // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/get_repository/SnapshotGetRepositoryResponse.ts#L23-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/get_repository/SnapshotGetRepositoryResponse.ts#L23-L25 type Response map[string]types.Repository diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/restore/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/restore/request.go index a996d401e..15a54ae50 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/restore/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/restore/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package restore @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package restore // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/restore/SnapshotRestoreRequest.ts#L25-L51 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/restore/SnapshotRestoreRequest.ts#L25-L51 type Request struct { FeatureStates []string `json:"feature_states,omitempty"` IgnoreIndexSettings []string `json:"ignore_index_settings,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/restore/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/restore/response.go index 0ce50307d..dbb33fad4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/restore/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/restore/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package restore @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package restore // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/restore/SnapshotRestoreResponse.ts#L23-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/restore/SnapshotRestoreResponse.ts#L23-L25 type Response struct { Snapshot types.SnapshotRestore `json:"snapshot"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/restore/restore.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/restore/restore.go index b4f409178..6371aa02c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/restore/restore.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/restore/restore.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Restores a snapshot. package restore @@ -53,16 +53,20 @@ type Restore struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int repository string snapshot string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewRestore type alias for index. @@ -90,11 +94,18 @@ func New(tp elastictransport.Interface) *Restore { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -131,9 +142,7 @@ func (r *Restore) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -145,6 +154,10 @@ func (r *Restore) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -153,9 +166,15 @@ func (r *Restore) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_snapshot") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "repository", r.repository) + } path.WriteString(r.repository) path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "snapshot", r.snapshot) + } path.WriteString(r.snapshot) path.WriteString("/") path.WriteString("_restore") @@ -171,15 +190,15 @@ func (r *Restore) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -196,27 +215,66 @@ func (r *Restore) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Restore) Perform(ctx context.Context) (*http.Response, error) { +func (r Restore) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "snapshot.restore") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "snapshot.restore") + if reader := instrument.RecordRequestBody(ctx, "snapshot.restore", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "snapshot.restore") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Restore query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Restore query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a restore.Response -func (r Restore) Do(ctx context.Context) (*Response, error) { +func (r Restore) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "snapshot.restore") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -224,6 +282,9 @@ func (r Restore) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -233,6 +294,9 @@ func (r Restore) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -240,6 +304,9 @@ func (r Restore) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/status/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/status/response.go index e46a379f1..6e1f0ba09 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/status/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/status/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package status @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package status // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/status/SnapshotStatusResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/status/SnapshotStatusResponse.ts#L22-L24 type Response struct { Snapshots []types.Status `json:"snapshots"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/status/status.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/status/status.go index d1ddd7418..8cdeb33f2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/status/status.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/status/status.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns information about the status of a snapshot. package status import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -54,12 +53,16 @@ type Status struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int repository string snapshot string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewStatus type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *Status { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -113,6 +121,9 @@ func (r *Status) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_snapshot") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "repository", r.repository) + } path.WriteString(r.repository) path.WriteString("/") path.WriteString("_status") @@ -123,9 +134,15 @@ func (r *Status) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_snapshot") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "repository", r.repository) + } path.WriteString(r.repository) path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "snapshot", r.snapshot) + } path.WriteString(r.snapshot) path.WriteString("/") path.WriteString("_status") @@ -141,9 +158,9 @@ func (r *Status) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -160,27 +177,66 @@ func (r *Status) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Status) Perform(ctx context.Context) (*http.Response, error) { +func (r Status) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "snapshot.status") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "snapshot.status") + if reader := instrument.RecordRequestBody(ctx, "snapshot.status", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "snapshot.status") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Status query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Status query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a status.Response -func (r Status) Do(ctx context.Context) (*Response, error) { +func (r Status) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "snapshot.status") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -188,6 +244,9 @@ func (r Status) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -197,6 +256,9 @@ func (r Status) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -204,12 +266,25 @@ func (r Status) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Status) IsSuccess(ctx context.Context) (bool, error) { +func (r Status) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "snapshot.status") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -225,6 +300,14 @@ func (r Status) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Status query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/verifyrepository/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/verifyrepository/response.go index c7a985d80..005294d82 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/verifyrepository/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/verifyrepository/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package verifyrepository @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package verifyrepository // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/verify_repository/SnapshotVerifyRepositoryResponse.ts#L23-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/verify_repository/SnapshotVerifyRepositoryResponse.ts#L23-L25 type Response struct { Nodes map[string]types.CompactNodeInfo `json:"nodes"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/verifyrepository/verify_repository.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/verifyrepository/verify_repository.go index 97b64606d..66ef886f6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/verifyrepository/verify_repository.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/snapshot/verifyrepository/verify_repository.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Verifies a repository. package verifyrepository import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type VerifyRepository struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int repository string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewVerifyRepository type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *VerifyRepository { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *VerifyRepository) HttpRequest(ctx context.Context) (*http.Request, erro path.WriteString("_snapshot") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "repository", r.repository) + } path.WriteString(r.repository) path.WriteString("/") path.WriteString("_verify") @@ -119,9 +130,9 @@ func (r *VerifyRepository) HttpRequest(ctx context.Context) (*http.Request, erro } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -138,27 +149,66 @@ func (r *VerifyRepository) HttpRequest(ctx context.Context) (*http.Request, erro } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r VerifyRepository) Perform(ctx context.Context) (*http.Response, error) { +func (r VerifyRepository) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "snapshot.verify_repository") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "snapshot.verify_repository") + if reader := instrument.RecordRequestBody(ctx, "snapshot.verify_repository", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "snapshot.verify_repository") + } if err != nil { - return nil, fmt.Errorf("an error happened during the VerifyRepository query execution: %w", err) + localErr := fmt.Errorf("an error happened during the VerifyRepository query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a verifyrepository.Response -func (r VerifyRepository) Do(ctx context.Context) (*Response, error) { +func (r VerifyRepository) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "snapshot.verify_repository") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -166,6 +216,9 @@ func (r VerifyRepository) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,6 +228,9 @@ func (r VerifyRepository) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,12 +238,25 @@ func (r VerifyRepository) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r VerifyRepository) IsSuccess(ctx context.Context) (bool, error) { +func (r VerifyRepository) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "snapshot.verify_repository") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -203,6 +272,14 @@ func (r VerifyRepository) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the VerifyRepository query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/clearcursor/clear_cursor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/clearcursor/clear_cursor.go index 0693d3e46..7cffd7df6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/clearcursor/clear_cursor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/clearcursor/clear_cursor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Clears the SQL cursor package clearcursor @@ -46,13 +46,17 @@ type ClearCursor struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewClearCursor type alias for index. @@ -76,11 +80,18 @@ func New(tp elastictransport.Interface) *ClearCursor { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -117,9 +128,7 @@ func (r *ClearCursor) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -131,6 +140,10 @@ func (r *ClearCursor) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -151,15 +164,15 @@ func (r *ClearCursor) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -176,27 +189,66 @@ func (r *ClearCursor) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ClearCursor) Perform(ctx context.Context) (*http.Response, error) { +func (r ClearCursor) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "sql.clear_cursor") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "sql.clear_cursor") + if reader := instrument.RecordRequestBody(ctx, "sql.clear_cursor", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "sql.clear_cursor") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ClearCursor query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ClearCursor query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a clearcursor.Response -func (r ClearCursor) Do(ctx context.Context) (*Response, error) { +func (r ClearCursor) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "sql.clear_cursor") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -204,6 +256,9 @@ func (r ClearCursor) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -213,6 +268,9 @@ func (r ClearCursor) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -220,6 +278,9 @@ func (r ClearCursor) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/clearcursor/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/clearcursor/request.go index a5416489d..7658acafc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/clearcursor/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/clearcursor/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package clearcursor @@ -27,7 +27,7 @@ import ( // Request holds the request body struct for the package clearcursor // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/sql/clear_cursor/ClearSqlCursorRequest.ts#L22-L34 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/sql/clear_cursor/ClearSqlCursorRequest.ts#L22-L34 type Request struct { // Cursor Cursor to clear. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/clearcursor/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/clearcursor/response.go index f89ebcc57..af77f7f7d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/clearcursor/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/clearcursor/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package clearcursor // Response holds the response body struct for the package clearcursor // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/sql/clear_cursor/ClearSqlCursorResponse.ts#L20-L22 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/sql/clear_cursor/ClearSqlCursorResponse.ts#L20-L22 type Response struct { Succeeded bool `json:"succeeded"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/deleteasync/delete_async.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/deleteasync/delete_async.go index b94098e03..1dadd32bc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/deleteasync/delete_async.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/deleteasync/delete_async.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes an async SQL search or a stored synchronous SQL search. If the search // is still running, the API cancels it. package deleteasync import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type DeleteAsync struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteAsync type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *DeleteAsync { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -110,6 +118,9 @@ func (r *DeleteAsync) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("delete") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodDelete @@ -123,9 +134,9 @@ func (r *DeleteAsync) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -142,27 +153,66 @@ func (r *DeleteAsync) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteAsync) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteAsync) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "sql.delete_async") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "sql.delete_async") + if reader := instrument.RecordRequestBody(ctx, "sql.delete_async", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "sql.delete_async") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteAsync query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteAsync query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deleteasync.Response -func (r DeleteAsync) Do(ctx context.Context) (*Response, error) { +func (r DeleteAsync) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "sql.delete_async") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -170,6 +220,9 @@ func (r DeleteAsync) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -179,6 +232,9 @@ func (r DeleteAsync) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -186,12 +242,25 @@ func (r DeleteAsync) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteAsync) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteAsync) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "sql.delete_async") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -207,6 +276,14 @@ func (r DeleteAsync) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteAsync query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/deleteasync/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/deleteasync/response.go index 88a3f517d..ebe6c2053 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/deleteasync/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/deleteasync/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deleteasync // Response holds the response body struct for the package deleteasync // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/sql/delete_async/SqlDeleteAsyncResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/sql/delete_async/SqlDeleteAsyncResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/getasync/get_async.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/getasync/get_async.go index cb4ad0a80..2d479e654 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/getasync/get_async.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/getasync/get_async.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns the current status and available results for an async SQL search or // stored synchronous SQL search package getasync import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type GetAsync struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetAsync type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *GetAsync { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,6 +116,9 @@ func (r *GetAsync) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("async") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodGet @@ -121,9 +132,9 @@ func (r *GetAsync) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -140,27 +151,66 @@ func (r *GetAsync) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetAsync) Perform(ctx context.Context) (*http.Response, error) { +func (r GetAsync) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "sql.get_async") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "sql.get_async") + if reader := instrument.RecordRequestBody(ctx, "sql.get_async", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "sql.get_async") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetAsync query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetAsync query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getasync.Response -func (r GetAsync) Do(ctx context.Context) (*Response, error) { +func (r GetAsync) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "sql.get_async") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -168,6 +218,9 @@ func (r GetAsync) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -177,6 +230,9 @@ func (r GetAsync) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,12 +240,25 @@ func (r GetAsync) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetAsync) IsSuccess(ctx context.Context) (bool, error) { +func (r GetAsync) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "sql.get_async") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -205,6 +274,14 @@ func (r GetAsync) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetAsync query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/getasync/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/getasync/response.go index 482c72f74..123afd04c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/getasync/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/getasync/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getasync @@ -28,7 +28,7 @@ import ( // Response holds the response body struct for the package getasync // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/sql/get_async/SqlGetAsyncResponse.ts#L23-L60 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/sql/get_async/SqlGetAsyncResponse.ts#L23-L60 type Response struct { // Columns Column headings for the search results. Each object is a column. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/getasyncstatus/get_async_status.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/getasyncstatus/get_async_status.go index cefa0ffe5..1478b23d0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/getasyncstatus/get_async_status.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/getasyncstatus/get_async_status.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns the current status of an async SQL search or a stored synchronous SQL // search package getasyncstatus import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type GetAsyncStatus struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetAsyncStatus type alias for index. @@ -83,7 +86,12 @@ func New(tp elastictransport.Interface) *GetAsyncStatus { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -110,6 +118,9 @@ func (r *GetAsyncStatus) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("status") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodGet @@ -123,9 +134,9 @@ func (r *GetAsyncStatus) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -142,27 +153,66 @@ func (r *GetAsyncStatus) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetAsyncStatus) Perform(ctx context.Context) (*http.Response, error) { +func (r GetAsyncStatus) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "sql.get_async_status") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "sql.get_async_status") + if reader := instrument.RecordRequestBody(ctx, "sql.get_async_status", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "sql.get_async_status") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetAsyncStatus query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetAsyncStatus query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getasyncstatus.Response -func (r GetAsyncStatus) Do(ctx context.Context) (*Response, error) { +func (r GetAsyncStatus) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "sql.get_async_status") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -170,6 +220,9 @@ func (r GetAsyncStatus) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -179,6 +232,9 @@ func (r GetAsyncStatus) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -186,12 +242,25 @@ func (r GetAsyncStatus) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetAsyncStatus) IsSuccess(ctx context.Context) (bool, error) { +func (r GetAsyncStatus) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "sql.get_async_status") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -207,6 +276,14 @@ func (r GetAsyncStatus) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetAsyncStatus query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/getasyncstatus/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/getasyncstatus/response.go index 6149d57ce..48fe0006c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/getasyncstatus/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/getasyncstatus/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getasyncstatus // Response holds the response body struct for the package getasyncstatus // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/sql/get_async_status/SqlGetAsyncStatusResponse.ts#L23-L55 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/sql/get_async_status/SqlGetAsyncStatusResponse.ts#L23-L55 type Response struct { // CompletionStatus HTTP status code for the search. The API only returns this property for diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/query/query.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/query/query.go index eddf094f1..167a559e1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/query/query.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/query/query.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Executes a SQL request package query @@ -46,13 +46,17 @@ type Query struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewQuery type alias for index. @@ -76,11 +80,18 @@ func New(tp elastictransport.Interface) *Query { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -117,9 +128,7 @@ func (r *Query) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -131,6 +140,10 @@ func (r *Query) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -149,15 +162,15 @@ func (r *Query) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -174,27 +187,66 @@ func (r *Query) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Query) Perform(ctx context.Context) (*http.Response, error) { +func (r Query) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "sql.query") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "sql.query") + if reader := instrument.RecordRequestBody(ctx, "sql.query", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "sql.query") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Query query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Query query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a query.Response -func (r Query) Do(ctx context.Context) (*Response, error) { +func (r Query) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "sql.query") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -202,6 +254,9 @@ func (r Query) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -211,6 +266,9 @@ func (r Query) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -218,6 +276,9 @@ func (r Query) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/query/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/query/request.go index 2af6fb2b8..9a6f8ebe7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/query/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/query/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package query @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package query // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/sql/query/QuerySqlRequest.ts#L28-L122 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/sql/query/QuerySqlRequest.ts#L28-L122 type Request struct { // Catalog Default catalog (cluster) for queries. If unspecified, the queries execute on diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/query/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/query/response.go index a4d8b4452..cf4e5408d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/query/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/query/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package query @@ -28,7 +28,7 @@ import ( // Response holds the response body struct for the package query // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/sql/query/QuerySqlResponse.ts#L23-L60 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/sql/query/QuerySqlResponse.ts#L23-L60 type Response struct { // Columns Column headings for the search results. Each object is a column. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/translate/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/translate/request.go index 159fdb967..926fec25b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/translate/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/translate/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package translate @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package translate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/sql/translate/TranslateSqlRequest.ts#L25-L54 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/sql/translate/TranslateSqlRequest.ts#L25-L54 type Request struct { // FetchSize The maximum number of rows (or entries) to return in one response. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/translate/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/translate/response.go index d99d7b2d7..d08a2c506 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/translate/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/translate/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package translate @@ -32,7 +32,7 @@ import ( // Response holds the response body struct for the package translate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/sql/translate/TranslateSqlResponse.ts#L28-L38 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/sql/translate/TranslateSqlResponse.ts#L28-L38 type Response struct { Aggregations map[string]types.Aggregations `json:"aggregations,omitempty"` Fields []types.FieldAndFormat `json:"fields,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/translate/translate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/translate/translate.go index 8bcc97022..43206f08d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/translate/translate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/sql/translate/translate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Translates SQL into Elasticsearch queries package translate @@ -46,13 +46,17 @@ type Translate struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewTranslate type alias for index. @@ -76,11 +80,18 @@ func New(tp elastictransport.Interface) *Translate { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -117,9 +128,7 @@ func (r *Translate) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -131,6 +140,10 @@ func (r *Translate) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -151,15 +164,15 @@ func (r *Translate) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -176,27 +189,66 @@ func (r *Translate) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Translate) Perform(ctx context.Context) (*http.Response, error) { +func (r Translate) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "sql.translate") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "sql.translate") + if reader := instrument.RecordRequestBody(ctx, "sql.translate", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "sql.translate") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Translate query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Translate query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a translate.Response -func (r Translate) Do(ctx context.Context) (*Response, error) { +func (r Translate) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "sql.translate") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -204,6 +256,9 @@ func (r Translate) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -213,6 +268,9 @@ func (r Translate) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -220,6 +278,9 @@ func (r Translate) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ssl/certificates/certificates.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ssl/certificates/certificates.go index 06d2b3b22..62cc3e5e4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ssl/certificates/certificates.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ssl/certificates/certificates.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves information about the X.509 certificates used to encrypt // communications in the cluster. package certificates import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -48,9 +47,13 @@ type Certificates struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewCertificates type alias for index. @@ -75,7 +78,12 @@ func New(tp elastictransport.Interface) *Certificates { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -110,9 +118,9 @@ func (r *Certificates) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -129,27 +137,66 @@ func (r *Certificates) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Certificates) Perform(ctx context.Context) (*http.Response, error) { +func (r Certificates) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "ssl.certificates") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "ssl.certificates") + if reader := instrument.RecordRequestBody(ctx, "ssl.certificates", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "ssl.certificates") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Certificates query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Certificates query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a certificates.Response -func (r Certificates) Do(ctx context.Context) (Response, error) { +func (r Certificates) Do(providedCtx context.Context) (Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ssl.certificates") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -157,6 +204,9 @@ func (r Certificates) Do(ctx context.Context) (Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(&response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -166,6 +216,9 @@ func (r Certificates) Do(ctx context.Context) (Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -173,12 +226,25 @@ func (r Certificates) Do(ctx context.Context) (Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Certificates) IsSuccess(ctx context.Context) (bool, error) { +func (r Certificates) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "ssl.certificates") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -194,6 +260,14 @@ func (r Certificates) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Certificates query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ssl/certificates/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ssl/certificates/response.go index 5ca251beb..0d7bb991e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ssl/certificates/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/ssl/certificates/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package certificates @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package certificates // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ssl/certificates/GetCertificatesResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ssl/certificates/GetCertificatesResponse.ts#L22-L24 type Response []types.CertificateInformation diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/deletesynonym/delete_synonym.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/deletesynonym/delete_synonym.go index dee0be418..da0a946fc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/deletesynonym/delete_synonym.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/deletesynonym/delete_synonym.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes a synonym set package deletesynonym import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type DeleteSynonym struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteSynonym type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *DeleteSynonym { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *DeleteSynonym) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("_synonyms") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodDelete @@ -117,9 +128,9 @@ func (r *DeleteSynonym) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -136,27 +147,66 @@ func (r *DeleteSynonym) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteSynonym) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteSynonym) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "synonyms.delete_synonym") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "synonyms.delete_synonym") + if reader := instrument.RecordRequestBody(ctx, "synonyms.delete_synonym", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "synonyms.delete_synonym") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteSynonym query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteSynonym query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deletesynonym.Response -func (r DeleteSynonym) Do(ctx context.Context) (*Response, error) { +func (r DeleteSynonym) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "synonyms.delete_synonym") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -164,6 +214,9 @@ func (r DeleteSynonym) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -173,6 +226,9 @@ func (r DeleteSynonym) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -180,12 +236,25 @@ func (r DeleteSynonym) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteSynonym) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteSynonym) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "synonyms.delete_synonym") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -201,6 +270,14 @@ func (r DeleteSynonym) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteSynonym query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/deletesynonym/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/deletesynonym/response.go index 952e80c12..8043a2380 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/deletesynonym/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/deletesynonym/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deletesynonym // Response holds the response body struct for the package deletesynonym // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/synonyms/delete_synonym/SynonymsDeleteResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/synonyms/delete_synonym/SynonymsDeleteResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/deletesynonymrule/delete_synonym_rule.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/deletesynonymrule/delete_synonym_rule.go index 95f611271..a80e820d0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/deletesynonymrule/delete_synonym_rule.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/deletesynonymrule/delete_synonym_rule.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes a synonym rule in a synonym set package deletesynonymrule import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,12 +52,16 @@ type DeleteSynonymRule struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int setid string ruleid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteSynonymRule type alias for index. @@ -86,7 +89,12 @@ func New(tp elastictransport.Interface) *DeleteSynonymRule { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -109,9 +117,15 @@ func (r *DeleteSynonymRule) HttpRequest(ctx context.Context) (*http.Request, err path.WriteString("_synonyms") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "setid", r.setid) + } path.WriteString(r.setid) path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "ruleid", r.ruleid) + } path.WriteString(r.ruleid) method = http.MethodDelete @@ -125,15 +139,15 @@ func (r *DeleteSynonymRule) HttpRequest(ctx context.Context) (*http.Request, err } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -150,27 +164,66 @@ func (r *DeleteSynonymRule) HttpRequest(ctx context.Context) (*http.Request, err } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteSynonymRule) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteSynonymRule) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "synonyms.delete_synonym_rule") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "synonyms.delete_synonym_rule") + if reader := instrument.RecordRequestBody(ctx, "synonyms.delete_synonym_rule", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "synonyms.delete_synonym_rule") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteSynonymRule query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteSynonymRule query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deletesynonymrule.Response -func (r DeleteSynonymRule) Do(ctx context.Context) (*Response, error) { +func (r DeleteSynonymRule) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "synonyms.delete_synonym_rule") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -178,6 +231,9 @@ func (r DeleteSynonymRule) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -187,6 +243,9 @@ func (r DeleteSynonymRule) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -194,12 +253,25 @@ func (r DeleteSynonymRule) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteSynonymRule) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteSynonymRule) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "synonyms.delete_synonym_rule") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -215,6 +287,14 @@ func (r DeleteSynonymRule) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteSynonymRule query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/deletesynonymrule/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/deletesynonymrule/response.go index e1aea8f18..c2b5b4417 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/deletesynonymrule/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/deletesynonymrule/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deletesynonymrule @@ -27,7 +27,7 @@ import ( // Response holds the response body struct for the package deletesynonymrule // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/synonyms/delete_synonym_rule/SynonymRuleDeleteResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/synonyms/delete_synonym_rule/SynonymRuleDeleteResponse.ts#L22-L24 type Response struct { // ReloadAnalyzersDetails Updating synonyms in a synonym set reloads the associated analyzers. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/getsynonym/get_synonym.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/getsynonym/get_synonym.go index 39f07576b..44ffcb249 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/getsynonym/get_synonym.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/getsynonym/get_synonym.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves a synonym set package getsynonym import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type GetSynonym struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetSynonym type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *GetSynonym { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -105,6 +113,9 @@ func (r *GetSynonym) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_synonyms") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodGet @@ -118,9 +129,9 @@ func (r *GetSynonym) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -137,27 +148,66 @@ func (r *GetSynonym) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetSynonym) Perform(ctx context.Context) (*http.Response, error) { +func (r GetSynonym) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "synonyms.get_synonym") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "synonyms.get_synonym") + if reader := instrument.RecordRequestBody(ctx, "synonyms.get_synonym", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "synonyms.get_synonym") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetSynonym query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetSynonym query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getsynonym.Response -func (r GetSynonym) Do(ctx context.Context) (*Response, error) { +func (r GetSynonym) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "synonyms.get_synonym") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -165,6 +215,9 @@ func (r GetSynonym) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -174,6 +227,9 @@ func (r GetSynonym) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -181,12 +237,25 @@ func (r GetSynonym) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetSynonym) IsSuccess(ctx context.Context) (bool, error) { +func (r GetSynonym) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "synonyms.get_synonym") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -202,6 +271,14 @@ func (r GetSynonym) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetSynonym query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/getsynonym/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/getsynonym/response.go index ba0899e88..d8be0c7df 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/getsynonym/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/getsynonym/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getsynonym @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getsynonym // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/synonyms/get_synonym/SynonymsGetResponse.ts#L23-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/synonyms/get_synonym/SynonymsGetResponse.ts#L23-L28 type Response struct { Count int `json:"count"` SynonymsSet []types.SynonymRuleRead `json:"synonyms_set"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/getsynonymrule/get_synonym_rule.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/getsynonymrule/get_synonym_rule.go index 633f382a6..af9bc0866 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/getsynonymrule/get_synonym_rule.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/getsynonymrule/get_synonym_rule.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves a synonym rule from a synonym set package getsynonymrule import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -53,12 +52,16 @@ type GetSynonymRule struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int setid string ruleid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetSynonymRule type alias for index. @@ -86,7 +89,12 @@ func New(tp elastictransport.Interface) *GetSynonymRule { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -109,9 +117,15 @@ func (r *GetSynonymRule) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("_synonyms") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "setid", r.setid) + } path.WriteString(r.setid) path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "ruleid", r.ruleid) + } path.WriteString(r.ruleid) method = http.MethodGet @@ -125,15 +139,15 @@ func (r *GetSynonymRule) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -150,27 +164,66 @@ func (r *GetSynonymRule) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetSynonymRule) Perform(ctx context.Context) (*http.Response, error) { +func (r GetSynonymRule) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "synonyms.get_synonym_rule") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "synonyms.get_synonym_rule") + if reader := instrument.RecordRequestBody(ctx, "synonyms.get_synonym_rule", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "synonyms.get_synonym_rule") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetSynonymRule query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetSynonymRule query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getsynonymrule.Response -func (r GetSynonymRule) Do(ctx context.Context) (*Response, error) { +func (r GetSynonymRule) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "synonyms.get_synonym_rule") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -178,6 +231,9 @@ func (r GetSynonymRule) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -187,6 +243,9 @@ func (r GetSynonymRule) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -194,12 +253,25 @@ func (r GetSynonymRule) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetSynonymRule) IsSuccess(ctx context.Context) (bool, error) { +func (r GetSynonymRule) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "synonyms.get_synonym_rule") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -215,6 +287,14 @@ func (r GetSynonymRule) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetSynonymRule query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/getsynonymrule/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/getsynonymrule/response.go index 05bd7a76d..97d4b3d08 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/getsynonymrule/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/getsynonymrule/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getsynonymrule // Response holds the response body struct for the package getsynonymrule // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/synonyms/get_synonym_rule/SynonymRuleGetResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/synonyms/get_synonym_rule/SynonymRuleGetResponse.ts#L22-L24 type Response struct { // Id Synonym Rule identifier diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/getsynonymssets/get_synonyms_sets.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/getsynonymssets/get_synonyms_sets.go index 3070797d4..7728a09b1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/getsynonymssets/get_synonyms_sets.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/getsynonymssets/get_synonyms_sets.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves a summary of all defined synonym sets package getsynonymssets import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -48,9 +47,13 @@ type GetSynonymsSets struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetSynonymsSets type alias for index. @@ -74,7 +77,12 @@ func New(tp elastictransport.Interface) *GetSynonymsSets { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -107,9 +115,9 @@ func (r *GetSynonymsSets) HttpRequest(ctx context.Context) (*http.Request, error } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -126,27 +134,66 @@ func (r *GetSynonymsSets) HttpRequest(ctx context.Context) (*http.Request, error } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetSynonymsSets) Perform(ctx context.Context) (*http.Response, error) { +func (r GetSynonymsSets) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "synonyms.get_synonyms_sets") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "synonyms.get_synonyms_sets") + if reader := instrument.RecordRequestBody(ctx, "synonyms.get_synonyms_sets", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "synonyms.get_synonyms_sets") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetSynonymsSets query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetSynonymsSets query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getsynonymssets.Response -func (r GetSynonymsSets) Do(ctx context.Context) (*Response, error) { +func (r GetSynonymsSets) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "synonyms.get_synonyms_sets") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -154,6 +201,9 @@ func (r GetSynonymsSets) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -163,6 +213,9 @@ func (r GetSynonymsSets) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -170,12 +223,25 @@ func (r GetSynonymsSets) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetSynonymsSets) IsSuccess(ctx context.Context) (bool, error) { +func (r GetSynonymsSets) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "synonyms.get_synonyms_sets") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -191,6 +257,14 @@ func (r GetSynonymsSets) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetSynonymsSets query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/getsynonymssets/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/getsynonymssets/response.go index 0bc1e60b4..78f13a25d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/getsynonymssets/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/getsynonymssets/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getsynonymssets @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getsynonymssets // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/synonyms/get_synonyms_sets/SynonymsSetsGetResponse.ts#L23-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/synonyms/get_synonyms_sets/SynonymsSetsGetResponse.ts#L23-L28 type Response struct { Count int `json:"count"` Results []types.SynonymsSetItem `json:"results"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/putsynonym/put_synonym.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/putsynonym/put_synonym.go index 4410637cd..63cea84e7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/putsynonym/put_synonym.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/putsynonym/put_synonym.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates or updates a synonyms set package putsynonym @@ -50,15 +50,19 @@ type PutSynonym struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutSynonym type alias for index. @@ -84,11 +88,18 @@ func New(tp elastictransport.Interface) *PutSynonym { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -125,9 +136,7 @@ func (r *PutSynonym) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -139,6 +148,10 @@ func (r *PutSynonym) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -147,6 +160,9 @@ func (r *PutSynonym) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_synonyms") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodPut @@ -160,15 +176,15 @@ func (r *PutSynonym) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -185,27 +201,66 @@ func (r *PutSynonym) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutSynonym) Perform(ctx context.Context) (*http.Response, error) { +func (r PutSynonym) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "synonyms.put_synonym") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "synonyms.put_synonym") + if reader := instrument.RecordRequestBody(ctx, "synonyms.put_synonym", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "synonyms.put_synonym") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutSynonym query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutSynonym query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a putsynonym.Response -func (r PutSynonym) Do(ctx context.Context) (*Response, error) { +func (r PutSynonym) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "synonyms.put_synonym") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -213,6 +268,9 @@ func (r PutSynonym) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -222,6 +280,9 @@ func (r PutSynonym) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -229,6 +290,9 @@ func (r PutSynonym) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/putsynonym/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/putsynonym/request.go index 77df29328..8921efde0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/putsynonym/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/putsynonym/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putsynonym @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package putsynonym // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/synonyms/put_synonym/SynonymsPutRequest.ts#L23-L42 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/synonyms/put_synonym/SynonymsPutRequest.ts#L23-L42 type Request struct { // SynonymsSet The synonym set information to update diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/putsynonym/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/putsynonym/response.go index a1b009085..98eec2b2d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/putsynonym/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/putsynonym/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putsynonym @@ -27,7 +27,7 @@ import ( // Response holds the response body struct for the package putsynonym // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/synonyms/put_synonym/SynonymsPutResponse.ts#L24-L29 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/synonyms/put_synonym/SynonymsPutResponse.ts#L24-L29 type Response struct { ReloadAnalyzersDetails types.ReloadDetails `json:"reload_analyzers_details"` Result result.Result `json:"result"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/putsynonymrule/put_synonym_rule.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/putsynonymrule/put_synonym_rule.go index ced8ddc14..03fbc14e0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/putsynonymrule/put_synonym_rule.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/putsynonymrule/put_synonym_rule.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates or updates a synonym rule in a synonym set package putsynonymrule @@ -52,16 +52,20 @@ type PutSynonymRule struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int setid string ruleid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutSynonymRule type alias for index. @@ -89,11 +93,18 @@ func New(tp elastictransport.Interface) *PutSynonymRule { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -130,9 +141,7 @@ func (r *PutSynonymRule) HttpRequest(ctx context.Context) (*http.Request, error) } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -144,6 +153,10 @@ func (r *PutSynonymRule) HttpRequest(ctx context.Context) (*http.Request, error) } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -152,9 +165,15 @@ func (r *PutSynonymRule) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("_synonyms") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "setid", r.setid) + } path.WriteString(r.setid) path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "ruleid", r.ruleid) + } path.WriteString(r.ruleid) method = http.MethodPut @@ -168,15 +187,15 @@ func (r *PutSynonymRule) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -193,27 +212,66 @@ func (r *PutSynonymRule) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutSynonymRule) Perform(ctx context.Context) (*http.Response, error) { +func (r PutSynonymRule) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "synonyms.put_synonym_rule") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "synonyms.put_synonym_rule") + if reader := instrument.RecordRequestBody(ctx, "synonyms.put_synonym_rule", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "synonyms.put_synonym_rule") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutSynonymRule query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutSynonymRule query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a putsynonymrule.Response -func (r PutSynonymRule) Do(ctx context.Context) (*Response, error) { +func (r PutSynonymRule) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "synonyms.put_synonym_rule") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -221,6 +279,9 @@ func (r PutSynonymRule) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -230,6 +291,9 @@ func (r PutSynonymRule) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -237,6 +301,9 @@ func (r PutSynonymRule) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/putsynonymrule/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/putsynonymrule/request.go index e292fc363..797f170eb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/putsynonymrule/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/putsynonymrule/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putsynonymrule @@ -27,7 +27,7 @@ import ( // Request holds the request body struct for the package putsynonymrule // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/synonyms/put_synonym_rule/SynonymRulePutRequest.ts#L23-L47 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/synonyms/put_synonym_rule/SynonymRulePutRequest.ts#L23-L47 type Request struct { Synonyms []string `json:"synonyms"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/putsynonymrule/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/putsynonymrule/response.go index b4c712366..864931340 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/putsynonymrule/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/synonyms/putsynonymrule/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putsynonymrule @@ -27,7 +27,7 @@ import ( // Response holds the response body struct for the package putsynonymrule // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/synonyms/put_synonym_rule/SynonymRulePutResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/synonyms/put_synonym_rule/SynonymRulePutResponse.ts#L22-L24 type Response struct { // ReloadAnalyzersDetails Updating synonyms in a synonym set reloads the associated analyzers. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/tasks/cancel/cancel.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/tasks/cancel/cancel.go index 72facc4e3..aa8cc9afa 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/tasks/cancel/cancel.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/tasks/cancel/cancel.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Cancels a task, if it can be cancelled through an API. package cancel import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type Cancel struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int taskid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewCancel type alias for index. @@ -80,7 +83,12 @@ func New(tp elastictransport.Interface) *Cancel { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -110,6 +118,9 @@ func (r *Cancel) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_tasks") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "taskid", r.taskid) + } path.WriteString(r.taskid) path.WriteString("/") path.WriteString("_cancel") @@ -125,9 +136,9 @@ func (r *Cancel) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -144,27 +155,66 @@ func (r *Cancel) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Cancel) Perform(ctx context.Context) (*http.Response, error) { +func (r Cancel) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "tasks.cancel") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "tasks.cancel") + if reader := instrument.RecordRequestBody(ctx, "tasks.cancel", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "tasks.cancel") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Cancel query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Cancel query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a cancel.Response -func (r Cancel) Do(ctx context.Context) (*Response, error) { +func (r Cancel) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "tasks.cancel") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -172,6 +222,9 @@ func (r Cancel) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -181,6 +234,9 @@ func (r Cancel) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -188,12 +244,25 @@ func (r Cancel) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Cancel) IsSuccess(ctx context.Context) (bool, error) { +func (r Cancel) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "tasks.cancel") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -209,6 +278,14 @@ func (r Cancel) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Cancel query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/tasks/cancel/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/tasks/cancel/response.go index ecbfa917e..1882ffa5d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/tasks/cancel/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/tasks/cancel/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package cancel @@ -31,7 +31,7 @@ import ( // Response holds the response body struct for the package cancel // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/tasks/cancel/CancelTasksResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/tasks/cancel/CancelTasksResponse.ts#L22-L24 type Response struct { NodeFailures []types.ErrorCause `json:"node_failures,omitempty"` // Nodes Task information grouped by node, if `group_by` was set to `node` (the diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/tasks/get/get.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/tasks/get/get.go index 21e8740e5..c34c9cb67 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/tasks/get/get.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/tasks/get/get.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns information about a task. package get import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type Get struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int taskid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGet type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *Get { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -105,6 +113,9 @@ func (r *Get) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_tasks") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "taskid", r.taskid) + } path.WriteString(r.taskid) method = http.MethodGet @@ -118,9 +129,9 @@ func (r *Get) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -137,27 +148,66 @@ func (r *Get) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Get) Perform(ctx context.Context) (*http.Response, error) { +func (r Get) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "tasks.get") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "tasks.get") + if reader := instrument.RecordRequestBody(ctx, "tasks.get", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "tasks.get") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Get query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Get query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a get.Response -func (r Get) Do(ctx context.Context) (*Response, error) { +func (r Get) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "tasks.get") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -165,6 +215,9 @@ func (r Get) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -174,6 +227,9 @@ func (r Get) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -181,12 +237,25 @@ func (r Get) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Get) IsSuccess(ctx context.Context) (bool, error) { +func (r Get) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "tasks.get") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -202,6 +271,14 @@ func (r Get) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Get query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/tasks/get/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/tasks/get/response.go index e07d1c5f5..97edc8df0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/tasks/get/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/tasks/get/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package get @@ -28,7 +28,7 @@ import ( // Response holds the response body struct for the package get // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/tasks/get/GetTaskResponse.ts#L24-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/tasks/get/GetTaskResponse.ts#L24-L31 type Response struct { Completed bool `json:"completed"` Error *types.ErrorCause `json:"error,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/tasks/list/list.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/tasks/list/list.go index 060400ae3..15044210e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/tasks/list/list.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/tasks/list/list.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Returns a list of tasks. package list import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -49,9 +48,13 @@ type List struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewList type alias for index. @@ -75,7 +78,12 @@ func New(tp elastictransport.Interface) *List { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,9 +116,9 @@ func (r *List) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -127,27 +135,66 @@ func (r *List) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r List) Perform(ctx context.Context) (*http.Response, error) { +func (r List) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "tasks.list") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "tasks.list") + if reader := instrument.RecordRequestBody(ctx, "tasks.list", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "tasks.list") + } if err != nil { - return nil, fmt.Errorf("an error happened during the List query execution: %w", err) + localErr := fmt.Errorf("an error happened during the List query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a list.Response -func (r List) Do(ctx context.Context) (*Response, error) { +func (r List) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "tasks.list") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -155,6 +202,9 @@ func (r List) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -164,6 +214,9 @@ func (r List) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -171,12 +224,25 @@ func (r List) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r List) IsSuccess(ctx context.Context) (bool, error) { +func (r List) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "tasks.list") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -192,6 +258,14 @@ func (r List) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the List query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/tasks/list/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/tasks/list/response.go index 9c74f3725..98370aed8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/tasks/list/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/tasks/list/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package list @@ -31,7 +31,7 @@ import ( // Response holds the response body struct for the package list // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/tasks/list/ListTasksResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/tasks/list/ListTasksResponse.ts#L22-L24 type Response struct { NodeFailures []types.ErrorCause `json:"node_failures,omitempty"` // Nodes Task information grouped by node, if `group_by` was set to `node` (the diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/textstructure/findstructure/find_structure.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/textstructure/findstructure/find_structure.go index 0601f6682..8d36aedfe 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/textstructure/findstructure/find_structure.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/textstructure/findstructure/find_structure.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Finds the structure of a text file. The text file must contain data that is // suitable to be ingested into Elasticsearch. @@ -48,13 +48,17 @@ type FindStructure struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewFindStructure type alias for index. @@ -79,7 +83,14 @@ func New(tp elastictransport.Interface) *FindStructure { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -118,9 +129,7 @@ func (r *FindStructure) HttpRequest(ctx context.Context) (*http.Request, error) } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { for _, elem := range *r.req { data, err := json.Marshal(elem) @@ -137,6 +146,10 @@ func (r *FindStructure) HttpRequest(ctx context.Context) (*http.Request, error) } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -157,15 +170,15 @@ func (r *FindStructure) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+x-ndjson;compatible-with=8") } } @@ -182,27 +195,66 @@ func (r *FindStructure) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r FindStructure) Perform(ctx context.Context) (*http.Response, error) { +func (r FindStructure) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "text_structure.find_structure") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "text_structure.find_structure") + if reader := instrument.RecordRequestBody(ctx, "text_structure.find_structure", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "text_structure.find_structure") + } if err != nil { - return nil, fmt.Errorf("an error happened during the FindStructure query execution: %w", err) + localErr := fmt.Errorf("an error happened during the FindStructure query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a findstructure.Response -func (r FindStructure) Do(ctx context.Context) (*Response, error) { +func (r FindStructure) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "text_structure.find_structure") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -210,6 +262,9 @@ func (r FindStructure) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -219,6 +274,9 @@ func (r FindStructure) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -226,6 +284,9 @@ func (r FindStructure) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/textstructure/findstructure/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/textstructure/findstructure/request.go index cf4c5c387..60f843501 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/textstructure/findstructure/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/textstructure/findstructure/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package findstructure @@ -26,5 +26,5 @@ import ( // Request holds the request body struct for the package findstructure // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/text_structure/find_structure/FindStructureRequest.ts#L24-L73 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/text_structure/find_structure/FindStructureRequest.ts#L24-L73 type Request = []json.RawMessage diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/textstructure/findstructure/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/textstructure/findstructure/response.go index 772591b43..67e599c82 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/textstructure/findstructure/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/textstructure/findstructure/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package findstructure @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package findstructure // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/text_structure/find_structure/FindStructureResponse.ts#L27-L52 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/text_structure/find_structure/FindStructureResponse.ts#L27-L52 type Response struct { Charset string `json:"charset"` ColumnNames []string `json:"column_names,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/deletetransform/delete_transform.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/deletetransform/delete_transform.go index 5f473853b..b0ec96d2f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/deletetransform/delete_transform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/deletetransform/delete_transform.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deletes an existing transform. package deletetransform import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type DeleteTransform struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int transformid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteTransform type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *DeleteTransform { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -105,6 +113,9 @@ func (r *DeleteTransform) HttpRequest(ctx context.Context) (*http.Request, error path.WriteString("_transform") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "transformid", r.transformid) + } path.WriteString(r.transformid) method = http.MethodDelete @@ -118,9 +129,9 @@ func (r *DeleteTransform) HttpRequest(ctx context.Context) (*http.Request, error } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -137,27 +148,66 @@ func (r *DeleteTransform) HttpRequest(ctx context.Context) (*http.Request, error } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteTransform) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteTransform) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "transform.delete_transform") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "transform.delete_transform") + if reader := instrument.RecordRequestBody(ctx, "transform.delete_transform", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "transform.delete_transform") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteTransform query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteTransform query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deletetransform.Response -func (r DeleteTransform) Do(ctx context.Context) (*Response, error) { +func (r DeleteTransform) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "transform.delete_transform") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -165,6 +215,9 @@ func (r DeleteTransform) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -174,6 +227,9 @@ func (r DeleteTransform) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -181,12 +237,25 @@ func (r DeleteTransform) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteTransform) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteTransform) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "transform.delete_transform") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -202,6 +271,14 @@ func (r DeleteTransform) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteTransform query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/deletetransform/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/deletetransform/response.go index a6011aafc..5eceea841 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/deletetransform/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/deletetransform/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deletetransform // Response holds the response body struct for the package deletetransform // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/transform/delete_transform/DeleteTransformResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/transform/delete_transform/DeleteTransformResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/gettransform/get_transform.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/gettransform/get_transform.go index 4e7e53989..8218f9dba 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/gettransform/get_transform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/gettransform/get_transform.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves configuration information for transforms. package gettransform import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type GetTransform struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int transformid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetTransform type alias for index. @@ -80,7 +83,12 @@ func New(tp elastictransport.Interface) *GetTransform { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -103,6 +111,9 @@ func (r *GetTransform) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_transform") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "transformid", r.transformid) + } path.WriteString(r.transformid) method = http.MethodGet @@ -121,9 +132,9 @@ func (r *GetTransform) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -140,27 +151,66 @@ func (r *GetTransform) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetTransform) Perform(ctx context.Context) (*http.Response, error) { +func (r GetTransform) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "transform.get_transform") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "transform.get_transform") + if reader := instrument.RecordRequestBody(ctx, "transform.get_transform", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "transform.get_transform") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetTransform query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetTransform query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a gettransform.Response -func (r GetTransform) Do(ctx context.Context) (*Response, error) { +func (r GetTransform) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "transform.get_transform") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -168,6 +218,9 @@ func (r GetTransform) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -177,6 +230,9 @@ func (r GetTransform) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,12 +240,25 @@ func (r GetTransform) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetTransform) IsSuccess(ctx context.Context) (bool, error) { +func (r GetTransform) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "transform.get_transform") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -205,6 +274,14 @@ func (r GetTransform) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetTransform query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/gettransform/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/gettransform/response.go index c315c6a0e..032b95196 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/gettransform/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/gettransform/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package gettransform @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package gettransform // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/transform/get_transform/GetTransformResponse.ts#L23-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/transform/get_transform/GetTransformResponse.ts#L23-L25 type Response struct { Count int64 `json:"count"` Transforms []types.TransformSummary `json:"transforms"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/gettransformstats/get_transform_stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/gettransformstats/get_transform_stats.go index cd1653690..f5e42e2fa 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/gettransformstats/get_transform_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/gettransformstats/get_transform_stats.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves usage information for transforms. package gettransformstats import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type GetTransformStats struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int transformid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetTransformStats type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *GetTransformStats { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -105,6 +113,9 @@ func (r *GetTransformStats) HttpRequest(ctx context.Context) (*http.Request, err path.WriteString("_transform") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "transformid", r.transformid) + } path.WriteString(r.transformid) path.WriteString("/") path.WriteString("_stats") @@ -120,9 +131,9 @@ func (r *GetTransformStats) HttpRequest(ctx context.Context) (*http.Request, err } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -139,27 +150,66 @@ func (r *GetTransformStats) HttpRequest(ctx context.Context) (*http.Request, err } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetTransformStats) Perform(ctx context.Context) (*http.Response, error) { +func (r GetTransformStats) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "transform.get_transform_stats") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "transform.get_transform_stats") + if reader := instrument.RecordRequestBody(ctx, "transform.get_transform_stats", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "transform.get_transform_stats") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetTransformStats query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetTransformStats query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a gettransformstats.Response -func (r GetTransformStats) Do(ctx context.Context) (*Response, error) { +func (r GetTransformStats) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "transform.get_transform_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -167,6 +217,9 @@ func (r GetTransformStats) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -176,6 +229,9 @@ func (r GetTransformStats) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -183,12 +239,25 @@ func (r GetTransformStats) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetTransformStats) IsSuccess(ctx context.Context) (bool, error) { +func (r GetTransformStats) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "transform.get_transform_stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -204,6 +273,14 @@ func (r GetTransformStats) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetTransformStats query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/gettransformstats/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/gettransformstats/response.go index ff378063d..e2375647d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/gettransformstats/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/gettransformstats/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package gettransformstats @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package gettransformstats // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/transform/get_transform_stats/GetTransformStatsResponse.ts#L23-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/transform/get_transform_stats/GetTransformStatsResponse.ts#L23-L25 type Response struct { Count int64 `json:"count"` Transforms []types.TransformStats `json:"transforms"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/previewtransform/preview_transform.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/previewtransform/preview_transform.go index 13ce3ed15..39d887014 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/previewtransform/preview_transform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/previewtransform/preview_transform.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Previews a transform. package previewtransform @@ -50,15 +50,19 @@ type PreviewTransform struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int transformid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPreviewTransform type alias for index. @@ -82,11 +86,18 @@ func New(tp elastictransport.Interface) *PreviewTransform { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -123,9 +134,7 @@ func (r *PreviewTransform) HttpRequest(ctx context.Context) (*http.Request, erro } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -137,6 +146,10 @@ func (r *PreviewTransform) HttpRequest(ctx context.Context) (*http.Request, erro } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -145,6 +158,9 @@ func (r *PreviewTransform) HttpRequest(ctx context.Context) (*http.Request, erro path.WriteString("_transform") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "transformid", r.transformid) + } path.WriteString(r.transformid) path.WriteString("/") path.WriteString("_preview") @@ -167,15 +183,15 @@ func (r *PreviewTransform) HttpRequest(ctx context.Context) (*http.Request, erro } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -192,27 +208,66 @@ func (r *PreviewTransform) HttpRequest(ctx context.Context) (*http.Request, erro } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PreviewTransform) Perform(ctx context.Context) (*http.Response, error) { +func (r PreviewTransform) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "transform.preview_transform") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "transform.preview_transform") + if reader := instrument.RecordRequestBody(ctx, "transform.preview_transform", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "transform.preview_transform") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PreviewTransform query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PreviewTransform query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a previewtransform.Response -func (r PreviewTransform) Do(ctx context.Context) (*Response, error) { +func (r PreviewTransform) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "transform.preview_transform") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -220,6 +275,9 @@ func (r PreviewTransform) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -229,6 +287,9 @@ func (r PreviewTransform) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -236,6 +297,9 @@ func (r PreviewTransform) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/previewtransform/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/previewtransform/request.go index 422861ab0..6fea6da3b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/previewtransform/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/previewtransform/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package previewtransform @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package previewtransform // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/transform/preview_transform/PreviewTransformRequest.ts#L33-L107 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/transform/preview_transform/PreviewTransformRequest.ts#L33-L107 type Request struct { // Description Free text description of the transform. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/previewtransform/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/previewtransform/response.go index 6eec38f24..26cdfa21a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/previewtransform/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/previewtransform/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package previewtransform @@ -28,7 +28,7 @@ import ( // Response holds the response body struct for the package previewtransform // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/transform/preview_transform/PreviewTransformResponse.ts#L22-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/transform/preview_transform/PreviewTransformResponse.ts#L22-L27 type Response struct { GeneratedDestIndex types.IndexState `json:"generated_dest_index"` Preview []json.RawMessage `json:"preview"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/puttransform/put_transform.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/puttransform/put_transform.go index 7c3d5e549..15ee637b9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/puttransform/put_transform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/puttransform/put_transform.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Instantiates a transform. package puttransform @@ -51,15 +51,19 @@ type PutTransform struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int transformid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutTransform type alias for index. @@ -85,11 +89,18 @@ func New(tp elastictransport.Interface) *PutTransform { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -126,9 +137,7 @@ func (r *PutTransform) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -140,6 +149,10 @@ func (r *PutTransform) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -148,6 +161,9 @@ func (r *PutTransform) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("_transform") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "transformid", r.transformid) + } path.WriteString(r.transformid) method = http.MethodPut @@ -161,15 +177,15 @@ func (r *PutTransform) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -186,27 +202,66 @@ func (r *PutTransform) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutTransform) Perform(ctx context.Context) (*http.Response, error) { +func (r PutTransform) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "transform.put_transform") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "transform.put_transform") + if reader := instrument.RecordRequestBody(ctx, "transform.put_transform", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "transform.put_transform") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutTransform query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutTransform query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a puttransform.Response -func (r PutTransform) Do(ctx context.Context) (*Response, error) { +func (r PutTransform) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "transform.put_transform") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -214,6 +269,9 @@ func (r PutTransform) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -223,6 +281,9 @@ func (r PutTransform) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -230,6 +291,9 @@ func (r PutTransform) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/puttransform/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/puttransform/request.go index bf89c177a..fb103f9f6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/puttransform/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/puttransform/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package puttransform @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package puttransform // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/transform/put_transform/PutTransformRequest.ts#L33-L122 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/transform/put_transform/PutTransformRequest.ts#L33-L122 type Request struct { // Description Free text description of the transform. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/puttransform/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/puttransform/response.go index cecff3a56..cdd446262 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/puttransform/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/puttransform/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package puttransform // Response holds the response body struct for the package puttransform // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/transform/put_transform/PutTransformResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/transform/put_transform/PutTransformResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/resettransform/reset_transform.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/resettransform/reset_transform.go index 29f1bf0b8..6c305a0fc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/resettransform/reset_transform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/resettransform/reset_transform.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Resets an existing transform. package resettransform import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type ResetTransform struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int transformid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewResetTransform type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *ResetTransform { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -105,6 +113,9 @@ func (r *ResetTransform) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("_transform") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "transformid", r.transformid) + } path.WriteString(r.transformid) path.WriteString("/") path.WriteString("_reset") @@ -120,9 +131,9 @@ func (r *ResetTransform) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -139,27 +150,66 @@ func (r *ResetTransform) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ResetTransform) Perform(ctx context.Context) (*http.Response, error) { +func (r ResetTransform) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "transform.reset_transform") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "transform.reset_transform") + if reader := instrument.RecordRequestBody(ctx, "transform.reset_transform", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "transform.reset_transform") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ResetTransform query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ResetTransform query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a resettransform.Response -func (r ResetTransform) Do(ctx context.Context) (*Response, error) { +func (r ResetTransform) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "transform.reset_transform") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -167,6 +217,9 @@ func (r ResetTransform) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -176,6 +229,9 @@ func (r ResetTransform) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -183,12 +239,25 @@ func (r ResetTransform) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ResetTransform) IsSuccess(ctx context.Context) (bool, error) { +func (r ResetTransform) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "transform.reset_transform") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -204,6 +273,14 @@ func (r ResetTransform) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ResetTransform query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/resettransform/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/resettransform/response.go index f059d92f0..44a6a73c0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/resettransform/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/resettransform/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package resettransform // Response holds the response body struct for the package resettransform // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/transform/reset_transform/ResetTransformResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/transform/reset_transform/ResetTransformResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/schedulenowtransform/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/schedulenowtransform/response.go index 832ace763..7ed935939 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/schedulenowtransform/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/schedulenowtransform/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package schedulenowtransform // Response holds the response body struct for the package schedulenowtransform // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/transform/schedule_now_transform/ScheduleNowTransformResponse.ts#L21-L23 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/transform/schedule_now_transform/ScheduleNowTransformResponse.ts#L21-L23 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/schedulenowtransform/schedule_now_transform.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/schedulenowtransform/schedule_now_transform.go index 7fd7bc471..51f3a7045 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/schedulenowtransform/schedule_now_transform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/schedulenowtransform/schedule_now_transform.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Schedules now a transform. package schedulenowtransform import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type ScheduleNowTransform struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int transformid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewScheduleNowTransform type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *ScheduleNowTransform { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *ScheduleNowTransform) HttpRequest(ctx context.Context) (*http.Request, path.WriteString("_transform") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "transformid", r.transformid) + } path.WriteString(r.transformid) path.WriteString("/") path.WriteString("_schedule_now") @@ -119,15 +130,15 @@ func (r *ScheduleNowTransform) HttpRequest(ctx context.Context) (*http.Request, } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -144,27 +155,66 @@ func (r *ScheduleNowTransform) HttpRequest(ctx context.Context) (*http.Request, } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ScheduleNowTransform) Perform(ctx context.Context) (*http.Response, error) { +func (r ScheduleNowTransform) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "transform.schedule_now_transform") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "transform.schedule_now_transform") + if reader := instrument.RecordRequestBody(ctx, "transform.schedule_now_transform", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "transform.schedule_now_transform") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ScheduleNowTransform query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ScheduleNowTransform query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a schedulenowtransform.Response -func (r ScheduleNowTransform) Do(ctx context.Context) (*Response, error) { +func (r ScheduleNowTransform) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "transform.schedule_now_transform") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -172,6 +222,9 @@ func (r ScheduleNowTransform) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -181,6 +234,9 @@ func (r ScheduleNowTransform) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -188,12 +244,25 @@ func (r ScheduleNowTransform) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ScheduleNowTransform) IsSuccess(ctx context.Context) (bool, error) { +func (r ScheduleNowTransform) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "transform.schedule_now_transform") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -209,6 +278,14 @@ func (r ScheduleNowTransform) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ScheduleNowTransform query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/starttransform/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/starttransform/response.go index e8f44578f..ad506c1f0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/starttransform/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/starttransform/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package starttransform // Response holds the response body struct for the package starttransform // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/transform/start_transform/StartTransformResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/transform/start_transform/StartTransformResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/starttransform/start_transform.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/starttransform/start_transform.go index 3981c05fb..06deeb905 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/starttransform/start_transform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/starttransform/start_transform.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Starts one or more transforms. package starttransform import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type StartTransform struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int transformid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewStartTransform type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *StartTransform { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -104,6 +112,9 @@ func (r *StartTransform) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("_transform") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "transformid", r.transformid) + } path.WriteString(r.transformid) path.WriteString("/") path.WriteString("_start") @@ -119,9 +130,9 @@ func (r *StartTransform) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -138,27 +149,66 @@ func (r *StartTransform) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r StartTransform) Perform(ctx context.Context) (*http.Response, error) { +func (r StartTransform) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "transform.start_transform") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "transform.start_transform") + if reader := instrument.RecordRequestBody(ctx, "transform.start_transform", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "transform.start_transform") + } if err != nil { - return nil, fmt.Errorf("an error happened during the StartTransform query execution: %w", err) + localErr := fmt.Errorf("an error happened during the StartTransform query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a starttransform.Response -func (r StartTransform) Do(ctx context.Context) (*Response, error) { +func (r StartTransform) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "transform.start_transform") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -166,6 +216,9 @@ func (r StartTransform) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,6 +228,9 @@ func (r StartTransform) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,12 +238,25 @@ func (r StartTransform) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r StartTransform) IsSuccess(ctx context.Context) (bool, error) { +func (r StartTransform) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "transform.start_transform") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -203,6 +272,14 @@ func (r StartTransform) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the StartTransform query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/stoptransform/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/stoptransform/response.go index 272eb2279..7d0ca040c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/stoptransform/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/stoptransform/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package stoptransform // Response holds the response body struct for the package stoptransform // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/transform/stop_transform/StopTransformResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/transform/stop_transform/StopTransformResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/stoptransform/stop_transform.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/stoptransform/stop_transform.go index 63c4ad957..ba16f10ea 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/stoptransform/stop_transform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/stoptransform/stop_transform.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Stops one or more transforms. package stoptransform import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type StopTransform struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int transformid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewStopTransform type alias for index. @@ -82,7 +85,12 @@ func New(tp elastictransport.Interface) *StopTransform { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -105,6 +113,9 @@ func (r *StopTransform) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("_transform") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "transformid", r.transformid) + } path.WriteString(r.transformid) path.WriteString("/") path.WriteString("_stop") @@ -120,9 +131,9 @@ func (r *StopTransform) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -139,27 +150,66 @@ func (r *StopTransform) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r StopTransform) Perform(ctx context.Context) (*http.Response, error) { +func (r StopTransform) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "transform.stop_transform") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "transform.stop_transform") + if reader := instrument.RecordRequestBody(ctx, "transform.stop_transform", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "transform.stop_transform") + } if err != nil { - return nil, fmt.Errorf("an error happened during the StopTransform query execution: %w", err) + localErr := fmt.Errorf("an error happened during the StopTransform query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a stoptransform.Response -func (r StopTransform) Do(ctx context.Context) (*Response, error) { +func (r StopTransform) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "transform.stop_transform") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -167,6 +217,9 @@ func (r StopTransform) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -176,6 +229,9 @@ func (r StopTransform) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -183,12 +239,25 @@ func (r StopTransform) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r StopTransform) IsSuccess(ctx context.Context) (bool, error) { +func (r StopTransform) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "transform.stop_transform") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -204,6 +273,14 @@ func (r StopTransform) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the StopTransform query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/updatetransform/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/updatetransform/request.go index e4caff874..fb63a7013 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/updatetransform/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/updatetransform/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package updatetransform @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package updatetransform // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/transform/update_transform/UpdateTransformRequest.ts#L31-L105 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/transform/update_transform/UpdateTransformRequest.ts#L31-L105 type Request struct { // Description Free text description of the transform. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/updatetransform/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/updatetransform/response.go index bf22ed7ef..ae1bba7f1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/updatetransform/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/updatetransform/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package updatetransform @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package updatetransform // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/transform/update_transform/UpdateTransformResponse.ts#L33-L51 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/transform/update_transform/UpdateTransformResponse.ts#L33-L51 type Response struct { Authorization *types.TransformAuthorization `json:"authorization,omitempty"` CreateTime int64 `json:"create_time"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/updatetransform/update_transform.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/updatetransform/update_transform.go index b453ef655..b57f4909e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/updatetransform/update_transform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/updatetransform/update_transform.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Updates certain properties of a transform. package updatetransform @@ -51,15 +51,19 @@ type UpdateTransform struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int transformid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewUpdateTransform type alias for index. @@ -85,11 +89,18 @@ func New(tp elastictransport.Interface) *UpdateTransform { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -126,9 +137,7 @@ func (r *UpdateTransform) HttpRequest(ctx context.Context) (*http.Request, error } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -140,6 +149,10 @@ func (r *UpdateTransform) HttpRequest(ctx context.Context) (*http.Request, error } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -148,6 +161,9 @@ func (r *UpdateTransform) HttpRequest(ctx context.Context) (*http.Request, error path.WriteString("_transform") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "transformid", r.transformid) + } path.WriteString(r.transformid) path.WriteString("/") path.WriteString("_update") @@ -163,15 +179,15 @@ func (r *UpdateTransform) HttpRequest(ctx context.Context) (*http.Request, error } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -188,27 +204,66 @@ func (r *UpdateTransform) HttpRequest(ctx context.Context) (*http.Request, error } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r UpdateTransform) Perform(ctx context.Context) (*http.Response, error) { +func (r UpdateTransform) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "transform.update_transform") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "transform.update_transform") + if reader := instrument.RecordRequestBody(ctx, "transform.update_transform", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "transform.update_transform") + } if err != nil { - return nil, fmt.Errorf("an error happened during the UpdateTransform query execution: %w", err) + localErr := fmt.Errorf("an error happened during the UpdateTransform query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a updatetransform.Response -func (r UpdateTransform) Do(ctx context.Context) (*Response, error) { +func (r UpdateTransform) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "transform.update_transform") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -216,6 +271,9 @@ func (r UpdateTransform) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -225,6 +283,9 @@ func (r UpdateTransform) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -232,6 +293,9 @@ func (r UpdateTransform) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/upgradetransforms/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/upgradetransforms/response.go index 5ce110c24..a6cfbfa04 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/upgradetransforms/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/upgradetransforms/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package upgradetransforms // Response holds the response body struct for the package upgradetransforms // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/transform/upgrade_transforms/UpgradeTransformsResponse.ts#L25-L34 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/transform/upgrade_transforms/UpgradeTransformsResponse.ts#L25-L34 type Response struct { // NeedsUpdate The number of transforms that need to be upgraded. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/upgradetransforms/upgrade_transforms.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/upgradetransforms/upgrade_transforms.go index 452794c21..cbb59b823 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/upgradetransforms/upgrade_transforms.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/transform/upgradetransforms/upgrade_transforms.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Upgrades all transforms. package upgradetransforms import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -48,9 +47,13 @@ type UpgradeTransforms struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewUpgradeTransforms type alias for index. @@ -74,7 +77,12 @@ func New(tp elastictransport.Interface) *UpgradeTransforms { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -109,15 +117,15 @@ func (r *UpgradeTransforms) HttpRequest(ctx context.Context) (*http.Request, err } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -134,27 +142,66 @@ func (r *UpgradeTransforms) HttpRequest(ctx context.Context) (*http.Request, err } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r UpgradeTransforms) Perform(ctx context.Context) (*http.Response, error) { +func (r UpgradeTransforms) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "transform.upgrade_transforms") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "transform.upgrade_transforms") + if reader := instrument.RecordRequestBody(ctx, "transform.upgrade_transforms", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "transform.upgrade_transforms") + } if err != nil { - return nil, fmt.Errorf("an error happened during the UpgradeTransforms query execution: %w", err) + localErr := fmt.Errorf("an error happened during the UpgradeTransforms query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a upgradetransforms.Response -func (r UpgradeTransforms) Do(ctx context.Context) (*Response, error) { +func (r UpgradeTransforms) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "transform.upgrade_transforms") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -162,6 +209,9 @@ func (r UpgradeTransforms) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -171,6 +221,9 @@ func (r UpgradeTransforms) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -178,12 +231,25 @@ func (r UpgradeTransforms) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r UpgradeTransforms) IsSuccess(ctx context.Context) (bool, error) { +func (r UpgradeTransforms) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "transform.upgrade_transforms") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -199,6 +265,14 @@ func (r UpgradeTransforms) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the UpgradeTransforms query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/acknowledgement.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/acknowledgement.go index a4f346de4..d6f34b5a1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/acknowledgement.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/acknowledgement.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Acknowledgement type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/license/post/types.ts#L20-L23 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/license/post/types.ts#L20-L23 type Acknowledgement struct { License []string `json:"license"` Message string `json:"message"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/acknowledgestate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/acknowledgestate.go index 365391d9c..c80abcfd0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/acknowledgestate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/acknowledgestate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // AcknowledgeState type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Action.ts#L115-L118 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Action.ts#L115-L118 type AcknowledgeState struct { State acknowledgementoptions.AcknowledgementOptions `json:"state"` Timestamp DateTime `json:"timestamp"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/actionstatus.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/actionstatus.go index b35fa3ede..5443d0e60 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/actionstatus.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/actionstatus.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // ActionStatus type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Action.ts#L131-L136 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Action.ts#L131-L136 type ActionStatus struct { Ack AcknowledgeState `json:"ack"` LastExecution *ExecutionState `json:"last_execution,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/activationstate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/activationstate.go index 0a29443d0..8e3268284 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/activationstate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/activationstate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ActivationState type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Activation.ts#L24-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Activation.ts#L24-L27 type ActivationState struct { Active bool `json:"active"` Timestamp DateTime `json:"timestamp"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/activationstatus.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/activationstatus.go index c504a1f51..cb6cb96e0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/activationstatus.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/activationstatus.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // ActivationStatus type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Activation.ts#L29-L33 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Activation.ts#L29-L33 type ActivationStatus struct { Actions WatcherStatusActions `json:"actions"` State ActivationState `json:"state"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/adaptiveselection.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/adaptiveselection.go index cfa19098b..5ffc28454 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/adaptiveselection.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/adaptiveselection.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AdaptiveSelection type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L403-L432 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L403-L432 type AdaptiveSelection struct { // AvgQueueSize The exponentially weighted moving average queue size of search requests on // the keyed node. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/addaction.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/addaction.go index 8b974647f..fba75c69e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/addaction.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/addaction.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AddAction type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/update_aliases/types.ts#L41-L95 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/update_aliases/types.ts#L41-L95 type AddAction struct { // Alias Alias for the action. // Index alias names support date math. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/adjacencymatrixaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/adjacencymatrixaggregate.go index 3fb246e9a..ec43cbe18 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/adjacencymatrixaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/adjacencymatrixaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // AdjacencyMatrixAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L573-L575 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L573-L575 type AdjacencyMatrixAggregate struct { Buckets BucketsAdjacencyMatrixBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/adjacencymatrixaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/adjacencymatrixaggregation.go index 6380d046a..2801e1834 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/adjacencymatrixaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/adjacencymatrixaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AdjacencyMatrixAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L57-L63 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L57-L63 type AdjacencyMatrixAggregation struct { // Filters Filters used to create buckets. // At least one filter is required. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/adjacencymatrixbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/adjacencymatrixbucket.go index 33150d40a..82c4f514b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/adjacencymatrixbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/adjacencymatrixbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // AdjacencyMatrixBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L577-L579 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L577-L579 type AdjacencyMatrixBucket struct { Aggregations map[string]Aggregate `json:"-"` DocCount int64 `json:"doc_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregate.go index 3cb4a63c6..3259e0d4f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -92,5 +92,5 @@ package types // MatrixStatsAggregate // GeoLineAggregate // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L38-L123 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L38-L123 type Aggregate interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregatemetricdoubleproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregatemetricdoubleproperty.go index b17bfd724..bdfdb483c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregatemetricdoubleproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregatemetricdoubleproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -33,7 +33,7 @@ import ( // AggregateMetricDoubleProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/complex.ts#L59-L64 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/complex.ts#L59-L64 type AggregateMetricDoubleProperty struct { DefaultMetric string `json:"default_metric"` Dynamic *dynamicmapping.DynamicMapping `json:"dynamic,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregateorder.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregateorder.go index f970fc91e..580b98863 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregateorder.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregateorder.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // map[string]sortorder.SortOrder // []map[string]sortorder.SortOrder // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L976-L978 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L976-L978 type AggregateOrder interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregateoutput.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregateoutput.go index 8bee4b0e4..71a2b4240 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregateoutput.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregateoutput.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // AggregateOutput type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/put_trained_model/types.ts#L101-L106 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/put_trained_model/types.ts#L101-L106 type AggregateOutput struct { Exponent *Weights `json:"exponent,omitempty"` LogisticRegression *Weights `json:"logistic_regression,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregation.go index 2ceaed5e9..13cb4c559 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Aggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregation.ts#L22-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregation.ts#L22-L25 type Aggregation struct { Meta Metadata `json:"meta,omitempty"` Name *string `json:"name,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregationbreakdown.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregationbreakdown.go index a01c3523a..dc11eaccc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregationbreakdown.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregationbreakdown.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AggregationBreakdown type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/profile.ts#L23-L36 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/profile.ts#L23-L36 type AggregationBreakdown struct { BuildAggregation int64 `json:"build_aggregation"` BuildAggregationCount int64 `json:"build_aggregation_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregationprofile.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregationprofile.go index c2c94b0df..caafb8639 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregationprofile.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregationprofile.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AggregationProfile type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/profile.ts#L77-L84 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/profile.ts#L77-L84 type AggregationProfile struct { Breakdown AggregationBreakdown `json:"breakdown"` Children []AggregationProfile `json:"children,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregationprofiledebug.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregationprofiledebug.go index 0b571338c..a05b6e700 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregationprofiledebug.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregationprofiledebug.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AggregationProfileDebug type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/profile.ts#L39-L68 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/profile.ts#L39-L68 type AggregationProfileDebug struct { BuiltBuckets *int `json:"built_buckets,omitempty"` CharsFetched *int `json:"chars_fetched,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregationprofiledelegatedebugfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregationprofiledelegatedebugfilter.go index df32afc87..ada8d7aa8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregationprofiledelegatedebugfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregationprofiledelegatedebugfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AggregationProfileDelegateDebugFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/profile.ts#L70-L75 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/profile.ts#L70-L75 type AggregationProfileDelegateDebugFilter struct { Query *string `json:"query,omitempty"` ResultsFromMetadata *int `json:"results_from_metadata,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregationrange.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregationrange.go index fbc059182..57f11886b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregationrange.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregationrange.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AggregationRange type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L672-L685 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L672-L685 type AggregationRange struct { // From Start of the range (inclusive). From string `json:"from,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregations.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregations.go index 23bd70492..8d7d989f3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregations.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aggregations.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // Aggregations type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/AggregationContainer.ts#L106-L515 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/AggregationContainer.ts#L106-L515 type Aggregations struct { // AdjacencyMatrix A bucket aggregation returning a form of adjacency matrix. // The request provides a collection of named filter expressions, similar to the diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/alias.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/alias.go index 41f5baedb..87dbf6b01 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/alias.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/alias.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Alias type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/Alias.ts#L23-L53 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/Alias.ts#L23-L53 type Alias struct { // Filter Query used to limit documents the alias can access. Filter *Query `json:"filter,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aliasdefinition.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aliasdefinition.go index 1b7714f12..43b576c26 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aliasdefinition.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aliasdefinition.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AliasDefinition type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/AliasDefinition.ts#L22-L54 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/AliasDefinition.ts#L22-L54 type AliasDefinition struct { // Filter Query used to limit documents the alias can access. Filter *Query `json:"filter,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aliasesrecord.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aliasesrecord.go index 39b944f17..6efc287e6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aliasesrecord.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/aliasesrecord.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AliasesRecord type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/aliases/types.ts#L22-L53 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/aliases/types.ts#L22-L53 type AliasesRecord struct { // Alias alias name Alias *string `json:"alias,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/allfield.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/allfield.go index 24d6afa14..31f6eb0a3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/allfield.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/allfield.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AllField type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/meta-fields.ts#L29-L40 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/meta-fields.ts#L29-L40 type AllField struct { Analyzer string `json:"analyzer"` Enabled bool `json:"enabled"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/allocationdecision.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/allocationdecision.go index cb680bddd..f26394cee 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/allocationdecision.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/allocationdecision.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // AllocationDecision type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/allocation_explain/types.ts#L26-L30 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/allocation_explain/types.ts#L26-L30 type AllocationDecision struct { Decider string `json:"decider"` Decision allocationexplaindecision.AllocationExplainDecision `json:"decision"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/allocationrecord.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/allocationrecord.go index 84d6d79d9..215751b66 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/allocationrecord.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/allocationrecord.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AllocationRecord type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/allocation/types.ts#L24-L75 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/allocation/types.ts#L24-L75 type AllocationRecord struct { // DiskAvail Free disk space available to Elasticsearch. // Elasticsearch retrieves this metric from the node’s operating system. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/allocationstore.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/allocationstore.go index b02dfe99a..e50794b44 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/allocationstore.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/allocationstore.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AllocationStore type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/allocation_explain/types.ts#L39-L46 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/allocation_explain/types.ts#L39-L46 type AllocationStore struct { AllocationId string `json:"allocation_id"` Found bool `json:"found"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/alwayscondition.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/alwayscondition.go index 25398ce85..c9be20b9f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/alwayscondition.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/alwayscondition.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // AlwaysCondition type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Conditions.ts#L25-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Conditions.ts#L25-L25 type AlwaysCondition struct { } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analysisconfig.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analysisconfig.go index 3c7194651..723cc448a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analysisconfig.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analysisconfig.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AnalysisConfig type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Analysis.ts#L29-L77 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Analysis.ts#L29-L77 type AnalysisConfig struct { // BucketSpan The size of the interval that the analysis is aggregated into, typically // between `5m` and `1h`. This value should be either a whole number of days or diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analysisconfigread.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analysisconfigread.go index 3e657e0da..0de6cb7ca 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analysisconfigread.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analysisconfigread.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AnalysisConfigRead type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Analysis.ts#L79-L148 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Analysis.ts#L79-L148 type AnalysisConfigRead struct { // BucketSpan The size of the interval that the analysis is aggregated into, typically // between `5m` and `1h`. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analysislimits.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analysislimits.go index cc006fe87..dffd352bb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analysislimits.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analysislimits.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AnalysisLimits type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Analysis.ts#L161-L172 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Analysis.ts#L161-L172 type AnalysisLimits struct { // CategorizationExamplesLimit The maximum number of examples stored per category in memory and in the // results data store. If you increase this value, more examples are available, diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analysismemorylimit.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analysismemorylimit.go index 0412faebb..a551d8bb1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analysismemorylimit.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analysismemorylimit.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AnalysisMemoryLimit type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Analysis.ts#L174-L179 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Analysis.ts#L174-L179 type AnalysisMemoryLimit struct { // ModelMemoryLimit Limits can be applied for the resources required to hold the mathematical // models in memory. These limits are approximate and can be set per job. They diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analytics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analytics.go index e9945b16f..ac28e1fd7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analytics.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Analytics type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L330-L332 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L330-L332 type Analytics struct { Available bool `json:"available"` Enabled bool `json:"enabled"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analyticscollection.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analyticscollection.go index 4f4023a3e..bf62efe91 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analyticscollection.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analyticscollection.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // AnalyticsCollection type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/search_application/_types/BehavioralAnalytics.ts#L22-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/search_application/_types/BehavioralAnalytics.ts#L22-L27 type AnalyticsCollection struct { // EventDataStream Data stream for the collection. EventDataStream EventDataStream `json:"event_data_stream"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analyticsstatistics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analyticsstatistics.go index b74d4d359..5e5f64976 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analyticsstatistics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analyticsstatistics.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AnalyticsStatistics type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L61-L71 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L61-L71 type AnalyticsStatistics struct { BoxplotUsage int64 `json:"boxplot_usage"` CumulativeCardinalityUsage int64 `json:"cumulative_cardinality_usage"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analyzedetail.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analyzedetail.go index 9dece0736..748f6d4c4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analyzedetail.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analyzedetail.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AnalyzeDetail type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/analyze/types.ts#L24-L30 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/analyze/types.ts#L24-L30 type AnalyzeDetail struct { Analyzer *AnalyzerDetail `json:"analyzer,omitempty"` Charfilters []CharFilterDetail `json:"charfilters,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analyzer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analyzer.go index cc203b0f9..09359d33a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analyzer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analyzer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -37,5 +37,5 @@ package types // SnowballAnalyzer // DutchAnalyzer // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/analyzers.ts#L113-L131 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/analyzers.ts#L113-L131 type Analyzer interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analyzerdetail.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analyzerdetail.go index 5a666324e..ad76954f5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analyzerdetail.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analyzerdetail.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AnalyzerDetail type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/analyze/types.ts#L32-L35 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/analyze/types.ts#L32-L35 type AnalyzerDetail struct { Name string `json:"name"` Tokens []ExplainAnalyzeToken `json:"tokens"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analyzetoken.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analyzetoken.go index ab67bf4ba..50c79a282 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analyzetoken.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/analyzetoken.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AnalyzeToken type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/analyze/types.ts#L37-L44 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/analyze/types.ts#L37-L44 type AnalyzeToken struct { EndOffset int64 `json:"end_offset"` Position int64 `json:"position"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/anomaly.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/anomaly.go index 42a995ea6..d5443996c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/anomaly.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/anomaly.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Anomaly type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Anomaly.ts#L24-L121 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Anomaly.ts#L24-L121 type Anomaly struct { // Actual The actual value for the bucket. Actual []Float64 `json:"actual,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/anomalycause.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/anomalycause.go index c7f1d56fb..9c44c6e34 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/anomalycause.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/anomalycause.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AnomalyCause type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Anomaly.ts#L123-L138 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Anomaly.ts#L123-L138 type AnomalyCause struct { Actual []Float64 `json:"actual"` ByFieldName string `json:"by_field_name"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/anomalydetectors.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/anomalydetectors.go index 6c73195e4..e8013afe4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/anomalydetectors.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/anomalydetectors.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AnomalyDetectors type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/info/types.ts#L44-L50 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/info/types.ts#L44-L50 type AnomalyDetectors struct { CategorizationAnalyzer CategorizationAnalyzer `json:"categorization_analyzer"` CategorizationExamplesLimit int `json:"categorization_examples_limit"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/anomalyexplanation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/anomalyexplanation.go index 686cdb372..dc907271f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/anomalyexplanation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/anomalyexplanation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AnomalyExplanation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Anomaly.ts#L156-L197 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Anomaly.ts#L156-L197 type AnomalyExplanation struct { // AnomalyCharacteristicsImpact Impact from the duration and magnitude of the detected anomaly relative to // the historical average. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/apikey.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/apikey.go index c8bc1eb65..a45aed82f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/apikey.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/apikey.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ApiKey type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/_types/ApiKey.ts#L27-L77 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/_types/ApiKey.ts#L27-L77 type ApiKey struct { // Creation Creation time for the API key in milliseconds. Creation *int64 `json:"creation,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/apikeyauthorization.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/apikeyauthorization.go index 7248fd2c5..cc512f93b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/apikeyauthorization.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/apikeyauthorization.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ApiKeyAuthorization type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Authorization.ts#L20-L29 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Authorization.ts#L20-L29 type ApiKeyAuthorization struct { // Id The identifier for the API key. Id string `json:"id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/appendprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/appendprocessor.go index 8bb9dee07..c9adf7126 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/appendprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/appendprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AppendProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L273-L288 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L273-L288 type AppendProcessor struct { // AllowDuplicates If `false`, the processor does not append values already present in the // field. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/applicationglobaluserprivileges.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/applicationglobaluserprivileges.go index 1fe89fd07..bb82a76e1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/applicationglobaluserprivileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/applicationglobaluserprivileges.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // ApplicationGlobalUserPrivileges type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/_types/Privileges.ts#L193-L195 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/_types/Privileges.ts#L193-L195 type ApplicationGlobalUserPrivileges struct { Manage ManageUserPrivileges `json:"manage"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/applicationprivileges.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/applicationprivileges.go index 297a06ab7..249fc2745 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/applicationprivileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/applicationprivileges.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ApplicationPrivileges type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/_types/Privileges.ts#L26-L39 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/_types/Privileges.ts#L26-L39 type ApplicationPrivileges struct { // Application The name of the application to which this entry applies. Application string `json:"application"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/applicationprivilegescheck.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/applicationprivilegescheck.go index 30363280d..d6c6e3084 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/applicationprivilegescheck.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/applicationprivilegescheck.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ApplicationPrivilegesCheck type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/has_privileges/types.ts#L24-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/has_privileges/types.ts#L24-L31 type ApplicationPrivilegesCheck struct { // Application The name of the application. Application string `json:"application"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/applicationsprivileges.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/applicationsprivileges.go index 323d6bdc3..94d2008b8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/applicationsprivileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/applicationsprivileges.go @@ -16,11 +16,11 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // ApplicationsPrivileges type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/has_privileges/types.ts#L46-L46 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/has_privileges/types.ts#L46-L46 type ApplicationsPrivileges map[string]ResourcePrivileges diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/archive.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/archive.go index 8d50d8253..f0668570b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/archive.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/archive.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Archive type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L48-L50 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L48-L50 type Archive struct { Available bool `json:"available"` Enabled bool `json:"enabled"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/arraycomparecondition.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/arraycomparecondition.go index 2e1ff7685..e9fd77053 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/arraycomparecondition.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/arraycomparecondition.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -33,7 +33,7 @@ import ( // ArrayCompareCondition type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Conditions.ts#L32-L36 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Conditions.ts#L32-L36 type ArrayCompareCondition struct { ArrayCompareCondition map[conditionop.ConditionOp]ArrayCompareOpParams `json:"ArrayCompareCondition,omitempty"` Path string `json:"path"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/arraycompareopparams.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/arraycompareopparams.go index 47d6b3be1..23ef6cdf6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/arraycompareopparams.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/arraycompareopparams.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // ArrayCompareOpParams type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Conditions.ts#L27-L30 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Conditions.ts#L27-L30 type ArrayCompareOpParams struct { Quantifier quantifier.Quantifier `json:"quantifier"` Value FieldValue `json:"value"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/arraypercentilesitem.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/arraypercentilesitem.go index 4687e502f..a8e9b5893 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/arraypercentilesitem.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/arraypercentilesitem.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ArrayPercentilesItem type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L160-L164 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L160-L164 type ArrayPercentilesItem struct { Key string `json:"key"` Value Float64 `json:"value,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/asciifoldingtokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/asciifoldingtokenfilter.go index 1f5a719ed..4dc8cd1c2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/asciifoldingtokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/asciifoldingtokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // AsciiFoldingTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L168-L171 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L168-L171 type AsciiFoldingTokenFilter struct { PreserveOriginal Stringifiedboolean `json:"preserve_original,omitempty"` Type string `json:"type,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/asyncsearch.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/asyncsearch.go index f6dbf3bde..168a4f3c3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/asyncsearch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/asyncsearch.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // AsyncSearch type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/async_search/_types/AsyncSearch.ts#L30-L56 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/async_search/_types/AsyncSearch.ts#L30-L56 type AsyncSearch struct { // Aggregations Partial aggregations results, coming from the shards that have already // completed the execution of the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/attachmentprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/attachmentprocessor.go index ce37e2821..952c3c9da 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/attachmentprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/attachmentprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AttachmentProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L290-L326 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L290-L326 type AttachmentProcessor struct { // Description Description of the processor. // Useful for describing the purpose of the processor or its configuration. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/audit.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/audit.go index 2298217cd..ee53fd581 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/audit.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/audit.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Audit type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L73-L75 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L73-L75 type Audit struct { Enabled bool `json:"enabled"` Outputs []string `json:"outputs,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/authenticateduser.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/authenticateduser.go index 66a17b98e..18e1ad447 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/authenticateduser.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/authenticateduser.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AuthenticatedUser type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/get_token/types.ts#L40-L45 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/get_token/types.ts#L40-L45 type AuthenticatedUser struct { AuthenticationProvider *AuthenticationProvider `json:"authentication_provider,omitempty"` AuthenticationRealm UserRealm `json:"authentication_realm"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/authenticatetoken.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/authenticatetoken.go index f2cb50f13..343bfe23d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/authenticatetoken.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/authenticatetoken.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AuthenticateToken type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/authenticate/types.ts#L22-L29 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/authenticate/types.ts#L22-L29 type AuthenticateToken struct { Name string `json:"name"` Type *string `json:"type,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/authenticationprovider.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/authenticationprovider.go index 0a0fe845c..ec61abed5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/authenticationprovider.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/authenticationprovider.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AuthenticationProvider type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/get_token/types.ts#L35-L38 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/get_token/types.ts#L35-L38 type AuthenticationProvider struct { Name string `json:"name"` Type string `json:"type"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autodatehistogramaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autodatehistogramaggregate.go index ee2e92ceb..576cea2ef 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autodatehistogramaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autodatehistogramaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // AutoDateHistogramAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L356-L360 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L356-L360 type AutoDateHistogramAggregate struct { Buckets BucketsDateHistogramBucket `json:"buckets"` Interval string `json:"interval"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autodatehistogramaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autodatehistogramaggregation.go index 7beb4011a..45e8d751b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autodatehistogramaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autodatehistogramaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // AutoDateHistogramAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L65-L100 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L65-L100 type AutoDateHistogramAggregation struct { // Buckets The target number of buckets. Buckets *int `json:"buckets,omitempty"` @@ -155,9 +155,40 @@ func (s *AutoDateHistogramAggregation) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } case "time_zone": if err := dec.Decode(&s.TimeZone); err != nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autofollowedcluster.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autofollowedcluster.go index cc924ece1..018c96436 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autofollowedcluster.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autofollowedcluster.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // AutoFollowedCluster type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ccr/stats/types.ts.ts#L27-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ccr/stats/types.ts.ts#L27-L31 type AutoFollowedCluster struct { ClusterName string `json:"cluster_name"` LastSeenMetadataVersion int64 `json:"last_seen_metadata_version"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autofollowpattern.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autofollowpattern.go index 9d6df55af..f0cd83494 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autofollowpattern.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autofollowpattern.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // AutoFollowPattern type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ccr/get_auto_follow_pattern/types.ts#L23-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ccr/get_auto_follow_pattern/types.ts#L23-L26 type AutoFollowPattern struct { Name string `json:"name"` Pattern AutoFollowPatternSummary `json:"pattern"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autofollowpatternsummary.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autofollowpatternsummary.go index 21a7de578..03ca9cb26 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autofollowpatternsummary.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autofollowpatternsummary.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AutoFollowPatternSummary type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ccr/get_auto_follow_pattern/types.ts#L28-L52 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ccr/get_auto_follow_pattern/types.ts#L28-L52 type AutoFollowPatternSummary struct { Active bool `json:"active"` // FollowIndexPattern The name of follower index. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autofollowstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autofollowstats.go index ac9502fca..9644f23b7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autofollowstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autofollowstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AutoFollowStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ccr/stats/types.ts.ts#L33-L39 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ccr/stats/types.ts.ts#L33-L39 type AutoFollowStats struct { AutoFollowedClusters []AutoFollowedCluster `json:"auto_followed_clusters"` NumberOfFailedFollowIndices int64 `json:"number_of_failed_follow_indices"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autoscalingcapacity.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autoscalingcapacity.go index dbd6442bc..e5d40634e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autoscalingcapacity.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autoscalingcapacity.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // AutoscalingCapacity type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/autoscaling/get_autoscaling_capacity/GetAutoscalingCapacityResponse.ts#L38-L41 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/autoscaling/get_autoscaling_capacity/GetAutoscalingCapacityResponse.ts#L38-L41 type AutoscalingCapacity struct { Node AutoscalingResources `json:"node"` Total AutoscalingResources `json:"total"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autoscalingdecider.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autoscalingdecider.go index e638fc188..65b5c76db 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autoscalingdecider.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autoscalingdecider.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AutoscalingDecider type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/autoscaling/get_autoscaling_capacity/GetAutoscalingCapacityResponse.ts#L52-L56 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/autoscaling/get_autoscaling_capacity/GetAutoscalingCapacityResponse.ts#L52-L56 type AutoscalingDecider struct { ReasonDetails json.RawMessage `json:"reason_details,omitempty"` ReasonSummary *string `json:"reason_summary,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autoscalingdeciders.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autoscalingdeciders.go index eca68f0a3..6df7f6cd2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autoscalingdeciders.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autoscalingdeciders.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // AutoscalingDeciders type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/autoscaling/get_autoscaling_capacity/GetAutoscalingCapacityResponse.ts#L31-L36 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/autoscaling/get_autoscaling_capacity/GetAutoscalingCapacityResponse.ts#L31-L36 type AutoscalingDeciders struct { CurrentCapacity AutoscalingCapacity `json:"current_capacity"` CurrentNodes []AutoscalingNode `json:"current_nodes"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autoscalingnode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autoscalingnode.go index c1784778e..e4c63f8d1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autoscalingnode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autoscalingnode.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // AutoscalingNode type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/autoscaling/get_autoscaling_capacity/GetAutoscalingCapacityResponse.ts#L48-L50 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/autoscaling/get_autoscaling_capacity/GetAutoscalingCapacityResponse.ts#L48-L50 type AutoscalingNode struct { Name string `json:"name"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autoscalingpolicy.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autoscalingpolicy.go index 870a8c92e..e7fe40448 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autoscalingpolicy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autoscalingpolicy.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,7 +26,7 @@ import ( // AutoscalingPolicy type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/autoscaling/_types/AutoscalingPolicy.ts#L23-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/autoscaling/_types/AutoscalingPolicy.ts#L23-L27 type AutoscalingPolicy struct { // Deciders Decider settings Deciders map[string]json.RawMessage `json:"deciders"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autoscalingresources.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autoscalingresources.go index 35cff09f0..4c4cc9a2a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autoscalingresources.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/autoscalingresources.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AutoscalingResources type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/autoscaling/get_autoscaling_capacity/GetAutoscalingCapacityResponse.ts#L43-L46 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/autoscaling/get_autoscaling_capacity/GetAutoscalingCapacityResponse.ts#L43-L46 type AutoscalingResources struct { Memory int `json:"memory"` Storage int `json:"storage"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/averageaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/averageaggregation.go index bf42f7e71..643bd0349 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/averageaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/averageaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AverageAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L55-L55 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L55-L55 type AverageAggregation struct { // Field The field on which to run the aggregation. Field *string `json:"field,omitempty"` @@ -79,9 +79,40 @@ func (s *AverageAggregation) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } } } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/averagebucketaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/averagebucketaggregation.go index f6d1174f2..fe9db7a04 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/averagebucketaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/averagebucketaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // AverageBucketAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L78-L78 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L78-L78 type AverageBucketAggregation struct { // BucketsPath Path to the buckets that contain one set of values to correlate. BucketsPath BucketsPath `json:"buckets_path,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/avgaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/avgaggregate.go index f188282eb..cb70137dd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/avgaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/avgaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // AvgAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L209-L210 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L209-L210 type AvgAggregate struct { Meta Metadata `json:"meta,omitempty"` // Value The metric value. A missing value generally means that there was no data to diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/base.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/base.go index 18e4578c3..d9f70e79a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/base.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/base.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Base type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L30-L33 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L30-L33 type Base struct { Available bool `json:"available"` Enabled bool `json:"enabled"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/baseindicator.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/baseindicator.go index c744b4a8e..9da5ad5c6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/baseindicator.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/baseindicator.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // BaseIndicator type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/health_report/types.ts#L42-L47 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/health_report/types.ts#L42-L47 type BaseIndicator struct { Diagnosis []Diagnosis `json:"diagnosis,omitempty"` Impacts []Impact `json:"impacts,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/basenode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/basenode.go index 3f96e57fa..57ddf0a96 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/basenode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/basenode.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // BaseNode type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_spec_utils/BaseNode.ts#L25-L32 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_spec_utils/BaseNode.ts#L25-L32 type BaseNode struct { Attributes map[string]string `json:"attributes"` Host string `json:"host"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/binaryproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/binaryproperty.go index 8307cfe6d..38e878eae 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/binaryproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/binaryproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // BinaryProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/core.ts#L49-L51 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/core.ts#L49-L51 type BinaryProperty struct { CopyTo []string `json:"copy_to,omitempty"` DocValues *bool `json:"doc_values,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/booleanproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/booleanproperty.go index c686a3d08..33b0bca9d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/booleanproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/booleanproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // BooleanProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/core.ts#L53-L59 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/core.ts#L53-L59 type BooleanProperty struct { Boost *Float64 `json:"boost,omitempty"` CopyTo []string `json:"copy_to,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/boolquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/boolquery.go index a80c28e3a..31b02c6ef 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/boolquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/boolquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // BoolQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/compound.ts#L28-L52 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/compound.ts#L28-L52 type BoolQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/boostingquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/boostingquery.go index 4d18a050f..e5d378686 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/boostingquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/boostingquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // BoostingQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/compound.ts#L54-L67 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/compound.ts#L54-L67 type BoostingQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/boxplotaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/boxplotaggregate.go index 67d95c3cc..496625578 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/boxplotaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/boxplotaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // BoxPlotAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L706-L722 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L706-L722 type BoxPlotAggregate struct { Lower Float64 `json:"lower"` LowerAsString *string `json:"lower_as_string,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/boxplotaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/boxplotaggregation.go index dd518c300..5303669a8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/boxplotaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/boxplotaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // BoxplotAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L57-L62 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L57-L62 type BoxplotAggregation struct { // Compression Limits the maximum number of nodes used by the underlying TDigest algorithm // to `20 * compression`, enabling control of memory usage and approximation @@ -86,9 +86,40 @@ func (s *BoxplotAggregation) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } } } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/breaker.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/breaker.go index c50204e07..c39f450c3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/breaker.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/breaker.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Breaker type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L434-L459 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L434-L459 type Breaker struct { // EstimatedSize Estimated memory used for the operation. EstimatedSize *string `json:"estimated_size,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketcorrelationaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketcorrelationaggregation.go index 3c27a79fd..55bd38051 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketcorrelationaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketcorrelationaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // BucketCorrelationAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L129-L135 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L129-L135 type BucketCorrelationAggregation struct { // BucketsPath Path to the buckets that contain one set of values to correlate. BucketsPath BucketsPath `json:"buckets_path,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketcorrelationfunction.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketcorrelationfunction.go index 6337f9fe9..4b617c59a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketcorrelationfunction.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketcorrelationfunction.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // BucketCorrelationFunction type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L137-L142 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L137-L142 type BucketCorrelationFunction struct { // CountCorrelation The configuration to calculate a count correlation. This function is designed // for determining the correlation of a term value and a given metric. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketcorrelationfunctioncountcorrelation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketcorrelationfunctioncountcorrelation.go index 97f6777cd..d2c401968 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketcorrelationfunctioncountcorrelation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketcorrelationfunctioncountcorrelation.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // BucketCorrelationFunctionCountCorrelation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L144-L147 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L144-L147 type BucketCorrelationFunctionCountCorrelation struct { // Indicator The indicator with which to correlate the configured `bucket_path` values. Indicator BucketCorrelationFunctionCountCorrelationIndicator `json:"indicator"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketcorrelationfunctioncountcorrelationindicator.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketcorrelationfunctioncountcorrelationindicator.go index 226098edc..1a9d502d9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketcorrelationfunctioncountcorrelationindicator.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketcorrelationfunctioncountcorrelationindicator.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // BucketCorrelationFunctionCountCorrelationIndicator type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L149-L167 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L149-L167 type BucketCorrelationFunctionCountCorrelationIndicator struct { // DocCount The total number of documents that initially created the expectations. It’s // required to be greater diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketinfluencer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketinfluencer.go index fd6c111a3..606b7d58d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketinfluencer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketinfluencer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // BucketInfluencer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Bucket.ts#L80-L128 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Bucket.ts#L80-L128 type BucketInfluencer struct { // AnomalyScore A normalized score between 0-100, which is calculated for each bucket // influencer. This score might be updated as diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketksaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketksaggregation.go index 03b19b787..12f54a0cc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketksaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketksaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // BucketKsAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L94-L127 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L94-L127 type BucketKsAggregation struct { // Alternative A list of string values indicating which K-S test alternative to calculate. // The valid values diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketmetricvalueaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketmetricvalueaggregate.go index 465d982a8..3a5ff2f62 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketmetricvalueaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketmetricvalueaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // BucketMetricValueAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L233-L236 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L233-L236 type BucketMetricValueAggregate struct { Keys []string `json:"keys"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketpathaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketpathaggregation.go index ee87eb2c4..d3f056f55 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketpathaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketpathaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // BucketPathAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L31-L37 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L31-L37 type BucketPathAggregation struct { // BucketsPath Path to the buckets that contain one set of values to correlate. BucketsPath BucketsPath `json:"buckets_path,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsadjacencymatrixbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsadjacencymatrixbucket.go index af6c17637..3d8bf35bc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsadjacencymatrixbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsadjacencymatrixbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // map[string]AdjacencyMatrixBucket // []AdjacencyMatrixBucket // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L316-L325 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L316-L325 type BucketsAdjacencyMatrixBucket interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketscompositebucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketscompositebucket.go index 340ec6721..b8220914e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketscompositebucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketscompositebucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // map[string]CompositeBucket // []CompositeBucket // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L316-L325 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L316-L325 type BucketsCompositeBucket interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketscriptaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketscriptaggregation.go index 67a332470..35d366607 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketscriptaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketscriptaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // BucketScriptAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L80-L85 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L80-L85 type BucketScriptAggregation struct { // BucketsPath Path to the buckets that contain one set of values to correlate. BucketsPath BucketsPath `json:"buckets_path,omitempty"` @@ -103,9 +103,40 @@ func (s *BucketScriptAggregation) UnmarshalJSON(data []byte) error { s.Name = &o case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } } } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsdatehistogrambucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsdatehistogrambucket.go index 6a243824c..7c2b1d05c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsdatehistogrambucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsdatehistogrambucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // map[string]DateHistogramBucket // []DateHistogramBucket // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L316-L325 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L316-L325 type BucketsDateHistogramBucket interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsdoubletermsbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsdoubletermsbucket.go index a3762a355..41595869c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsdoubletermsbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsdoubletermsbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // map[string]DoubleTermsBucket // []DoubleTermsBucket // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L316-L325 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L316-L325 type BucketsDoubleTermsBucket interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketselectoraggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketselectoraggregation.go index c54fa6d74..4e56bbba1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketselectoraggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketselectoraggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // BucketSelectorAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L87-L92 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L87-L92 type BucketSelectorAggregation struct { // BucketsPath Path to the buckets that contain one set of values to correlate. BucketsPath BucketsPath `json:"buckets_path,omitempty"` @@ -103,9 +103,40 @@ func (s *BucketSelectorAggregation) UnmarshalJSON(data []byte) error { s.Name = &o case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } } } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsfiltersbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsfiltersbucket.go index 8448582b0..b87f38af2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsfiltersbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsfiltersbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // map[string]FiltersBucket // []FiltersBucket // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L316-L325 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L316-L325 type BucketsFiltersBucket interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsfrequentitemsetsbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsfrequentitemsetsbucket.go index 70c1a02b3..406d5cef4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsfrequentitemsetsbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsfrequentitemsetsbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // map[string]FrequentItemSetsBucket // []FrequentItemSetsBucket // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L316-L325 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L316-L325 type BucketsFrequentItemSetsBucket interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsgeohashgridbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsgeohashgridbucket.go index 70d967ab1..903d1fe48 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsgeohashgridbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsgeohashgridbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // map[string]GeoHashGridBucket // []GeoHashGridBucket // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L316-L325 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L316-L325 type BucketsGeoHashGridBucket interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsgeohexgridbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsgeohexgridbucket.go index b864e3034..1e4d2d51d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsgeohexgridbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsgeohexgridbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // map[string]GeoHexGridBucket // []GeoHexGridBucket // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L316-L325 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L316-L325 type BucketsGeoHexGridBucket interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsgeotilegridbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsgeotilegridbucket.go index af8a93c1c..40ee73e73 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsgeotilegridbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsgeotilegridbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // map[string]GeoTileGridBucket // []GeoTileGridBucket // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L316-L325 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L316-L325 type BucketsGeoTileGridBucket interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketshistogrambucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketshistogrambucket.go index 774a19da2..a7ec6d9f3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketshistogrambucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketshistogrambucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // map[string]HistogramBucket // []HistogramBucket // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L316-L325 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L316-L325 type BucketsHistogramBucket interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsipprefixbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsipprefixbucket.go index cab582478..21708969a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsipprefixbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsipprefixbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // map[string]IpPrefixBucket // []IpPrefixBucket // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L316-L325 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L316-L325 type BucketsIpPrefixBucket interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsiprangebucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsiprangebucket.go index 279efc663..e403a5643 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsiprangebucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsiprangebucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // map[string]IpRangeBucket // []IpRangeBucket // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L316-L325 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L316-L325 type BucketsIpRangeBucket interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketslongraretermsbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketslongraretermsbucket.go index 024266a14..1f65f1db0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketslongraretermsbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketslongraretermsbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // map[string]LongRareTermsBucket // []LongRareTermsBucket // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L316-L325 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L316-L325 type BucketsLongRareTermsBucket interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketslongtermsbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketslongtermsbucket.go index bae57621c..aba78abef 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketslongtermsbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketslongtermsbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // map[string]LongTermsBucket // []LongTermsBucket // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L316-L325 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L316-L325 type BucketsLongTermsBucket interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsmultitermsbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsmultitermsbucket.go index d55548d30..586834fc7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsmultitermsbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsmultitermsbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // map[string]MultiTermsBucket // []MultiTermsBucket // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L316-L325 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L316-L325 type BucketsMultiTermsBucket interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsortaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsortaggregation.go index 95cf6c3af..f15eb87ad 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsortaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsortaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // BucketSortAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L169-L190 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L169-L190 type BucketSortAggregation struct { // From Buckets in positions prior to `from` will be truncated. From *int `json:"from,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketspath.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketspath.go index 4ab3dc690..34b2f36db 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketspath.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketspath.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,5 +26,5 @@ package types // []string // map[string]string // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L53-L59 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L53-L59 type BucketsPath interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsquery.go index f1d14d4a2..072e958eb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // map[string]Query // []Query // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L316-L325 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L316-L325 type BucketsQuery interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsrangebucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsrangebucket.go index 4b019ceb7..c4661059a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsrangebucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsrangebucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // map[string]RangeBucket // []RangeBucket // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L316-L325 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L316-L325 type BucketsRangeBucket interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketssignificantlongtermsbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketssignificantlongtermsbucket.go index e2a2a299f..ed08676fa 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketssignificantlongtermsbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketssignificantlongtermsbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // map[string]SignificantLongTermsBucket // []SignificantLongTermsBucket // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L316-L325 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L316-L325 type BucketsSignificantLongTermsBucket interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketssignificantstringtermsbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketssignificantstringtermsbucket.go index 0604def02..1a4d37c11 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketssignificantstringtermsbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketssignificantstringtermsbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // map[string]SignificantStringTermsBucket // []SignificantStringTermsBucket // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L316-L325 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L316-L325 type BucketsSignificantStringTermsBucket interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsstringraretermsbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsstringraretermsbucket.go index f9df5ca6e..49dfabd35 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsstringraretermsbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsstringraretermsbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // map[string]StringRareTermsBucket // []StringRareTermsBucket // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L316-L325 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L316-L325 type BucketsStringRareTermsBucket interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsstringtermsbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsstringtermsbucket.go index c0562c727..32fe9e93d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsstringtermsbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsstringtermsbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // map[string]StringTermsBucket // []StringTermsBucket // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L316-L325 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L316-L325 type BucketsStringTermsBucket interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsummary.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsummary.go index 6b9c187a3..88202a1c7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsummary.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsummary.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // BucketSummary type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Bucket.ts#L31-L78 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Bucket.ts#L31-L78 type BucketSummary struct { // AnomalyScore The maximum anomaly score, between 0-100, for any of the bucket influencers. // This is an overall, rate-limited diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsvariablewidthhistogrambucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsvariablewidthhistogrambucket.go index 7f85b86a6..f81b77d0c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsvariablewidthhistogrambucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsvariablewidthhistogrambucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // map[string]VariableWidthHistogramBucket // []VariableWidthHistogramBucket // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L316-L325 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L316-L325 type BucketsVariableWidthHistogramBucket interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsvoid.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsvoid.go index 910e2f1a6..9c64f35eb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsvoid.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bucketsvoid.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // map[string]interface{} // []interface{} // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L316-L325 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L316-L325 type BucketsVoid interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/buildinformation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/buildinformation.go index 97c6948fb..04bffc873 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/buildinformation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/buildinformation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // BuildInformation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/info/types.ts#L24-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/info/types.ts#L24-L27 type BuildInformation struct { Date DateTime `json:"date"` Hash string `json:"hash"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bulkindexbyscrollfailure.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bulkindexbyscrollfailure.go index 75bf20627..5647859cb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bulkindexbyscrollfailure.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bulkindexbyscrollfailure.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // BulkIndexByScrollFailure type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Errors.ts#L58-L64 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Errors.ts#L58-L64 type BulkIndexByScrollFailure struct { Cause ErrorCause `json:"cause"` Id string `json:"id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bulkstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bulkstats.go index ab3025703..bd525507a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bulkstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bulkstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // BulkStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Stats.ts#L68-L78 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Stats.ts#L68-L78 type BulkStats struct { AvgSize ByteSize `json:"avg_size,omitempty"` AvgSizeInBytes int64 `json:"avg_size_in_bytes"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bytenumberproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bytenumberproperty.go index 679ab3e6a..73a34b0b6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bytenumberproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bytenumberproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -34,7 +34,7 @@ import ( // ByteNumberProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/core.ts#L164-L167 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/core.ts#L164-L167 type ByteNumberProperty struct { Boost *Float64 `json:"boost,omitempty"` Coerce *bool `json:"coerce,omitempty"` @@ -819,9 +819,40 @@ func (s *ByteNumberProperty) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } case "similarity": var tmp json.RawMessage diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bytesize.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bytesize.go index 52fab1470..e961ba8c3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bytesize.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bytesize.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // int64 // string // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L90-L91 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L101-L102 type ByteSize interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bytesprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bytesprocessor.go index 977bd7174..925738ce7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bytesprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/bytesprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // BytesProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L381-L397 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L381-L397 type BytesProcessor struct { // Description Description of the processor. // Useful for describing the purpose of the processor or its configuration. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cachequeries.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cachequeries.go index cc02cf339..d02a1ad0c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cachequeries.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cachequeries.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CacheQueries type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L398-L400 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L398-L400 type CacheQueries struct { Enabled bool `json:"enabled"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cachestats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cachestats.go index b32aabb42..55a2a51c9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cachestats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cachestats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CacheStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/enrich/stats/types.ts#L37-L43 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/enrich/stats/types.ts#L37-L43 type CacheStats struct { Count int `json:"count"` Evictions int `json:"evictions"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/calendar.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/calendar.go index d6a317025..11668843f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/calendar.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/calendar.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Calendar type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/get_calendars/types.ts#L22-L29 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/get_calendars/types.ts#L22-L29 type Calendar struct { // CalendarId A string that uniquely identifies a calendar. CalendarId string `json:"calendar_id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/calendarevent.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/calendarevent.go index e2ab6af77..7d8c7e389 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/calendarevent.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/calendarevent.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CalendarEvent type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/CalendarEvent.ts#L23-L33 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/CalendarEvent.ts#L23-L33 type CalendarEvent struct { // CalendarId A string that uniquely identifies a calendar. CalendarId *string `json:"calendar_id,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cardinalityaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cardinalityaggregate.go index 040bdac0a..4d9185064 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cardinalityaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cardinalityaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CardinalityAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L138-L141 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L138-L141 type CardinalityAggregate struct { Meta Metadata `json:"meta,omitempty"` Value int64 `json:"value"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cardinalityaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cardinalityaggregation.go index 2ee4ad521..993386871 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cardinalityaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cardinalityaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // CardinalityAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L87-L99 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L87-L99 type CardinalityAggregation struct { // ExecutionHint Mechanism by which cardinality aggregations is run. ExecutionHint *cardinalityexecutionmode.CardinalityExecutionMode `json:"execution_hint,omitempty"` @@ -109,9 +109,40 @@ func (s *CardinalityAggregation) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } } } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/catanonalydetectorcolumns.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/catanonalydetectorcolumns.go index c3f19fa03..bb316e0ab 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/catanonalydetectorcolumns.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/catanonalydetectorcolumns.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,5 +26,5 @@ import ( // CatAnonalyDetectorColumns type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/_types/CatBase.ts#L402-L404 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/_types/CatBase.ts#L402-L404 type CatAnonalyDetectorColumns []catanomalydetectorcolumn.CatAnomalyDetectorColumn diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/catcomponenttemplate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/catcomponenttemplate.go index 8dea094a1..e6109fbb1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/catcomponenttemplate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/catcomponenttemplate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CatComponentTemplate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/component_templates/types.ts#L20-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/component_templates/types.ts#L20-L28 type CatComponentTemplate struct { AliasCount string `json:"alias_count"` IncludedIn string `json:"included_in"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/catdatafeedcolumns.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/catdatafeedcolumns.go index d76f97923..b49b4baef 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/catdatafeedcolumns.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/catdatafeedcolumns.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,5 +26,5 @@ import ( // CatDatafeedColumns type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/_types/CatBase.ts#L559-L559 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/_types/CatBase.ts#L559-L559 type CatDatafeedColumns []catdatafeedcolumn.CatDatafeedColumn diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/catdfacolumns.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/catdfacolumns.go index 29aee7ab8..f894725f4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/catdfacolumns.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/catdfacolumns.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,5 +26,5 @@ import ( // CatDfaColumns type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/_types/CatBase.ts#L558-L558 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/_types/CatBase.ts#L558-L558 type CatDfaColumns []catdfacolumn.CatDfaColumn diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/categorizationanalyzer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/categorizationanalyzer.go index c68b2fd00..460b3097e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/categorizationanalyzer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/categorizationanalyzer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // string // CategorizationAnalyzerDefinition // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Analysis.ts#L181-L182 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Analysis.ts#L181-L182 type CategorizationAnalyzer interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/categorizationanalyzerdefinition.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/categorizationanalyzerdefinition.go index f35a4fa47..4f067772b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/categorizationanalyzerdefinition.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/categorizationanalyzerdefinition.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // CategorizationAnalyzerDefinition type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Analysis.ts#L184-L197 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Analysis.ts#L184-L197 type CategorizationAnalyzerDefinition struct { // CharFilter One or more character filters. In addition to the built-in character filters, // other plugins can provide more character filters. If this property is not diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/categorizetextaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/categorizetextaggregation.go index 42897fe97..49af46211 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/categorizetextaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/categorizetextaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CategorizeTextAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L1037-L1101 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L1037-L1101 type CategorizeTextAggregation struct { // CategorizationAnalyzer The categorization analyzer specifies how the text is analyzed and tokenized // before being categorized. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/categorizetextanalyzer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/categorizetextanalyzer.go index 4c04b5eaf..8ad0594db 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/categorizetextanalyzer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/categorizetextanalyzer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // string // CustomCategorizeTextAnalyzer // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L1103-L1106 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L1103-L1106 type CategorizeTextAnalyzer interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/category.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/category.go index 1f5621abb..5d4ae5844 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/category.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/category.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Category type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Category.ts#L23-L49 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Category.ts#L23-L49 type Category struct { // CategoryId A unique identifier for the category. category_id is unique at the job level, // even when per-partition categorization is enabled. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cattrainedmodelscolumns.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cattrainedmodelscolumns.go index 4f002e783..e0897c12c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cattrainedmodelscolumns.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cattrainedmodelscolumns.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,5 +26,5 @@ import ( // CatTrainedModelsColumns type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/_types/CatBase.ts#L636-L638 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/_types/CatBase.ts#L636-L638 type CatTrainedModelsColumns []cattrainedmodelscolumn.CatTrainedModelsColumn diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cattransformcolumns.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cattransformcolumns.go index 75965bd78..3059f43d0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cattransformcolumns.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cattransformcolumns.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,5 +26,5 @@ import ( // CatTransformColumns type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/_types/CatBase.ts#L845-L845 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/_types/CatBase.ts#L845-L845 type CatTransformColumns []cattransformcolumn.CatTransformColumn diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ccr.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ccr.go index 9a41f3898..af00b198a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ccr.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ccr.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Ccr type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L334-L337 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L334-L337 type Ccr struct { AutoFollowPatternsCount int `json:"auto_follow_patterns_count"` Available bool `json:"available"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ccrshardstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ccrshardstats.go index 36eb210bd..e66aacafa 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ccrshardstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ccrshardstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CcrShardStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ccr/_types/FollowIndexStats.ts#L35-L69 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ccr/_types/FollowIndexStats.ts#L35-L69 type CcrShardStats struct { BytesRead int64 `json:"bytes_read"` FailedReadRequests int64 `json:"failed_read_requests"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/certificateinformation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/certificateinformation.go index 9efcaac69..236d073c4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/certificateinformation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/certificateinformation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CertificateInformation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ssl/certificates/types.ts#L22-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ssl/certificates/types.ts#L22-L31 type CertificateInformation struct { Alias string `json:"alias,omitempty"` Expiry DateTime `json:"expiry"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cgroup.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cgroup.go index e71859e10..5ba6eb158 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cgroup.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cgroup.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // Cgroup type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L461-L474 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L461-L474 type Cgroup struct { // Cpu Contains statistics about `cpu` control group for the node. Cpu *CgroupCpu `json:"cpu,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cgroupcpu.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cgroupcpu.go index 3968b1cb4..50d047b5f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cgroupcpu.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cgroupcpu.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CgroupCpu type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L487-L504 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L487-L504 type CgroupCpu struct { // CfsPeriodMicros The period of time, in microseconds, for how regularly all tasks in the same // cgroup as the Elasticsearch process should have their access to CPU resources diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cgroupcpustat.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cgroupcpustat.go index e8f01074c..706f1fa56 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cgroupcpustat.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cgroupcpustat.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CgroupCpuStat type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L506-L519 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L506-L519 type CgroupCpuStat struct { // NumberOfElapsedPeriods The number of reporting periods (as specified by `cfs_period_micros`) that // have elapsed. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cgroupmemory.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cgroupmemory.go index 190237bd1..3ac84bf47 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cgroupmemory.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cgroupmemory.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CgroupMemory type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L521-L537 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L521-L537 type CgroupMemory struct { // ControlGroup The `memory` control group to which the Elasticsearch process belongs. ControlGroup *string `json:"control_group,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/chaininput.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/chaininput.go index 0ea39b524..c5cb9ef13 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/chaininput.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/chaininput.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // ChainInput type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Input.ts#L35-L37 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Input.ts#L35-L37 type ChainInput struct { Inputs []map[string]WatcherInput `json:"inputs"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/charfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/charfilter.go index f700f22d3..1febb5c38 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/charfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/charfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // string // CharFilterDefinition // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/char_filters.ts#L28-L30 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/char_filters.ts#L28-L30 type CharFilter interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/charfilterdefinition.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/charfilterdefinition.go index 5bc447731..eb187e16c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/charfilterdefinition.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/charfilterdefinition.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -28,5 +28,5 @@ package types // IcuNormalizationCharFilter // KuromojiIterationMarkCharFilter // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/char_filters.ts#L32-L41 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/char_filters.ts#L32-L41 type CharFilterDefinition interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/charfilterdetail.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/charfilterdetail.go index 78d590a31..1ebed979f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/charfilterdetail.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/charfilterdetail.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CharFilterDetail type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/analyze/types.ts#L46-L49 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/analyze/types.ts#L46-L49 type CharFilterDetail struct { FilteredText []string `json:"filtered_text"` Name string `json:"name"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/charfiltertypes.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/charfiltertypes.go index e6c193ea6..a19884a75 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/charfiltertypes.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/charfiltertypes.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // CharFilterTypes type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/stats/types.ts#L228-L261 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/stats/types.ts#L228-L261 type CharFilterTypes struct { // AnalyzerTypes Contains statistics about analyzer types used in selected nodes. AnalyzerTypes []FieldTypes `json:"analyzer_types"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/chargrouptokenizer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/chargrouptokenizer.go index 9538b133d..ea8b71f2e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/chargrouptokenizer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/chargrouptokenizer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CharGroupTokenizer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/tokenizers.ts#L56-L60 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/tokenizers.ts#L56-L60 type CharGroupTokenizer struct { MaxTokenLength *int `json:"max_token_length,omitempty"` TokenizeOnChars []string `json:"tokenize_on_chars"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/checkpointing.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/checkpointing.go index 53a29be9c..8405ffd23 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/checkpointing.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/checkpointing.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Checkpointing type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/transform/get_transform_stats/types.ts#L85-L92 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/transform/get_transform_stats/types.ts#L85-L92 type Checkpointing struct { ChangesLastDetectedAt *int64 `json:"changes_last_detected_at,omitempty"` ChangesLastDetectedAtDateTime DateTime `json:"changes_last_detected_at_date_time,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/checkpointstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/checkpointstats.go index 5c28eb7f2..c26f6362e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/checkpointstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/checkpointstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CheckpointStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/transform/get_transform_stats/types.ts#L76-L83 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/transform/get_transform_stats/types.ts#L76-L83 type CheckpointStats struct { Checkpoint int64 `json:"checkpoint"` CheckpointProgress *TransformProgress `json:"checkpoint_progress,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/childrenaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/childrenaggregate.go index 752f7d976..bda4b0cac 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/childrenaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/childrenaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // ChildrenAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L776-L777 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L776-L777 type ChildrenAggregate struct { Aggregations map[string]Aggregate `json:"-"` DocCount int64 `json:"doc_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/childrenaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/childrenaggregation.go index 52fdccf0a..e890ba10e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/childrenaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/childrenaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ChildrenAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L111-L116 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L111-L116 type ChildrenAggregation struct { Meta Metadata `json:"meta,omitempty"` Name *string `json:"name,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/chisquareheuristic.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/chisquareheuristic.go index 9e77d2870..b1bd7ed21 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/chisquareheuristic.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/chisquareheuristic.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ChiSquareHeuristic type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L735-L744 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L735-L744 type ChiSquareHeuristic struct { // BackgroundIsSuperset Set to `false` if you defined a custom background filter that represents a // different set of documents that you want to compare to. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/chunkingconfig.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/chunkingconfig.go index c030d0110..91d0388b3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/chunkingconfig.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/chunkingconfig.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // ChunkingConfig type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Datafeed.ts#L239-L252 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Datafeed.ts#L239-L252 type ChunkingConfig struct { // Mode If the mode is `auto`, the chunk size is dynamically calculated; // this is the recommended value when the datafeed does not use aggregations. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/circleprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/circleprocessor.go index 16ac08285..d902bae1c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/circleprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/circleprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // CircleProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L399-L422 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L399-L422 type CircleProcessor struct { // Description Description of the processor. // Useful for describing the purpose of the processor or its configuration. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/classificationinferenceoptions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/classificationinferenceoptions.go index 75096df0c..74df7edd3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/classificationinferenceoptions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/classificationinferenceoptions.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ClassificationInferenceOptions type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/inference.ts#L93-L108 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/inference.ts#L93-L108 type ClassificationInferenceOptions struct { // NumTopClasses Specifies the number of top class predictions to return. Defaults to 0. NumTopClasses *int `json:"num_top_classes,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cleanuprepositoryresults.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cleanuprepositoryresults.go index bfc608d9a..0cf2bd50b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cleanuprepositoryresults.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cleanuprepositoryresults.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CleanupRepositoryResults type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/cleanup_repository/SnapshotCleanupRepositoryResponse.ts#L29-L34 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/cleanup_repository/SnapshotCleanupRepositoryResponse.ts#L29-L34 type CleanupRepositoryResults struct { // DeletedBlobs Number of binary large objects (blobs) removed during cleanup. DeletedBlobs int64 `json:"deleted_blobs"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/client.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/client.go index 942236588..a7c33d0f1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/client.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/client.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Client type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L649-L696 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L649-L696 type Client struct { // Agent Reported agent for the HTTP client. // If unavailable, this property is not included in the response. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/closeindexresult.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/closeindexresult.go index eef93c875..af099a68b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/closeindexresult.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/closeindexresult.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CloseIndexResult type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/close/CloseIndexResponse.ts#L32-L35 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/close/CloseIndexResponse.ts#L32-L35 type CloseIndexResult struct { Closed bool `json:"closed"` Shards map[string]CloseShardResult `json:"shards,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/closeshardresult.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/closeshardresult.go index e76999a77..d0662b528 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/closeshardresult.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/closeshardresult.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // CloseShardResult type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/close/CloseIndexResponse.ts#L37-L39 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/close/CloseIndexResponse.ts#L37-L39 type CloseShardResult struct { Failures []ShardFailure `json:"failures"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterappliedstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterappliedstats.go index f96ac734f..b7d509f78 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterappliedstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterappliedstats.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // ClusterAppliedStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L221-L223 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L221-L223 type ClusterAppliedStats struct { Recordings []Recording `json:"recordings,omitempty"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clustercomponenttemplate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clustercomponenttemplate.go index 44f7c7dc1..00caf2c9a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clustercomponenttemplate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clustercomponenttemplate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // ClusterComponentTemplate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/_types/ComponentTemplate.ts#L30-L33 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/_types/ComponentTemplate.ts#L30-L33 type ClusterComponentTemplate struct { ComponentTemplate ComponentTemplateNode `json:"component_template"` Name string `json:"name"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterdetails.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterdetails.go index 8e7de6551..185c9dad4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterdetails.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterdetails.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // ClusterDetails type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Stats.ts#L45-L52 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Stats.ts#L45-L52 type ClusterDetails struct { Failures []ShardFailure `json:"failures,omitempty"` Indices string `json:"indices"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterfilesystem.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterfilesystem.go index 80db7b3df..a46ff84ab 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterfilesystem.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterfilesystem.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ClusterFileSystem type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/stats/types.ts#L34-L49 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/stats/types.ts#L34-L49 type ClusterFileSystem struct { // AvailableInBytes Total number of bytes available to JVM in file stores across all selected // nodes. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterindexingpressure.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterindexingpressure.go index 964c27ca5..9a450411e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterindexingpressure.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterindexingpressure.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // ClusterIndexingPressure type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/stats/types.ts#L570-L572 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/stats/types.ts#L570-L572 type ClusterIndexingPressure struct { Memory ClusterPressureMemory `json:"memory"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterindices.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterindices.go index a5b898b3d..44719734b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterindices.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterindices.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ClusterIndices type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/stats/types.ts#L74-L107 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/stats/types.ts#L74-L107 type ClusterIndices struct { // Analysis Contains statistics about analyzers and analyzer components used in selected // nodes. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterindicesshards.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterindicesshards.go index c56980261..d1057516a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterindicesshards.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterindicesshards.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ClusterIndicesShards type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/stats/types.ts#L60-L72 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/stats/types.ts#L60-L72 type ClusterIndicesShards struct { // Index Contains statistics about shards assigned to selected nodes. Index *ClusterIndicesShardsIndex `json:"index,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterindicesshardsindex.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterindicesshardsindex.go index b5f4b0645..53c33e228 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterindicesshardsindex.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterindicesshardsindex.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // ClusterIndicesShardsIndex type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/stats/types.ts#L51-L58 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/stats/types.ts#L51-L58 type ClusterIndicesShardsIndex struct { // Primaries Contains statistics about the number of primary shards assigned to selected // nodes. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterinfo.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterinfo.go index ea7debdfd..6ef3e03f5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterinfo.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterinfo.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // ClusterInfo type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/allocation_explain/types.ts#L48-L54 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/allocation_explain/types.ts#L48-L54 type ClusterInfo struct { Nodes map[string]NodeDiskUsage `json:"nodes"` ReservedSizes []ReservedSize `json:"reserved_sizes"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterinfotargets.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterinfotargets.go index 0d8a816bd..c21dd58b1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterinfotargets.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterinfotargets.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,5 +26,5 @@ import ( // ClusterInfoTargets type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L386-L386 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L397-L397 type ClusterInfoTargets []clusterinfotarget.ClusterInfoTarget diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusteringest.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusteringest.go index 90a52f310..760f26067 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusteringest.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusteringest.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ClusterIngest type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/stats/types.ts#L270-L273 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/stats/types.ts#L270-L273 type ClusterIngest struct { NumberOfPipelines int `json:"number_of_pipelines"` ProcessorStats map[string]ClusterProcessor `json:"processor_stats"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterjvm.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterjvm.go index d23b7b029..6c269a487 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterjvm.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterjvm.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ClusterJvm type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/stats/types.ts#L275-L292 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/stats/types.ts#L275-L292 type ClusterJvm struct { // MaxUptimeInMillis Uptime duration, in milliseconds, since JVM last started. MaxUptimeInMillis int64 `json:"max_uptime_in_millis"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterjvmmemory.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterjvmmemory.go index 518c6b2f7..112a0eb26 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterjvmmemory.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterjvmmemory.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ClusterJvmMemory type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/stats/types.ts#L294-L303 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/stats/types.ts#L294-L303 type ClusterJvmMemory struct { // HeapMaxInBytes Maximum amount of memory, in bytes, available for use by the heap across all // selected nodes. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterjvmversion.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterjvmversion.go index 2806ac61c..739d5047b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterjvmversion.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterjvmversion.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ClusterJvmVersion type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/stats/types.ts#L305-L335 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/stats/types.ts#L305-L335 type ClusterJvmVersion struct { // BundledJdk Always `true`. All distributions come with a bundled Java Development Kit // (JDK). diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusternetworktypes.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusternetworktypes.go index 3e2e2ae59..ce90940c8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusternetworktypes.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusternetworktypes.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // ClusterNetworkTypes type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/stats/types.ts#L337-L346 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/stats/types.ts#L337-L346 type ClusterNetworkTypes struct { // HttpTypes Contains statistics about the HTTP network types used by selected nodes. HttpTypes map[string]int `json:"http_types"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusternode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusternode.go index 66740cd8e..ab64a58f3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusternode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusternode.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // ClusterNode type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/_types/ClusterNode.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/_types/ClusterNode.ts#L22-L24 type ClusterNode struct { Name string `json:"name"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusternodecount.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusternodecount.go index 3cb7c769e..d595919d4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusternodecount.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusternodecount.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ClusterNodeCount type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/stats/types.ts#L348-L367 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/stats/types.ts#L348-L367 type ClusterNodeCount struct { CoordinatingOnly int `json:"coordinating_only"` Data int `json:"data"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusternodes.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusternodes.go index cdb73756b..1a41e36da 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusternodes.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusternodes.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // ClusterNodes type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/stats/types.ts#L369-L402 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/stats/types.ts#L369-L402 type ClusterNodes struct { // Count Contains counts for nodes selected by the request’s node filters. Count ClusterNodeCount `json:"count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusteroperatingsystem.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusteroperatingsystem.go index c1935abaf..8ad8e4c82 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusteroperatingsystem.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusteroperatingsystem.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ClusterOperatingSystem type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/stats/types.ts#L415-L442 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/stats/types.ts#L415-L442 type ClusterOperatingSystem struct { // AllocatedProcessors Number of processors used to calculate thread pool size across all selected // nodes. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusteroperatingsystemarchitecture.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusteroperatingsystemarchitecture.go index 8b8c3174a..4fb47caa2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusteroperatingsystemarchitecture.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusteroperatingsystemarchitecture.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ClusterOperatingSystemArchitecture type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/stats/types.ts#L404-L413 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/stats/types.ts#L404-L413 type ClusterOperatingSystemArchitecture struct { // Arch Name of an architecture used by one or more selected nodes. Arch string `json:"arch"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusteroperatingsystemname.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusteroperatingsystemname.go index 9fe8ca14f..f0115f91f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusteroperatingsystemname.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusteroperatingsystemname.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ClusterOperatingSystemName type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/stats/types.ts#L444-L453 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/stats/types.ts#L444-L453 type ClusterOperatingSystemName struct { // Count Number of selected nodes using the operating system. Count int `json:"count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusteroperatingsystemprettyname.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusteroperatingsystemprettyname.go index 25c3bddcd..2bc71417d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusteroperatingsystemprettyname.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusteroperatingsystemprettyname.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ClusterOperatingSystemPrettyName type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/stats/types.ts#L455-L464 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/stats/types.ts#L455-L464 type ClusterOperatingSystemPrettyName struct { // Count Number of selected nodes using the operating system. Count int `json:"count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterpressurememory.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterpressurememory.go index 96243f351..8fbb5143c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterpressurememory.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterpressurememory.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ClusterPressureMemory type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/stats/types.ts#L574-L578 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/stats/types.ts#L574-L578 type ClusterPressureMemory struct { Current IndexingPressureMemorySummary `json:"current"` LimitInBytes int64 `json:"limit_in_bytes"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterprocess.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterprocess.go index e6ce4a1b9..1f6c83241 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterprocess.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterprocess.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // ClusterProcess type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/stats/types.ts#L466-L475 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/stats/types.ts#L466-L475 type ClusterProcess struct { // Cpu Contains statistics about CPU used by selected nodes. Cpu ClusterProcessCpu `json:"cpu"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterprocesscpu.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterprocesscpu.go index 03aa1ec40..579158eb9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterprocesscpu.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterprocesscpu.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ClusterProcessCpu type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/stats/types.ts#L477-L483 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/stats/types.ts#L477-L483 type ClusterProcessCpu struct { // Percent Percentage of CPU used across all selected nodes. // Returns `-1` if not supported. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterprocessopenfiledescriptors.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterprocessopenfiledescriptors.go index f627a4383..1daf204b3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterprocessopenfiledescriptors.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterprocessopenfiledescriptors.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ClusterProcessOpenFileDescriptors type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/stats/types.ts#L485-L501 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/stats/types.ts#L485-L501 type ClusterProcessOpenFileDescriptors struct { // Avg Average number of concurrently open file descriptors. // Returns `-1` if not supported. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterprocessor.go index 7fe20a488..8025ddb68 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ClusterProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/stats/types.ts#L503-L509 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/stats/types.ts#L503-L509 type ClusterProcessor struct { Count int64 `json:"count"` Current int64 `json:"current"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterremoteinfo.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterremoteinfo.go index 8081a9743..b3f495051 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterremoteinfo.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterremoteinfo.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // ClusterRemoteSniffInfo // ClusterRemoteProxyInfo // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/remote_info/ClusterRemoteInfoResponse.ts#L28-L29 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/remote_info/ClusterRemoteInfoResponse.ts#L28-L29 type ClusterRemoteInfo interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterremoteproxyinfo.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterremoteproxyinfo.go index f8ac4d2bd..a78f4cb4d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterremoteproxyinfo.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterremoteproxyinfo.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ClusterRemoteProxyInfo type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/remote_info/ClusterRemoteInfoResponse.ts#L41-L50 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/remote_info/ClusterRemoteInfoResponse.ts#L41-L50 type ClusterRemoteProxyInfo struct { Connected bool `json:"connected"` InitialConnectTimeout Duration `json:"initial_connect_timeout"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterremotesniffinfo.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterremotesniffinfo.go index d87d944cf..02baebe05 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterremotesniffinfo.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterremotesniffinfo.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ClusterRemoteSniffInfo type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/remote_info/ClusterRemoteInfoResponse.ts#L31-L39 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/remote_info/ClusterRemoteInfoResponse.ts#L31-L39 type ClusterRemoteSniffInfo struct { Connected bool `json:"connected"` InitialConnectTimeout Duration `json:"initial_connect_timeout"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterruntimefieldtypes.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterruntimefieldtypes.go index 150735257..b40d2f9ea 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterruntimefieldtypes.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterruntimefieldtypes.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ClusterRuntimeFieldTypes type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/stats/types.ts#L169-L226 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/stats/types.ts#L169-L226 type ClusterRuntimeFieldTypes struct { // CharsMax Maximum number of characters for a single runtime field script. CharsMax int `json:"chars_max"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clustershardmetrics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clustershardmetrics.go index 584b85ee9..ee7941dc3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clustershardmetrics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clustershardmetrics.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ClusterShardMetrics type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/stats/types.ts#L511-L524 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/stats/types.ts#L511-L524 type ClusterShardMetrics struct { // Avg Mean number of shards in an index, counting only shards assigned to selected // nodes. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterstatequeue.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterstatequeue.go index 663883f30..faf17704c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterstatequeue.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterstatequeue.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ClusterStateQueue type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L248-L261 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L248-L261 type ClusterStateQueue struct { // Committed Number of committed cluster states in queue. Committed *int64 `json:"committed,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterstateupdate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterstateupdate.go index 05f67b992..55b6ffe68 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterstateupdate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterstateupdate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ClusterStateUpdate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L278-L343 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L278-L343 type ClusterStateUpdate struct { // CommitTime The cumulative amount of time spent waiting for a successful cluster state // update to commit, which measures the time from the start of each publication diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterstatistics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterstatistics.go index 900d8cde5..1c8f7de9e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterstatistics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/clusterstatistics.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ClusterStatistics type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Stats.ts#L27-L35 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Stats.ts#L27-L35 type ClusterStatistics struct { Details map[string]ClusterDetails `json:"details,omitempty"` Failed int `json:"failed"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/collector.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/collector.go index afe15ccfc..50c2f8366 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/collector.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/collector.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Collector type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/profile.ts#L86-L91 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/profile.ts#L86-L91 type Collector struct { Children []Collector `json:"children,omitempty"` Name string `json:"name"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/column.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/column.go index ca15ed353..b745f344c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/column.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/column.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Column type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/sql/types.ts#L23-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/sql/types.ts#L23-L26 type Column struct { Name string `json:"name"` Type string `json:"type"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/combinedfieldsquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/combinedfieldsquery.go index 2b10dab8d..53e4749bf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/combinedfieldsquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/combinedfieldsquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -33,7 +33,7 @@ import ( // CombinedFieldsQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/abstractions.ts#L429-L463 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/abstractions.ts#L429-L463 type CombinedFieldsQuery struct { // AutoGenerateSynonymsPhraseQuery If true, match phrase queries are automatically created for multi-term // synonyms. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/command.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/command.go index 9d057d83b..8e6218e3c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/command.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/command.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // Command type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/reroute/types.ts#L22-L43 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/reroute/types.ts#L22-L43 type Command struct { // AllocateEmptyPrimary Allocate an empty primary shard to a node. Accepts the index and shard for // index name and shard number, and node to allocate the shard to. Using this diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/commandallocateprimaryaction.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/commandallocateprimaryaction.go index 68f58d123..ff4a113fd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/commandallocateprimaryaction.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/commandallocateprimaryaction.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CommandAllocatePrimaryAction type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/reroute/types.ts#L78-L84 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/reroute/types.ts#L78-L84 type CommandAllocatePrimaryAction struct { // AcceptDataLoss If a node which has a copy of the data rejoins the cluster later on, that // data will be deleted. To ensure that these implications are well-understood, diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/commandallocatereplicaaction.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/commandallocatereplicaaction.go index 2d07b4b04..4b135fca2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/commandallocatereplicaaction.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/commandallocatereplicaaction.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CommandAllocateReplicaAction type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/reroute/types.ts#L69-L76 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/reroute/types.ts#L69-L76 type CommandAllocateReplicaAction struct { Index string `json:"index"` Node string `json:"node"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/commandcancelaction.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/commandcancelaction.go index 05b411ed3..d5c2ddaca 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/commandcancelaction.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/commandcancelaction.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CommandCancelAction type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/reroute/types.ts#L45-L50 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/reroute/types.ts#L45-L50 type CommandCancelAction struct { AllowPrimary *bool `json:"allow_primary,omitempty"` Index string `json:"index"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/commandmoveaction.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/commandmoveaction.go index 9424689cc..6a37e4149 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/commandmoveaction.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/commandmoveaction.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CommandMoveAction type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/reroute/types.ts#L60-L67 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/reroute/types.ts#L60-L67 type CommandMoveAction struct { // FromNode The node to move the shard from FromNode string `json:"from_node"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/commongramstokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/commongramstokenfilter.go index 88d1c2f5f..a5ca7cb75 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/commongramstokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/commongramstokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CommonGramsTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L173-L179 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L173-L179 type CommonGramsTokenFilter struct { CommonWords []string `json:"common_words,omitempty"` CommonWordsPath *string `json:"common_words_path,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/commontermsquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/commontermsquery.go index a80cc8dfc..e99905678 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/commontermsquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/commontermsquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // CommonTermsQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/fulltext.ts#L34-L44 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/fulltext.ts#L34-L44 type CommonTermsQuery struct { Analyzer *string `json:"analyzer,omitempty"` // Boost Floating point number used to decrease or increase the relevance scores of diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compactnodeinfo.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compactnodeinfo.go index 8b9759948..48396798f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compactnodeinfo.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compactnodeinfo.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // CompactNodeInfo type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/verify_repository/SnapshotVerifyRepositoryResponse.ts#L27-L29 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/verify_repository/SnapshotVerifyRepositoryResponse.ts#L27-L29 type CompactNodeInfo struct { Name string `json:"name"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/completioncontext.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/completioncontext.go index 29b425072..82a1aae54 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/completioncontext.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/completioncontext.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CompletionContext type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/suggester.ts#L232-L261 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/suggester.ts#L232-L261 type CompletionContext struct { // Boost The factor by which the score of the suggestion should be boosted. // The score is computed by multiplying the boost with the suggestion weight. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/completionproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/completionproperty.go index f40ca035b..047b6c4b9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/completionproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/completionproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // CompletionProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/specialized.ts#L27-L35 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/specialized.ts#L27-L35 type CompletionProperty struct { Analyzer *string `json:"analyzer,omitempty"` Contexts []SuggestContext `json:"contexts,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/completionstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/completionstats.go index 6632fdd87..cd06e3825 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/completionstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/completionstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CompletionStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Stats.ts#L80-L90 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Stats.ts#L80-L90 type CompletionStats struct { Fields map[string]FieldSizeUsage `json:"fields,omitempty"` // Size Total amount of memory used for completion across all shards assigned to diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/completionsuggest.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/completionsuggest.go index 3b09b98fc..40dbce1a6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/completionsuggest.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/completionsuggest.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CompletionSuggest type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/suggester.ts#L48-L55 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/suggester.ts#L48-L55 type CompletionSuggest struct { Length int `json:"length"` Offset int `json:"offset"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/completionsuggester.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/completionsuggester.go index 0e5235fdc..e5225eff5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/completionsuggester.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/completionsuggester.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CompletionSuggester type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/suggester.ts#L160-L178 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/suggester.ts#L160-L178 type CompletionSuggester struct { // Analyzer The analyzer to analyze the suggest text with. // Defaults to the search analyzer of the suggest field. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/completionsuggestoption.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/completionsuggestoption.go index a7e8ef4d6..5282428c3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/completionsuggestoption.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/completionsuggestoption.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CompletionSuggestOption type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/suggester.ts#L73-L84 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/suggester.ts#L73-L84 type CompletionSuggestOption struct { CollateMatch *bool `json:"collate_match,omitempty"` Contexts map[string][]Context `json:"contexts,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/componenttemplatenode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/componenttemplatenode.go index 14f956b02..7c864bea0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/componenttemplatenode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/componenttemplatenode.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // ComponentTemplateNode type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/_types/ComponentTemplate.ts#L35-L40 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/_types/ComponentTemplate.ts#L35-L40 type ComponentTemplateNode struct { Meta_ Metadata `json:"_meta,omitempty"` Template ComponentTemplateSummary `json:"template"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/componenttemplatesummary.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/componenttemplatesummary.go index 5f8942772..bded2eacf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/componenttemplatesummary.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/componenttemplatesummary.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // ComponentTemplateSummary type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/_types/ComponentTemplate.ts#L42-L54 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/_types/ComponentTemplate.ts#L42-L54 type ComponentTemplateSummary struct { Aliases map[string]AliasDefinition `json:"aliases,omitempty"` Lifecycle *DataStreamLifecycleWithRollover `json:"lifecycle,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositeaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositeaggregate.go index fc407125e..102ce4b9a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositeaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositeaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // CompositeAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L618-L623 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L618-L623 type CompositeAggregate struct { AfterKey CompositeAggregateKey `json:"after_key,omitempty"` Buckets BucketsCompositeBucket `json:"buckets"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositeaggregatekey.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositeaggregatekey.go index 571b696a4..2cefaa67f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositeaggregatekey.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositeaggregatekey.go @@ -16,11 +16,11 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // CompositeAggregateKey type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L118-L118 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L118-L118 type CompositeAggregateKey map[string]FieldValue diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositeaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositeaggregation.go index 56fc78af2..ff6894aba 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositeaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositeaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CompositeAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L120-L136 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L120-L136 type CompositeAggregation struct { // After When paginating, use the `after_key` value returned in the previous response // to retrieve the next page. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositeaggregationsource.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositeaggregationsource.go index e0563a885..d954a02db 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositeaggregationsource.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositeaggregationsource.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // CompositeAggregationSource type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L138-L155 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L138-L155 type CompositeAggregationSource struct { // DateHistogram A date histogram aggregation. DateHistogram *CompositeDateHistogramAggregation `json:"date_histogram,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositebucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositebucket.go index b82ce5563..db38c0e45 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositebucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositebucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // CompositeBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L625-L627 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L625-L627 type CompositeBucket struct { Aggregations map[string]Aggregate `json:"-"` DocCount int64 `json:"doc_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositedatehistogramaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositedatehistogramaggregation.go index f83d02c73..3b45c0056 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositedatehistogramaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositedatehistogramaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -34,7 +34,7 @@ import ( // CompositeDateHistogramAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L174-L182 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L174-L182 type CompositeDateHistogramAggregation struct { // CalendarInterval Either `calendar_interval` or `fixed_interval` must be present CalendarInterval *string `json:"calendar_interval,omitempty"` @@ -125,9 +125,40 @@ func (s *CompositeDateHistogramAggregation) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } case "time_zone": if err := dec.Decode(&s.TimeZone); err != nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositegeotilegridaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositegeotilegridaggregation.go index a6edb6ea7..015b6a9ab 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositegeotilegridaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositegeotilegridaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -34,7 +34,7 @@ import ( // CompositeGeoTileGridAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L184-L187 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L184-L187 type CompositeGeoTileGridAggregation struct { Bounds GeoBounds `json:"bounds,omitempty"` // Field Either `field` or `script` must be present @@ -114,9 +114,40 @@ func (s *CompositeGeoTileGridAggregation) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } case "value_type": if err := dec.Decode(&s.ValueType); err != nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositehistogramaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositehistogramaggregation.go index 8cc07ec5e..d39ab85e8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositehistogramaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositehistogramaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -34,7 +34,7 @@ import ( // CompositeHistogramAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L170-L172 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L170-L172 type CompositeHistogramAggregation struct { // Field Either `field` or `script` must be present Field *string `json:"field,omitempty"` @@ -108,9 +108,40 @@ func (s *CompositeHistogramAggregation) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } case "value_type": if err := dec.Decode(&s.ValueType); err != nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositetermsaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositetermsaggregation.go index 8c7049656..d8ebda13c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositetermsaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/compositetermsaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -34,7 +34,7 @@ import ( // CompositeTermsAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L168-L168 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L168-L168 type CompositeTermsAggregation struct { // Field Either `field` or `script` must be present Field *string `json:"field,omitempty"` @@ -91,9 +91,40 @@ func (s *CompositeTermsAggregation) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } case "value_type": if err := dec.Decode(&s.ValueType); err != nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/conditiontokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/conditiontokenfilter.go index fca7fad24..53102830d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/conditiontokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/conditiontokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // ConditionTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L181-L185 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L181-L185 type ConditionTokenFilter struct { Filter []string `json:"filter"` Script Script `json:"script"` @@ -58,9 +58,40 @@ func (s *ConditionTokenFilter) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } case "type": if err := dec.Decode(&s.Type); err != nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/configuration.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/configuration.go index eb6012a89..97bccdc3d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/configuration.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/configuration.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Configuration type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/slm/_types/SnapshotLifecycle.ts#L99-L129 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/slm/_types/SnapshotLifecycle.ts#L99-L129 type Configuration struct { // FeatureStates A list of feature states to be included in this snapshot. A list of features // available for inclusion in the snapshot and their descriptions be can be diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/configurations.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/configurations.go index f47b1cdc4..c598b797a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/configurations.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/configurations.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // Configurations type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ilm/_types/Phase.ts#L50-L54 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ilm/_types/Phase.ts#L50-L54 type Configurations struct { Forcemerge *ForceMergeConfiguration `json:"forcemerge,omitempty"` Rollover *RolloverConditions `json:"rollover,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/confusionmatrixitem.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/confusionmatrixitem.go index ba25eea0c..b175f1bc2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/confusionmatrixitem.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/confusionmatrixitem.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ConfusionMatrixItem type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/evaluate_data_frame/types.ts#L125-L130 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/evaluate_data_frame/types.ts#L125-L130 type ConfusionMatrixItem struct { ActualClass string `json:"actual_class"` ActualClassDocCount int `json:"actual_class_doc_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/confusionmatrixprediction.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/confusionmatrixprediction.go index e046ddb1e..158a199a6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/confusionmatrixprediction.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/confusionmatrixprediction.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ConfusionMatrixPrediction type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/evaluate_data_frame/types.ts#L132-L135 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/evaluate_data_frame/types.ts#L132-L135 type ConfusionMatrixPrediction struct { Count int `json:"count"` PredictedClass string `json:"predicted_class"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/confusionmatrixthreshold.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/confusionmatrixthreshold.go index 811976aaa..a8c5ec3e4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/confusionmatrixthreshold.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/confusionmatrixthreshold.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ConfusionMatrixThreshold type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/evaluate_data_frame/types.ts#L137-L158 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/evaluate_data_frame/types.ts#L137-L158 type ConfusionMatrixThreshold struct { // FalseNegative False Negative FalseNegative int `json:"fn"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/connection.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/connection.go index d484131b3..4089431ef 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/connection.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/connection.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Connection type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/graph/_types/Connection.ts#L22-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/graph/_types/Connection.ts#L22-L27 type Connection struct { DocCount int64 `json:"doc_count"` Source int64 `json:"source"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/constantkeywordproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/constantkeywordproperty.go index b6d5e45ff..794e25b34 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/constantkeywordproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/constantkeywordproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // ConstantKeywordProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/specialized.ts#L44-L47 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/specialized.ts#L44-L47 type ConstantKeywordProperty struct { Dynamic *dynamicmapping.DynamicMapping `json:"dynamic,omitempty"` Fields map[string]Property `json:"fields,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/constantscorequery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/constantscorequery.go index a0e536171..059498c20 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/constantscorequery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/constantscorequery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ConstantScoreQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/compound.ts#L69-L76 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/compound.ts#L69-L76 type ConstantScoreQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/context.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/context.go index 2a907cd19..e4344fdee 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/context.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/context.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // string // GeoLocation // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/suggester.ts#L225-L230 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/suggester.ts#L225-L230 type Context interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/contextmethod.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/contextmethod.go index 3cf1b610c..74687a16a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/contextmethod.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/contextmethod.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ContextMethod type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/get_script_context/types.ts#L27-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/get_script_context/types.ts#L27-L31 type ContextMethod struct { Name string `json:"name"` Params []ContextMethodParam `json:"params"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/contextmethodparam.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/contextmethodparam.go index 5e6e9edbc..d2ed6035c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/contextmethodparam.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/contextmethodparam.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ContextMethodParam type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/get_script_context/types.ts#L33-L36 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/get_script_context/types.ts#L33-L36 type ContextMethodParam struct { Name string `json:"name"` Type string `json:"type"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/convertprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/convertprocessor.go index b09b44ee5..24d09421a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/convertprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/convertprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // ConvertProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L434-L454 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L434-L454 type ConvertProcessor struct { // Description Description of the processor. // Useful for describing the purpose of the processor or its configuration. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/coordinatorstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/coordinatorstats.go index e9c88e300..5a40f40e4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/coordinatorstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/coordinatorstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CoordinatorStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/enrich/stats/types.ts#L29-L35 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/enrich/stats/types.ts#L29-L35 type CoordinatorStats struct { ExecutedSearchesTotal int64 `json:"executed_searches_total"` NodeId string `json:"node_id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/coordsgeobounds.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/coordsgeobounds.go index 875dcaf99..aa597193c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/coordsgeobounds.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/coordsgeobounds.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CoordsGeoBounds type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Geo.ts#L163-L168 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Geo.ts#L163-L168 type CoordsGeoBounds struct { Bottom Float64 `json:"bottom"` Left Float64 `json:"left"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/coreknnquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/coreknnquery.go index 0cfaed7f2..d970fd8bc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/coreknnquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/coreknnquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CoreKnnQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/knn_search/_types/Knn.ts#L24-L33 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/knn_search/_types/Knn.ts#L24-L33 type CoreKnnQuery struct { // Field The name of the vector field to search against Field string `json:"field"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/counter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/counter.go index a162aa4ef..fd2d017a9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/counter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/counter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Counter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L35-L38 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L35-L38 type Counter struct { Active int64 `json:"active"` Total int64 `json:"total"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/countrecord.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/countrecord.go index 33e59647c..495c846fe 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/countrecord.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/countrecord.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CountRecord type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/count/types.ts#L23-L39 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/count/types.ts#L23-L39 type CountRecord struct { // Count the document count Count *string `json:"count,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cpu.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cpu.go index 12a258e48..f3a14086c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cpu.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cpu.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Cpu type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L539-L548 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L539-L548 type Cpu struct { LoadAverage map[string]Float64 `json:"load_average,omitempty"` Percent *int `json:"percent,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cpuacct.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cpuacct.go index aa19232b2..50170ba00 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cpuacct.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cpuacct.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CpuAcct type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L476-L485 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L476-L485 type CpuAcct struct { // ControlGroup The `cpuacct` control group to which the Elasticsearch process belongs. ControlGroup *string `json:"control_group,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/createdstatus.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/createdstatus.go index eda016e8a..80cef3409 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/createdstatus.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/createdstatus.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CreatedStatus type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/_types/CreatedStatus.ts#L20-L22 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/_types/CreatedStatus.ts#L20-L22 type CreatedStatus struct { Created bool `json:"created"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/createoperation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/createoperation.go index 7f1b3384c..4a678bffa 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/createoperation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/createoperation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // CreateOperation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/bulk/types.ts#L130-L130 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/bulk/types.ts#L130-L130 type CreateOperation struct { // DynamicTemplates A map from the full name of fields to the name of dynamic templates. // Defaults to an empty map. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/csvprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/csvprocessor.go index 2ffc2014c..4158e5a77 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/csvprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/csvprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CsvProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L456-L489 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L456-L489 type CsvProcessor struct { // Description Description of the processor. // Useful for describing the purpose of the processor or its configuration. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cumulativecardinalityaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cumulativecardinalityaggregate.go index 2281b7697..39cdc167d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cumulativecardinalityaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cumulativecardinalityaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CumulativeCardinalityAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L747-L755 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L747-L755 type CumulativeCardinalityAggregate struct { Meta Metadata `json:"meta,omitempty"` Value int64 `json:"value"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cumulativecardinalityaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cumulativecardinalityaggregation.go index 4a56bd92f..37f3fb108 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cumulativecardinalityaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cumulativecardinalityaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // CumulativeCardinalityAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L192-L192 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L192-L192 type CumulativeCardinalityAggregation struct { // BucketsPath Path to the buckets that contain one set of values to correlate. BucketsPath BucketsPath `json:"buckets_path,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cumulativesumaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cumulativesumaggregation.go index b4df89a74..745914bf2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cumulativesumaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/cumulativesumaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // CumulativeSumAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L194-L194 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L194-L194 type CumulativeSumAggregation struct { // BucketsPath Path to the buckets that contain one set of values to correlate. BucketsPath BucketsPath `json:"buckets_path,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/currentnode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/currentnode.go index f7e585a2e..51caf59f9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/currentnode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/currentnode.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CurrentNode type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/allocation_explain/types.ts#L78-L84 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/allocation_explain/types.ts#L78-L84 type CurrentNode struct { Attributes map[string]string `json:"attributes"` Id string `json:"id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/customanalyzer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/customanalyzer.go index bde5876be..1b92813d1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/customanalyzer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/customanalyzer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CustomAnalyzer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/analyzers.ts#L28-L35 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/analyzers.ts#L28-L35 type CustomAnalyzer struct { CharFilter []string `json:"char_filter,omitempty"` Filter []string `json:"filter,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/customcategorizetextanalyzer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/customcategorizetextanalyzer.go index 9aa5e6faf..95a346c24 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/customcategorizetextanalyzer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/customcategorizetextanalyzer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // CustomCategorizeTextAnalyzer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L1108-L1112 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L1108-L1112 type CustomCategorizeTextAnalyzer struct { CharFilter []string `json:"char_filter,omitempty"` Filter []string `json:"filter,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/customnormalizer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/customnormalizer.go index fa506965a..ad00f3a14 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/customnormalizer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/customnormalizer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,7 +26,7 @@ import ( // CustomNormalizer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/normalizers.ts#L30-L34 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/normalizers.ts#L30-L34 type CustomNormalizer struct { CharFilter []string `json:"char_filter,omitempty"` Filter []string `json:"filter,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dailyschedule.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dailyschedule.go index 052869751..76c1cd04b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dailyschedule.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dailyschedule.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // DailySchedule type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Schedule.ts#L33-L35 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Schedule.ts#L33-L35 type DailySchedule struct { At []ScheduleTimeOfDay `json:"at"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/danglingindex.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/danglingindex.go index 4cf4db99b..715f67352 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/danglingindex.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/danglingindex.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DanglingIndex type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/dangling_indices/list_dangling_indices/ListDanglingIndicesResponse.ts#L29-L34 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/dangling_indices/list_dangling_indices/ListDanglingIndicesResponse.ts#L29-L34 type DanglingIndex struct { CreationDateMillis int64 `json:"creation_date_millis"` IndexName string `json:"index_name"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datacounts.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datacounts.go index 8a2ff223d..03e9ef955 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datacounts.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datacounts.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataCounts type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Job.ts#L352-L372 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Job.ts#L352-L372 type DataCounts struct { BucketCount int64 `json:"bucket_count"` EarliestRecordTimestamp *int64 `json:"earliest_record_timestamp,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datadescription.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datadescription.go index bf3473727..e1699c430 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datadescription.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datadescription.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataDescription type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Job.ts#L374-L390 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Job.ts#L374-L390 type DataDescription struct { FieldDelimiter *string `json:"field_delimiter,omitempty"` // Format Only JSON format is supported at this time. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataemailattachment.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataemailattachment.go index f8d170ff8..e1f7b44cd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataemailattachment.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataemailattachment.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,7 +26,7 @@ import ( // DataEmailAttachment type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Actions.ts#L234-L236 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Actions.ts#L234-L236 type DataEmailAttachment struct { Format *dataattachmentformat.DataAttachmentFormat `json:"format,omitempty"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datafeedauthorization.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datafeedauthorization.go index 1bef6f771..6df4bc5fc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datafeedauthorization.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datafeedauthorization.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DatafeedAuthorization type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Authorization.ts#L31-L43 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Authorization.ts#L31-L43 type DatafeedAuthorization struct { // ApiKey If an API key was used for the most recent update to the datafeed, its name // and identifier are listed in the response. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datafeedconfig.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datafeedconfig.go index b9f471918..ba6e01caf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datafeedconfig.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datafeedconfig.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DatafeedConfig type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Datafeed.ts#L60-L117 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Datafeed.ts#L60-L117 type DatafeedConfig struct { // Aggregations If set, the datafeed performs aggregation searches. Support for aggregations // is limited and should be used only with low cardinality data. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datafeedrunningstate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datafeedrunningstate.go index 8dc77ef0a..07d759a36 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datafeedrunningstate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datafeedrunningstate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DatafeedRunningState type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Datafeed.ts#L198-L212 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Datafeed.ts#L198-L212 type DatafeedRunningState struct { // RealTimeConfigured Indicates if the datafeed is "real-time"; meaning that the datafeed has no // configured `end` time. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datafeeds.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datafeeds.go index 656aa01ce..6462a2963 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datafeeds.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datafeeds.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Datafeeds type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/info/types.ts#L40-L42 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/info/types.ts#L40-L42 type Datafeeds struct { ScrollSize int `json:"scroll_size"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datafeedsrecord.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datafeedsrecord.go index ef6b7f2d6..e1407e542 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datafeedsrecord.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datafeedsrecord.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // DatafeedsRecord type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/ml_datafeeds/types.ts#L22-L87 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/ml_datafeeds/types.ts#L22-L87 type DatafeedsRecord struct { // AssignmentExplanation For started datafeeds only, contains messages relating to the selection of a // node. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datafeedstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datafeedstats.go index a8c88470a..82787298f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datafeedstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datafeedstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // DatafeedStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Datafeed.ts#L140-L169 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Datafeed.ts#L140-L169 type DatafeedStats struct { // AssignmentExplanation For started datafeeds only, contains messages relating to the selection of a // node. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datafeedtimingstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datafeedtimingstats.go index 555b4d5e0..5445f8bd8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datafeedtimingstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datafeedtimingstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DatafeedTimingStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Datafeed.ts#L171-L196 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Datafeed.ts#L171-L196 type DatafeedTimingStats struct { // AverageSearchTimePerBucketMs The average search time per bucket, in milliseconds. AverageSearchTimePerBucketMs Float64 `json:"average_search_time_per_bucket_ms,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysis.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysis.go index a45562f37..d12683f4f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysis.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysis.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataframeAnalysis type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeAnalytics.ts#L134-L213 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeAnalytics.ts#L134-L213 type DataframeAnalysis struct { // Alpha Advanced configuration option. Machine learning uses loss guided tree // growing, which means that the decision trees grow where the regularized loss diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisanalyzedfields.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisanalyzedfields.go index f613816b7..c6b8f751c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisanalyzedfields.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisanalyzedfields.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // DataframeAnalysisAnalyzedFields type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeAnalytics.ts#L238-L244 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeAnalytics.ts#L238-L244 type DataframeAnalysisAnalyzedFields struct { // Excludes An array of strings that defines the fields that will be included in the // analysis. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisclassification.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisclassification.go index 4a86f6d74..d1cd83c8e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisclassification.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisclassification.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataframeAnalysisClassification type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeAnalytics.ts#L227-L236 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeAnalytics.ts#L227-L236 type DataframeAnalysisClassification struct { // Alpha Advanced configuration option. Machine learning uses loss guided tree // growing, which means that the decision trees grow where the regularized loss diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysiscontainer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysiscontainer.go index 39525b2fd..315d93630 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysiscontainer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysiscontainer.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // DataframeAnalysisContainer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeAnalytics.ts#L84-L101 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeAnalytics.ts#L84-L101 type DataframeAnalysisContainer struct { // Classification The configuration information necessary to perform classification. Classification *DataframeAnalysisClassification `json:"classification,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisfeatureprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisfeatureprocessor.go index 964a897bc..107f61e54 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisfeatureprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisfeatureprocessor.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // DataframeAnalysisFeatureProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeAnalytics.ts#L246-L258 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeAnalytics.ts#L246-L258 type DataframeAnalysisFeatureProcessor struct { // FrequencyEncoding The configuration information necessary to perform frequency encoding. FrequencyEncoding *DataframeAnalysisFeatureProcessorFrequencyEncoding `json:"frequency_encoding,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisfeatureprocessorfrequencyencoding.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisfeatureprocessorfrequencyencoding.go index 0ea17274a..2b3aa1501 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisfeatureprocessorfrequencyencoding.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisfeatureprocessorfrequencyencoding.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // DataframeAnalysisFeatureProcessorFrequencyEncoding type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeAnalytics.ts#L260-L267 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeAnalytics.ts#L260-L267 type DataframeAnalysisFeatureProcessorFrequencyEncoding struct { // FeatureName The resulting feature name. FeatureName string `json:"feature_name"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisfeatureprocessormultiencoding.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisfeatureprocessormultiencoding.go index 900a77aef..6ca9c96c7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisfeatureprocessormultiencoding.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisfeatureprocessormultiencoding.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // DataframeAnalysisFeatureProcessorMultiEncoding type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeAnalytics.ts#L269-L272 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeAnalytics.ts#L269-L272 type DataframeAnalysisFeatureProcessorMultiEncoding struct { // Processors The ordered array of custom processors to execute. Must be more than 1. Processors []int `json:"processors"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisfeatureprocessorngramencoding.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisfeatureprocessorngramencoding.go index a0ca87247..3811bae24 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisfeatureprocessorngramencoding.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisfeatureprocessorngramencoding.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataframeAnalysisFeatureProcessorNGramEncoding type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeAnalytics.ts#L274-L286 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeAnalytics.ts#L274-L286 type DataframeAnalysisFeatureProcessorNGramEncoding struct { Custom *bool `json:"custom,omitempty"` // FeaturePrefix The feature name prefix. Defaults to ngram__. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisfeatureprocessoronehotencoding.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisfeatureprocessoronehotencoding.go index dd05590c7..b332bd6a8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisfeatureprocessoronehotencoding.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisfeatureprocessoronehotencoding.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataframeAnalysisFeatureProcessorOneHotEncoding type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeAnalytics.ts#L288-L293 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeAnalytics.ts#L288-L293 type DataframeAnalysisFeatureProcessorOneHotEncoding struct { // Field The name of the field to encode. Field string `json:"field"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisfeatureprocessortargetmeanencoding.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisfeatureprocessortargetmeanencoding.go index 4101991f8..9593bbaa8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisfeatureprocessortargetmeanencoding.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisfeatureprocessortargetmeanencoding.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataframeAnalysisFeatureProcessorTargetMeanEncoding type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeAnalytics.ts#L295-L304 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeAnalytics.ts#L295-L304 type DataframeAnalysisFeatureProcessorTargetMeanEncoding struct { // DefaultValue The default value if field value is not found in the target_map. DefaultValue int `json:"default_value"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisoutlierdetection.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisoutlierdetection.go index 3398fcccb..f27174f57 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisoutlierdetection.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisoutlierdetection.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataframeAnalysisOutlierDetection type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeAnalytics.ts#L103-L132 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeAnalytics.ts#L103-L132 type DataframeAnalysisOutlierDetection struct { // ComputeFeatureInfluence Specifies whether the feature influence calculation is enabled. ComputeFeatureInfluence *bool `json:"compute_feature_influence,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisregression.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisregression.go index 141c809a9..7cbd25517 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisregression.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalysisregression.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataframeAnalysisRegression type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeAnalytics.ts#L215-L225 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeAnalytics.ts#L215-L225 type DataframeAnalysisRegression struct { // Alpha Advanced configuration option. Machine learning uses loss guided tree // growing, which means that the decision trees grow where the regularized loss diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalytics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalytics.go index 281566198..95c089501 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalytics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalytics.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // DataframeAnalytics type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeAnalytics.ts#L324-L344 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeAnalytics.ts#L324-L344 type DataframeAnalytics struct { // AnalysisStats An object containing information about the analysis job. AnalysisStats *DataframeAnalyticsStatsContainer `json:"analysis_stats,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsauthorization.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsauthorization.go index 10cb858ce..ee4638496 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsauthorization.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsauthorization.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataframeAnalyticsAuthorization type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Authorization.ts#L45-L57 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Authorization.ts#L45-L57 type DataframeAnalyticsAuthorization struct { // ApiKey If an API key was used for the most recent update to the job, its name and // identifier are listed in the response. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsdestination.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsdestination.go index 5fee63e1c..091ee91c2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsdestination.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsdestination.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // DataframeAnalyticsDestination type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeAnalytics.ts#L77-L82 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeAnalytics.ts#L77-L82 type DataframeAnalyticsDestination struct { // Index Defines the destination index to store the results of the data frame // analytics job. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsfieldselection.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsfieldselection.go index 6a795e5e7..28a0a69ac 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsfieldselection.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsfieldselection.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataframeAnalyticsFieldSelection type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeAnalytics.ts#L55-L68 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeAnalytics.ts#L55-L68 type DataframeAnalyticsFieldSelection struct { // FeatureType The feature type of this field for the analysis. May be categorical or // numerical. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsmemoryestimation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsmemoryestimation.go index b88fbc172..368807641 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsmemoryestimation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsmemoryestimation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataframeAnalyticsMemoryEstimation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeAnalytics.ts#L70-L75 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeAnalytics.ts#L70-L75 type DataframeAnalyticsMemoryEstimation struct { // ExpectedMemoryWithDisk Estimated memory usage under the assumption that overflowing to disk is // allowed during data frame analytics. expected_memory_with_disk is usually diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsrecord.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsrecord.go index 9f13fc9b3..bbc266239 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsrecord.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsrecord.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataFrameAnalyticsRecord type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/ml_data_frame_analytics/types.ts#L22-L102 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/ml_data_frame_analytics/types.ts#L22-L102 type DataFrameAnalyticsRecord struct { // AssignmentExplanation Messages related to the selection of a node. AssignmentExplanation *string `json:"assignment_explanation,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticssource.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticssource.go index 0ae17a263..131c1c080 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticssource.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticssource.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // DataframeAnalyticsSource type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeAnalytics.ts#L39-L53 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeAnalytics.ts#L39-L53 type DataframeAnalyticsSource struct { // Index Index or indices on which to perform the analysis. It can be a single index // or index pattern as well as an array of indices or patterns. NOTE: If your diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsstatscontainer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsstatscontainer.go index 63493ec82..f00d5212e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsstatscontainer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsstatscontainer.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // DataframeAnalyticsStatsContainer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeAnalytics.ts#L373-L381 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeAnalytics.ts#L373-L381 type DataframeAnalyticsStatsContainer struct { // ClassificationStats An object containing information about the classification analysis job. ClassificationStats *DataframeAnalyticsStatsHyperparameters `json:"classification_stats,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsstatsdatacounts.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsstatsdatacounts.go index ee072edd9..054e3f7b8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsstatsdatacounts.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsstatsdatacounts.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataframeAnalyticsStatsDataCounts type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeAnalytics.ts#L364-L371 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeAnalytics.ts#L364-L371 type DataframeAnalyticsStatsDataCounts struct { // SkippedDocsCount The number of documents that are skipped during the analysis because they // contained values that are not supported by the analysis. For example, outlier diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsstatshyperparameters.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsstatshyperparameters.go index 1890e89ff..8b646bae6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsstatshyperparameters.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsstatshyperparameters.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataframeAnalyticsStatsHyperparameters type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeAnalytics.ts#L383-L402 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeAnalytics.ts#L383-L402 type DataframeAnalyticsStatsHyperparameters struct { // Hyperparameters An object containing the parameters of the classification analysis job. Hyperparameters Hyperparameters `json:"hyperparameters"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsstatsmemoryusage.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsstatsmemoryusage.go index 4a2837f2f..807dbf12a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsstatsmemoryusage.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsstatsmemoryusage.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataframeAnalyticsStatsMemoryUsage type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeAnalytics.ts#L353-L362 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeAnalytics.ts#L353-L362 type DataframeAnalyticsStatsMemoryUsage struct { // MemoryReestimateBytes This value is present when the status is hard_limit and it is a new estimate // of how much memory the job needs. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsstatsoutlierdetection.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsstatsoutlierdetection.go index 41e26fe76..2268aad96 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsstatsoutlierdetection.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsstatsoutlierdetection.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // DataframeAnalyticsStatsOutlierDetection type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeAnalytics.ts#L404-L417 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeAnalytics.ts#L404-L417 type DataframeAnalyticsStatsOutlierDetection struct { // Parameters The list of job parameters specified by the user or determined by algorithmic // heuristics. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsstatsprogress.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsstatsprogress.go index 20c8af787..0030ae581 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsstatsprogress.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticsstatsprogress.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataframeAnalyticsStatsProgress type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeAnalytics.ts#L346-L351 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeAnalytics.ts#L346-L351 type DataframeAnalyticsStatsProgress struct { // Phase Defines the phase of the data frame analytics job. Phase string `json:"phase"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticssummary.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticssummary.go index 72d8c3eb0..af311667e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticssummary.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeanalyticssummary.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataframeAnalyticsSummary type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeAnalytics.ts#L306-L322 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeAnalytics.ts#L306-L322 type DataframeAnalyticsSummary struct { AllowLazyStart *bool `json:"allow_lazy_start,omitempty"` Analysis DataframeAnalysisContainer `json:"analysis"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeclassificationsummary.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeclassificationsummary.go index b544aab07..cc849ff2a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeclassificationsummary.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeclassificationsummary.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // DataframeClassificationSummary type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/evaluate_data_frame/types.ts#L44-L66 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/evaluate_data_frame/types.ts#L44-L66 type DataframeClassificationSummary struct { // Accuracy Accuracy of predictions (per-class and overall). Accuracy *DataframeClassificationSummaryAccuracy `json:"accuracy,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeclassificationsummaryaccuracy.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeclassificationsummaryaccuracy.go index a72125ec0..61bc4517d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeclassificationsummaryaccuracy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeclassificationsummaryaccuracy.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataframeClassificationSummaryAccuracy type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/evaluate_data_frame/types.ts#L111-L114 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/evaluate_data_frame/types.ts#L111-L114 type DataframeClassificationSummaryAccuracy struct { Classes []DataframeEvaluationClass `json:"classes"` OverallAccuracy Float64 `json:"overall_accuracy"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeclassificationsummarymulticlassconfusionmatrix.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeclassificationsummarymulticlassconfusionmatrix.go index c2041ec60..a1d37d25f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeclassificationsummarymulticlassconfusionmatrix.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeclassificationsummarymulticlassconfusionmatrix.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataframeClassificationSummaryMulticlassConfusionMatrix type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/evaluate_data_frame/types.ts#L120-L123 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/evaluate_data_frame/types.ts#L120-L123 type DataframeClassificationSummaryMulticlassConfusionMatrix struct { ConfusionMatrix []ConfusionMatrixItem `json:"confusion_matrix"` OtherActualClassCount int `json:"other_actual_class_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeclassificationsummaryprecision.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeclassificationsummaryprecision.go index c86c4e707..994188934 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeclassificationsummaryprecision.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeclassificationsummaryprecision.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataframeClassificationSummaryPrecision type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/evaluate_data_frame/types.ts#L101-L104 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/evaluate_data_frame/types.ts#L101-L104 type DataframeClassificationSummaryPrecision struct { AvgPrecision Float64 `json:"avg_precision"` Classes []DataframeEvaluationClass `json:"classes"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeclassificationsummaryrecall.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeclassificationsummaryrecall.go index f6292e84c..2f4a5ecac 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeclassificationsummaryrecall.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeclassificationsummaryrecall.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataframeClassificationSummaryRecall type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/evaluate_data_frame/types.ts#L106-L109 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/evaluate_data_frame/types.ts#L106-L109 type DataframeClassificationSummaryRecall struct { AvgRecall Float64 `json:"avg_recall"` Classes []DataframeEvaluationClass `json:"classes"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationclass.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationclass.go index 6338ec7a7..310d2f84f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationclass.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationclass.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataframeEvaluationClass type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/evaluate_data_frame/types.ts#L116-L118 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/evaluate_data_frame/types.ts#L116-L118 type DataframeEvaluationClass struct { ClassName string `json:"class_name"` Value Float64 `json:"value"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationclassification.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationclassification.go index e19da5ac3..c70ad289c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationclassification.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationclassification.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // DataframeEvaluationClassification type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeEvaluation.ts#L35-L44 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeEvaluation.ts#L35-L44 type DataframeEvaluationClassification struct { // ActualField The field of the index which contains the ground truth. The data type of this // field can be boolean or integer. If the data type is integer, the value has diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationclassificationmetrics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationclassificationmetrics.go index c052c9e33..d888690e3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationclassificationmetrics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationclassificationmetrics.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,7 +26,7 @@ import ( // DataframeEvaluationClassificationMetrics type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeEvaluation.ts#L73-L78 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeEvaluation.ts#L73-L78 type DataframeEvaluationClassificationMetrics struct { // Accuracy Accuracy of predictions (per-class and overall). Accuracy map[string]json.RawMessage `json:"accuracy,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationclassificationmetricsaucroc.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationclassificationmetricsaucroc.go index 2b5a1b4db..d8221d22c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationclassificationmetricsaucroc.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationclassificationmetricsaucroc.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataframeEvaluationClassificationMetricsAucRoc type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeEvaluation.ts#L85-L90 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeEvaluation.ts#L85-L90 type DataframeEvaluationClassificationMetricsAucRoc struct { // ClassName Name of the only class that is treated as positive during AUC ROC // calculation. Other classes are treated as negative ("one-vs-all" strategy). diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationcontainer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationcontainer.go index bc6f007e2..b85ed32b6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationcontainer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationcontainer.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // DataframeEvaluationContainer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeEvaluation.ts#L25-L33 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeEvaluation.ts#L25-L33 type DataframeEvaluationContainer struct { // Classification Classification evaluation evaluates the results of a classification analysis // which outputs a prediction that identifies to which of the classes each diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationmetrics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationmetrics.go index f0d0701e2..971f4da4d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationmetrics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationmetrics.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,7 +26,7 @@ import ( // DataframeEvaluationMetrics type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeEvaluation.ts#L64-L71 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeEvaluation.ts#L64-L71 type DataframeEvaluationMetrics struct { // AucRoc The AUC ROC (area under the curve of the receiver operating characteristic) // score and optionally the curve. It is calculated for a specific class diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationoutlierdetection.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationoutlierdetection.go index 314366957..e00eb72ef 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationoutlierdetection.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationoutlierdetection.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // DataframeEvaluationOutlierDetection type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeEvaluation.ts#L46-L53 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeEvaluation.ts#L46-L53 type DataframeEvaluationOutlierDetection struct { // ActualField The field of the index which contains the ground truth. The data type of this // field can be boolean or integer. If the data type is integer, the value has diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationoutlierdetectionmetrics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationoutlierdetectionmetrics.go index 9fe38811d..8e9367a47 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationoutlierdetectionmetrics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationoutlierdetectionmetrics.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,7 +26,7 @@ import ( // DataframeEvaluationOutlierDetectionMetrics type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeEvaluation.ts#L80-L83 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeEvaluation.ts#L80-L83 type DataframeEvaluationOutlierDetectionMetrics struct { // AucRoc The AUC ROC (area under the curve of the receiver operating characteristic) // score and optionally the curve. It is calculated for a specific class diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationregression.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationregression.go index 0553f09a9..02362807c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationregression.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationregression.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // DataframeEvaluationRegression type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeEvaluation.ts#L55-L62 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeEvaluation.ts#L55-L62 type DataframeEvaluationRegression struct { // ActualField The field of the index which contains the ground truth. The data type of this // field must be numerical. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationregressionmetrics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationregressionmetrics.go index a252c5ff6..0bc1eb69c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationregressionmetrics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationregressionmetrics.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,7 +26,7 @@ import ( // DataframeEvaluationRegressionMetrics type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeEvaluation.ts#L92-L110 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeEvaluation.ts#L92-L110 type DataframeEvaluationRegressionMetrics struct { // Huber Pseudo Huber loss function. Huber *DataframeEvaluationRegressionMetricsHuber `json:"huber,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationregressionmetricshuber.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationregressionmetricshuber.go index 78c4a3d66..d34cc72ba 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationregressionmetricshuber.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationregressionmetricshuber.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataframeEvaluationRegressionMetricsHuber type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeEvaluation.ts#L117-L120 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeEvaluation.ts#L117-L120 type DataframeEvaluationRegressionMetricsHuber struct { // Delta Approximates 1/2 (prediction - actual)2 for values much less than delta and // approximates a straight line with slope delta for values much larger than diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationregressionmetricsmsle.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationregressionmetricsmsle.go index e51a1b8b9..25477c04d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationregressionmetricsmsle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationregressionmetricsmsle.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataframeEvaluationRegressionMetricsMsle type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeEvaluation.ts#L112-L115 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeEvaluation.ts#L112-L115 type DataframeEvaluationRegressionMetricsMsle struct { // Offset Defines the transition point at which you switch from minimizing quadratic // error to minimizing quadratic log error. Defaults to 1. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationsummaryaucroc.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationsummaryaucroc.go index f07cbec44..b27e48b91 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationsummaryaucroc.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationsummaryaucroc.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataframeEvaluationSummaryAucRoc type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/evaluate_data_frame/types.ts#L91-L93 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/evaluate_data_frame/types.ts#L91-L93 type DataframeEvaluationSummaryAucRoc struct { Curve []DataframeEvaluationSummaryAucRocCurveItem `json:"curve,omitempty"` Value Float64 `json:"value"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationsummaryaucroccurveitem.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationsummaryaucroccurveitem.go index 5d3e70bce..f633600e7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationsummaryaucroccurveitem.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationsummaryaucroccurveitem.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataframeEvaluationSummaryAucRocCurveItem type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/evaluate_data_frame/types.ts#L95-L99 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/evaluate_data_frame/types.ts#L95-L99 type DataframeEvaluationSummaryAucRocCurveItem struct { Fpr Float64 `json:"fpr"` Threshold Float64 `json:"threshold"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationvalue.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationvalue.go index 64d6613cb..2be8bfd1c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationvalue.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeevaluationvalue.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataframeEvaluationValue type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/evaluate_data_frame/types.ts#L87-L89 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/evaluate_data_frame/types.ts#L87-L89 type DataframeEvaluationValue struct { Value Float64 `json:"value"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeoutlierdetectionsummary.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeoutlierdetectionsummary.go index 99d0da6f0..cbfc70489 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeoutlierdetectionsummary.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeoutlierdetectionsummary.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // DataframeOutlierDetectionSummary type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/evaluate_data_frame/types.ts#L24-L42 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/evaluate_data_frame/types.ts#L24-L42 type DataframeOutlierDetectionSummary struct { // AucRoc The AUC ROC (area under the curve of the receiver operating characteristic) // score and optionally the curve. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframepreviewconfig.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframepreviewconfig.go index 3f27c3cec..c04319cd9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframepreviewconfig.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframepreviewconfig.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataframePreviewConfig type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/preview_data_frame_analytics/types.ts#L27-L33 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/preview_data_frame_analytics/types.ts#L27-L33 type DataframePreviewConfig struct { Analysis DataframeAnalysisContainer `json:"analysis"` AnalyzedFields *DataframeAnalysisAnalyzedFields `json:"analyzed_fields,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeregressionsummary.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeregressionsummary.go index 95c1f9fa2..907faabf1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeregressionsummary.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dataframeregressionsummary.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // DataframeRegressionSummary type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/evaluate_data_frame/types.ts#L68-L85 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/evaluate_data_frame/types.ts#L68-L85 type DataframeRegressionSummary struct { // Huber Pseudo Huber loss function. Huber *DataframeEvaluationValue `json:"huber,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datapathstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datapathstats.go index aeeb32952..42bfc5e9f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datapathstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datapathstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataPathStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L550-L594 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L550-L594 type DataPathStats struct { // Available Total amount of disk space available to this Java virtual machine on this // file store. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastream.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastream.go index 8bac60eab..87dcf5feb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastream.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastream.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // DataStream type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/DataStream.ts#L32-L96 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/DataStream.ts#L33-L105 type DataStream struct { // AllowCustomRouting If `true`, the data stream allows custom routing on write request. AllowCustomRouting *bool `json:"allow_custom_routing,omitempty"` @@ -64,6 +64,12 @@ type DataStream struct { Meta_ Metadata `json:"_meta,omitempty"` // Name Name of the data stream. Name string `json:"name"` + // NextGenerationManagedBy Name of the lifecycle system that'll manage the next generation of the data + // stream. + NextGenerationManagedBy ManagedBy `json:"next_generation_managed_by"` + // PreferIlm Indicates if ILM should take precedence over DSL in case both are configured + // to managed this data stream. + PreferIlm bool `json:"prefer_ilm"` // Replicated If `true`, the data stream is created and managed by cross-cluster // replication and the local cluster can not write into this data stream or // change its mappings. @@ -166,6 +172,25 @@ func (s *DataStream) UnmarshalJSON(data []byte) error { return err } + case "next_generation_managed_by": + if err := dec.Decode(&s.NextGenerationManagedBy); err != nil { + return err + } + + case "prefer_ilm": + var tmp interface{} + dec.Decode(&tmp) + switch v := tmp.(type) { + case string: + value, err := strconv.ParseBool(v) + if err != nil { + return err + } + s.PreferIlm = value + case bool: + s.PreferIlm = v + } + case "replicated": var tmp interface{} dec.Decode(&tmp) diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamindex.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamindex.go index 68fb81147..e9de5f7df 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamindex.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamindex.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,16 +25,24 @@ import ( "encoding/json" "errors" "io" + "strconv" ) // DataStreamIndex type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/DataStream.ts#L105-L114 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/DataStream.ts#L114-L135 type DataStreamIndex struct { + // IlmPolicy Name of the current ILM lifecycle policy configured for this backing index. + IlmPolicy *string `json:"ilm_policy,omitempty"` // IndexName Name of the backing index. IndexName string `json:"index_name"` // IndexUuid Universally unique identifier (UUID) for the index. IndexUuid string `json:"index_uuid"` + // ManagedBy Name of the lifecycle system that's currently managing this backing index. + ManagedBy ManagedBy `json:"managed_by"` + // PreferIlm Indicates if ILM should take precedence over DSL in case both are configured + // to manage this index. + PreferIlm bool `json:"prefer_ilm"` } func (s *DataStreamIndex) UnmarshalJSON(data []byte) error { @@ -52,6 +60,11 @@ func (s *DataStreamIndex) UnmarshalJSON(data []byte) error { switch t { + case "ilm_policy": + if err := dec.Decode(&s.IlmPolicy); err != nil { + return err + } + case "index_name": if err := dec.Decode(&s.IndexName); err != nil { return err @@ -62,6 +75,25 @@ func (s *DataStreamIndex) UnmarshalJSON(data []byte) error { return err } + case "managed_by": + if err := dec.Decode(&s.ManagedBy); err != nil { + return err + } + + case "prefer_ilm": + var tmp interface{} + dec.Decode(&tmp) + switch v := tmp.(type) { + case string: + value, err := strconv.ParseBool(v) + if err != nil { + return err + } + s.PreferIlm = value + case bool: + s.PreferIlm = v + } + } } return nil diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamlifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamlifecycle.go index 085afea1b..e605b77c9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamlifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamlifecycle.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // DataStreamLifecycle type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/DataStreamLifecycle.ts#L25-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/DataStreamLifecycle.ts#L25-L31 type DataStreamLifecycle struct { DataRetention Duration `json:"data_retention,omitempty"` Downsampling *DataStreamLifecycleDownsampling `json:"downsampling,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamlifecycledownsampling.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamlifecycledownsampling.go index 4b40e8108..6077098f3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamlifecycledownsampling.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamlifecycledownsampling.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // DataStreamLifecycleDownsampling type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/DataStreamLifecycleDownsampling.ts#L22-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/DataStreamLifecycleDownsampling.ts#L22-L27 type DataStreamLifecycleDownsampling struct { // Rounds The list of downsampling rounds to execute as part of this downsampling // configuration diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamlifecycleexplain.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamlifecycleexplain.go index 5fa08b755..e72b76cd8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamlifecycleexplain.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamlifecycleexplain.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataStreamLifecycleExplain type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/explain_data_lifecycle/IndicesExplainDataLifecycleResponse.ts#L31-L41 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/explain_data_lifecycle/IndicesExplainDataLifecycleResponse.ts#L31-L41 type DataStreamLifecycleExplain struct { Error *string `json:"error,omitempty"` GenerationTime Duration `json:"generation_time,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamlifecyclerolloverconditions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamlifecyclerolloverconditions.go index 160933653..2d35ecb96 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamlifecyclerolloverconditions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamlifecyclerolloverconditions.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataStreamLifecycleRolloverConditions type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/DataStreamLifecycle.ts#L57-L69 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/DataStreamLifecycle.ts#L57-L69 type DataStreamLifecycleRolloverConditions struct { MaxAge *string `json:"max_age,omitempty"` MaxDocs *int64 `json:"max_docs,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamlifecyclewithrollover.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamlifecyclewithrollover.go index f7ee8ef03..e4721bd34 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamlifecyclewithrollover.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamlifecyclewithrollover.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // DataStreamLifecycleWithRollover type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/DataStreamLifecycle.ts#L33-L55 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/DataStreamLifecycle.ts#L33-L55 type DataStreamLifecycleWithRollover struct { // DataRetention If defined, every document added to this data stream will be stored at least // for this time frame. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamnames.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamnames.go index 80300d2c2..bfac15dd1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamnames.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamnames.go @@ -16,11 +16,11 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // DataStreamNames type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L88-L88 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L99-L99 type DataStreamNames []string diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreams.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreams.go index 5d9176766..cba99d8b9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreams.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreams.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataStreams type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L81-L84 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L81-L84 type DataStreams struct { Available bool `json:"available"` DataStreams int64 `json:"data_streams"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamsstatsitem.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamsstatsitem.go index 9ddd214dc..a4b55ad32 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamsstatsitem.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamsstatsitem.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataStreamsStatsItem type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/data_streams_stats/IndicesDataStreamsStatsResponse.ts#L45-L65 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/data_streams_stats/IndicesDataStreamsStatsResponse.ts#L45-L65 type DataStreamsStatsItem struct { // BackingIndices Current number of backing indices for the data stream. BackingIndices int `json:"backing_indices"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamtimestamp.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamtimestamp.go index 4fb2920ef..7f47aefb1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamtimestamp.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamtimestamp.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataStreamTimestamp type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/TypeMapping.ts#L58-L60 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/TypeMapping.ts#L58-L60 type DataStreamTimestamp struct { Enabled bool `json:"enabled"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamtimestampfield.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamtimestampfield.go index 8006f6cbf..ffe40ff83 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamtimestampfield.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamtimestampfield.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // DataStreamTimestampField type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/DataStream.ts#L98-L103 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/DataStream.ts#L107-L112 type DataStreamTimestampField struct { // Name Name of the timestamp field for the data stream, which must be `@timestamp`. // The `@timestamp` field must be included in every document indexed to the data diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamvisibility.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamvisibility.go index 201bb63a4..f291ccd32 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamvisibility.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamvisibility.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataStreamVisibility type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/DataStream.ts#L116-L118 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/DataStream.ts#L137-L139 type DataStreamVisibility struct { Hidden *bool `json:"hidden,omitempty"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamwithlifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamwithlifecycle.go index 6a0fcc194..a91acbc21 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamwithlifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datastreamwithlifecycle.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // DataStreamWithLifecycle type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/get_data_lifecycle/IndicesGetDataLifecycleResponse.ts#L27-L30 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/get_data_lifecycle/IndicesGetDataLifecycleResponse.ts#L27-L30 type DataStreamWithLifecycle struct { Lifecycle *DataStreamLifecycle `json:"lifecycle,omitempty"` Name string `json:"name"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datatierphasestatistics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datatierphasestatistics.go index 0ddadb123..48d9bd378 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datatierphasestatistics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datatierphasestatistics.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataTierPhaseStatistics type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L86-L97 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L86-L97 type DataTierPhaseStatistics struct { DocCount int64 `json:"doc_count"` IndexCount int64 `json:"index_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datatiers.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datatiers.go index 758752de5..9df8dd423 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datatiers.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datatiers.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DataTiers type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L339-L349 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L339-L349 type DataTiers struct { Available bool `json:"available"` DataCold DataTierPhaseStatistics `json:"data_cold"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datedecayfunction.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datedecayfunction.go index f38f2deeb..fe508fd2c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datedecayfunction.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datedecayfunction.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // DateDecayFunction type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/compound.ts#L186-L188 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/compound.ts#L186-L188 type DateDecayFunction struct { DateDecayFunction map[string]DecayPlacementDateMathDuration `json:"DateDecayFunction,omitempty"` // MultiValueMode Determines how the distance is calculated when a field used for computing the diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datedistancefeaturequery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datedistancefeaturequery.go index c47103ddf..c9058dfff 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datedistancefeaturequery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datedistancefeaturequery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DateDistanceFeatureQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/specialized.ts#L67-L70 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/specialized.ts#L67-L70 type DateDistanceFeatureQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datehistogramaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datehistogramaggregate.go index 442eb7e7a..d2b70827e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datehistogramaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datehistogramaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // DateHistogramAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L348-L349 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L348-L349 type DateHistogramAggregate struct { Buckets BucketsDateHistogramBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datehistogramaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datehistogramaggregation.go index 935ceba38..9713ed4ff 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datehistogramaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datehistogramaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -33,7 +33,7 @@ import ( // DateHistogramAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L189-L247 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L189-L247 type DateHistogramAggregation struct { // CalendarInterval Calendar-aware interval. // Can be specified using the unit name, such as `month`, or as a single unit @@ -221,9 +221,40 @@ func (s *DateHistogramAggregation) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } case "time_zone": if err := dec.Decode(&s.TimeZone); err != nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datehistogrambucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datehistogrambucket.go index ca9ba9142..57131afa3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datehistogrambucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datehistogrambucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // DateHistogramBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L351-L354 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L351-L354 type DateHistogramBucket struct { Aggregations map[string]Aggregate `json:"-"` DocCount int64 `json:"doc_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datehistogramgrouping.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datehistogramgrouping.go index 279ddf3a4..dd71209a6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datehistogramgrouping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datehistogramgrouping.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DateHistogramGrouping type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/rollup/_types/Groupings.ts#L42-L73 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/rollup/_types/Groupings.ts#L42-L73 type DateHistogramGrouping struct { // CalendarInterval The interval of time buckets to be generated when rolling up. CalendarInterval Duration `json:"calendar_interval,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dateindexnameprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dateindexnameprocessor.go index 1d248093c..5549c1bc6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dateindexnameprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dateindexnameprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DateIndexNameProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L491-L529 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L491-L529 type DateIndexNameProcessor struct { // DateFormats An array of the expected date formats for parsing dates / timestamps in the // document being preprocessed. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datenanosproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datenanosproperty.go index 7c2e80bf2..c1283f78e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datenanosproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datenanosproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // DateNanosProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/core.ts#L73-L81 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/core.ts#L73-L81 type DateNanosProperty struct { Boost *Float64 `json:"boost,omitempty"` CopyTo []string `json:"copy_to,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dateprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dateprocessor.go index 70c12785f..2cb276461 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dateprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dateprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DateProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L531-L558 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L531-L558 type DateProcessor struct { // Description Description of the processor. // Useful for describing the purpose of the processor or its configuration. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dateproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dateproperty.go index 22b849918..9fb37068c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dateproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dateproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // DateProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/core.ts#L61-L71 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/core.ts#L61-L71 type DateProperty struct { Boost *Float64 `json:"boost,omitempty"` CopyTo []string `json:"copy_to,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/daterangeaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/daterangeaggregate.go index 3a23984e0..4c07c1043 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/daterangeaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/daterangeaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // DateRangeAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L543-L548 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L543-L548 type DateRangeAggregate struct { Buckets BucketsRangeBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/daterangeaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/daterangeaggregation.go index b05b4267b..4ab722e5f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/daterangeaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/daterangeaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DateRangeAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L268-L294 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L268-L294 type DateRangeAggregation struct { // Field The date field whose values are use to build ranges. Field *string `json:"field,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/daterangeexpression.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/daterangeexpression.go index 67895faca..8b9ce44a4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/daterangeexpression.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/daterangeexpression.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DateRangeExpression type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L305-L318 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L305-L318 type DateRangeExpression struct { // From Start of the range (inclusive). From FieldDateMath `json:"from,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/daterangeproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/daterangeproperty.go index 59011010e..ebabf7ff4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/daterangeproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/daterangeproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // DateRangeProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/range.ts#L29-L32 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/range.ts#L29-L32 type DateRangeProperty struct { Boost *Float64 `json:"boost,omitempty"` Coerce *bool `json:"coerce,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/daterangequery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/daterangequery.go index 16a936625..2f77817c3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/daterangequery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/daterangequery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // DateRangeQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/term.ts#L116-L143 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/term.ts#L116-L143 type DateRangeQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datetime.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datetime.go index c397d8d67..4c7099f87 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datetime.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/datetime.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // string // int64 // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Time.ts#L22-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Time.ts#L22-L27 type DateTime interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/decayfunction.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/decayfunction.go index 85e66c642..3f1310c9c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/decayfunction.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/decayfunction.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,5 +26,5 @@ package types // NumericDecayFunction // GeoDecayFunction // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/compound.ts#L194-L199 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/compound.ts#L194-L199 type DecayFunction interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/decayplacementdatemathduration.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/decayplacementdatemathduration.go index 2ec9a8a40..11956f5d0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/decayplacementdatemathduration.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/decayplacementdatemathduration.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DecayPlacementDateMathDuration type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/compound.ts#L153-L172 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/compound.ts#L153-L172 type DecayPlacementDateMathDuration struct { // Decay Defines how documents are scored at the distance given at scale. Decay *Float64 `json:"decay,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/decayplacementdoubledouble.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/decayplacementdoubledouble.go index 714240227..308fe098b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/decayplacementdoubledouble.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/decayplacementdoubledouble.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DecayPlacementdoubledouble type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/compound.ts#L153-L172 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/compound.ts#L153-L172 type DecayPlacementdoubledouble struct { // Decay Defines how documents are scored at the distance given at scale. Decay *Float64 `json:"decay,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/decayplacementgeolocationdistance.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/decayplacementgeolocationdistance.go index fe83d8c80..ec64a2169 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/decayplacementgeolocationdistance.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/decayplacementgeolocationdistance.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DecayPlacementGeoLocationDistance type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/compound.ts#L153-L172 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/compound.ts#L153-L172 type DecayPlacementGeoLocationDistance struct { // Decay Defines how documents are scored at the distance given at scale. Decay *Float64 `json:"decay,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/defaults.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/defaults.go index 53d4d5248..62ad71a9d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/defaults.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/defaults.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // Defaults type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/info/types.ts#L24-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/info/types.ts#L24-L27 type Defaults struct { AnomalyDetectors AnomalyDetectors `json:"anomaly_detectors"` Datafeeds Datafeeds `json:"datafeeds"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/definition.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/definition.go index 87ba0cd64..6287bf01a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/definition.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/definition.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // Definition type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/put_trained_model/types.ts#L24-L29 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/put_trained_model/types.ts#L24-L29 type Definition struct { // Preprocessors Collection of preprocessors Preprocessors []Preprocessor `json:"preprocessors,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/delayeddatacheckconfig.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/delayeddatacheckconfig.go index 678143595..e0191a9d2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/delayeddatacheckconfig.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/delayeddatacheckconfig.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DelayedDataCheckConfig type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Datafeed.ts#L119-L130 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Datafeed.ts#L119-L130 type DelayedDataCheckConfig struct { // CheckWindow The window of time that is searched for late data. This window of time ends // with the latest finalized bucket. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/deleteoperation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/deleteoperation.go index 1edee3927..bfe1f8e44 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/deleteoperation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/deleteoperation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // DeleteOperation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/bulk/types.ts#L134-L134 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/bulk/types.ts#L134-L134 type DeleteOperation struct { // Id_ The document ID. Id_ *string `json:"_id,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/delimitedpayloadtokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/delimitedpayloadtokenfilter.go index beadb7f5d..2f072cfc0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/delimitedpayloadtokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/delimitedpayloadtokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // DelimitedPayloadTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L68-L72 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L68-L72 type DelimitedPayloadTokenFilter struct { Delimiter *string `json:"delimiter,omitempty"` Encoding *delimitedpayloadencoding.DelimitedPayloadEncoding `json:"encoding,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/densevectorindexoptions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/densevectorindexoptions.go index 2f7c3c28c..70b4bc4aa 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/densevectorindexoptions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/densevectorindexoptions.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DenseVectorIndexOptions type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/DenseVectorIndexOptions.ts#L22-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/DenseVectorIndexOptions.ts#L22-L26 type DenseVectorIndexOptions struct { EfConstruction int `json:"ef_construction"` M int `json:"m"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/densevectorproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/densevectorproperty.go index 5adf818c5..75363d244 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/densevectorproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/densevectorproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // DenseVectorProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/complex.ts#L51-L57 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/complex.ts#L51-L57 type DenseVectorProperty struct { Dims int `json:"dims"` Dynamic *dynamicmapping.DynamicMapping `json:"dynamic,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/deprecation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/deprecation.go index 1f2b1cf50..163038ccb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/deprecation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/deprecation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // Deprecation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/migration/deprecations/types.ts#L29-L35 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/migration/deprecations/types.ts#L29-L35 type Deprecation struct { Details string `json:"details"` // Level The level property describes the significance of the issue. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/deprecationindexing.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/deprecationindexing.go index 4b6a22236..170c1bde3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/deprecationindexing.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/deprecationindexing.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DeprecationIndexing type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L143-L145 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L143-L145 type DeprecationIndexing struct { Enabled string `json:"enabled"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/derivativeaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/derivativeaggregate.go index 7d7e41ba3..413262d96 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/derivativeaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/derivativeaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DerivativeAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L227-L231 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L227-L231 type DerivativeAggregate struct { Meta Metadata `json:"meta,omitempty"` NormalizedValue *Float64 `json:"normalized_value,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/derivativeaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/derivativeaggregation.go index dc1541b53..6d7e94eaa 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/derivativeaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/derivativeaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // DerivativeAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L196-L196 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L196-L196 type DerivativeAggregation struct { // BucketsPath Path to the buckets that contain one set of values to correlate. BucketsPath BucketsPath `json:"buckets_path,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/detectionrule.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/detectionrule.go index f6c2d4a12..66eb333cd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/detectionrule.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/detectionrule.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,7 +26,7 @@ import ( // DetectionRule type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Rule.ts#L25-L39 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Rule.ts#L25-L39 type DetectionRule struct { // Actions The set of actions to be triggered when the rule applies. If more than one // action is specified the effects of all actions are combined. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/detector.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/detector.go index e6b10b4f5..4a519b8cd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/detector.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/detector.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // Detector type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Detector.ts#L25-L67 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Detector.ts#L25-L67 type Detector struct { // ByFieldName The field used to split the data. In particular, this property is used for // analyzing the splits with respect to their own history. It is used for diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/detectorread.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/detectorread.go index d87a3d73b..c62b9c46f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/detectorread.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/detectorread.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // DetectorRead type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Detector.ts#L69-L125 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Detector.ts#L69-L125 type DetectorRead struct { // ByFieldName The field used to split the data. // In particular, this property is used for analyzing the splits with respect to diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/diagnosis.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/diagnosis.go index 0c84995e0..66d71ad10 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/diagnosis.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/diagnosis.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Diagnosis type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/health_report/types.ts#L49-L55 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/health_report/types.ts#L49-L55 type Diagnosis struct { Action string `json:"action"` AffectedResources DiagnosisAffectedResources `json:"affected_resources"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/diagnosisaffectedresources.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/diagnosisaffectedresources.go index 90808b9ec..286757752 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/diagnosisaffectedresources.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/diagnosisaffectedresources.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // DiagnosisAffectedResources type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/health_report/types.ts#L57-L63 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/health_report/types.ts#L57-L63 type DiagnosisAffectedResources struct { FeatureStates []string `json:"feature_states,omitempty"` Indices []string `json:"indices,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dictionarydecompoundertokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dictionarydecompoundertokenfilter.go index dce47235d..a23881efa 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dictionarydecompoundertokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dictionarydecompoundertokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DictionaryDecompounderTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L54-L56 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L54-L56 type DictionaryDecompounderTokenFilter struct { HyphenationPatternsPath *string `json:"hyphenation_patterns_path,omitempty"` MaxSubwordSize *int `json:"max_subword_size,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/directgenerator.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/directgenerator.go index f463f2000..f0d89785f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/directgenerator.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/directgenerator.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // DirectGenerator type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/suggester.ts#L265-L328 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/suggester.ts#L265-L328 type DirectGenerator struct { // Field The field to fetch the candidate suggestions from. // Needs to be set globally or per suggestion. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/discovery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/discovery.go index 50df0cb6d..1b05fb46d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/discovery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/discovery.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // Discovery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L201-L219 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L201-L219 type Discovery struct { ClusterApplierStats *ClusterAppliedStats `json:"cluster_applier_stats,omitempty"` // ClusterStateQueue Contains statistics for the cluster state queue of the node. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/discoverynode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/discoverynode.go index 98cf2570c..eeced26c9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/discoverynode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/discoverynode.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // DiscoveryNode type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DiscoveryNode.ts#L24-L30 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DiscoveryNode.ts#L24-L30 type DiscoveryNode struct { Attributes map[string]string `json:"attributes"` EphemeralId string `json:"ephemeral_id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/diskindicator.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/diskindicator.go index e29627e00..9dcdcf6f9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/diskindicator.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/diskindicator.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // DiskIndicator type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/health_report/types.ts#L121-L125 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/health_report/types.ts#L121-L125 type DiskIndicator struct { Details *DiskIndicatorDetails `json:"details,omitempty"` Diagnosis []Diagnosis `json:"diagnosis,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/diskindicatordetails.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/diskindicatordetails.go index bfbc8de75..dd7788ab2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/diskindicatordetails.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/diskindicatordetails.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DiskIndicatorDetails type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/health_report/types.ts#L126-L132 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/health_report/types.ts#L126-L132 type DiskIndicatorDetails struct { IndicesWithReadonlyBlock int64 `json:"indices_with_readonly_block"` NodesOverFloodStageWatermark int64 `json:"nodes_over_flood_stage_watermark"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/diskusage.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/diskusage.go index 90e3ce086..e98de718a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/diskusage.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/diskusage.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DiskUsage type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/allocation_explain/types.ts#L62-L69 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/allocation_explain/types.ts#L62-L69 type DiskUsage struct { FreeBytes int64 `json:"free_bytes"` FreeDiskPercent Float64 `json:"free_disk_percent"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dismaxquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dismaxquery.go index 18e66d3f4..3a11c7950 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dismaxquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dismaxquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DisMaxQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/compound.ts#L78-L90 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/compound.ts#L78-L90 type DisMaxQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dissectprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dissectprocessor.go index aba32bf7e..da9da235c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dissectprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dissectprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DissectProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L560-L579 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L560-L579 type DissectProcessor struct { // AppendSeparator The character(s) that separate the appended fields. AppendSeparator *string `json:"append_separator,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/distancefeaturequery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/distancefeaturequery.go index 572b8e566..0b28ca1e1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/distancefeaturequery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/distancefeaturequery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // GeoDistanceFeatureQuery // DateDistanceFeatureQuery // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/specialized.ts#L72-L76 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/specialized.ts#L72-L76 type DistanceFeatureQuery interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/distancefeaturequerybasedatemathduration.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/distancefeaturequerybasedatemathduration.go index e38b906e4..5c946e5fb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/distancefeaturequerybasedatemathduration.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/distancefeaturequerybasedatemathduration.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DistanceFeatureQueryBaseDateMathDuration type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/specialized.ts#L40-L60 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/specialized.ts#L40-L60 type DistanceFeatureQueryBaseDateMathDuration struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/distancefeaturequerybasegeolocationdistance.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/distancefeaturequerybasegeolocationdistance.go index dffc48c5c..56603a2a0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/distancefeaturequerybasegeolocationdistance.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/distancefeaturequerybasegeolocationdistance.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DistanceFeatureQueryBaseGeoLocationDistance type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/specialized.ts#L40-L60 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/specialized.ts#L40-L60 type DistanceFeatureQueryBaseGeoLocationDistance struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/diversifiedsampleraggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/diversifiedsampleraggregation.go index 7e403e8fb..bdb38f549 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/diversifiedsampleraggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/diversifiedsampleraggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // DiversifiedSamplerAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L320-L341 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L320-L341 type DiversifiedSamplerAggregation struct { // ExecutionHint The type of value used for de-duplication. ExecutionHint *sampleraggregationexecutionhint.SamplerAggregationExecutionHint `json:"execution_hint,omitempty"` @@ -107,9 +107,40 @@ func (s *DiversifiedSamplerAggregation) UnmarshalJSON(data []byte) error { s.Name = &o case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } case "shard_size": diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/docstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/docstats.go index b09b606db..42d9f256d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/docstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/docstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DocStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Stats.ts#L97-L109 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Stats.ts#L97-L109 type DocStats struct { // Count Total number of non-deleted documents across all primary shards assigned to // selected nodes. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/document.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/document.go index ff8120e88..3c8ee0bdf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/document.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/document.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // Document type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/simulate/types.ts#L41-L55 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/simulate/types.ts#L41-L55 type Document struct { // Id_ Unique identifier for the document. // This ID must be unique within the `_index`. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/documentrating.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/documentrating.go index a27a20e98..6cf0d2828 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/documentrating.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/documentrating.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DocumentRating type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/rank_eval/types.ts#L116-L123 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/rank_eval/types.ts#L116-L123 type DocumentRating struct { // Id_ The document ID. Id_ string `json:"_id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/documentsimulation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/documentsimulation.go index c1978970c..1107e8ae0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/documentsimulation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/documentsimulation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -33,7 +33,7 @@ import ( // DocumentSimulation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/simulate/types.ts#L57-L85 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/simulate/types.ts#L57-L85 type DocumentSimulation struct { DocumentSimulation map[string]string `json:"-"` // Id_ Unique identifier for the document. This ID must be unique within the diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dotexpanderprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dotexpanderprocessor.go index 4ab5dd669..c8a641c4c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dotexpanderprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dotexpanderprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DotExpanderProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L581-L592 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L581-L592 type DotExpanderProcessor struct { // Description Description of the processor. // Useful for describing the purpose of the processor or its configuration. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/doublenumberproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/doublenumberproperty.go index 3d8fbbe90..1e656c1b2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/doublenumberproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/doublenumberproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -34,7 +34,7 @@ import ( // DoubleNumberProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/core.ts#L144-L147 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/core.ts#L144-L147 type DoubleNumberProperty struct { Boost *Float64 `json:"boost,omitempty"` Coerce *bool `json:"coerce,omitempty"` @@ -830,9 +830,40 @@ func (s *DoubleNumberProperty) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } case "similarity": var tmp json.RawMessage diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/doublerangeproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/doublerangeproperty.go index 35e3136d7..5de9392df 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/doublerangeproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/doublerangeproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // DoubleRangeProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/range.ts#L34-L36 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/range.ts#L34-L36 type DoubleRangeProperty struct { Boost *Float64 `json:"boost,omitempty"` Coerce *bool `json:"coerce,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/doubletermsaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/doubletermsaggregate.go index a82a9f088..7a380270c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/doubletermsaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/doubletermsaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DoubleTermsAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L411-L416 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L411-L416 type DoubleTermsAggregate struct { Buckets BucketsDoubleTermsBucket `json:"buckets"` DocCountErrorUpperBound *int64 `json:"doc_count_error_upper_bound,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/doubletermsbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/doubletermsbucket.go index 84d4d4a54..d6139e50e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/doubletermsbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/doubletermsbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // DoubleTermsBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L418-L421 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L418-L421 type DoubleTermsBucket struct { Aggregations map[string]Aggregate `json:"-"` DocCount int64 `json:"doc_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/downsampleconfig.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/downsampleconfig.go index 5d5fa1953..86083bc04 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/downsampleconfig.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/downsampleconfig.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // DownsampleConfig type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/Downsample.ts#L22-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/Downsample.ts#L22-L27 type DownsampleConfig struct { // FixedInterval The interval at which to aggregate the original time series index. FixedInterval string `json:"fixed_interval"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/downsamplinground.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/downsamplinground.go index 0942758fb..aca4f7f98 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/downsamplinground.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/downsamplinground.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // DownsamplingRound type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/DownsamplingRound.ts#L23-L32 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/DownsamplingRound.ts#L23-L32 type DownsamplingRound struct { // After The duration since rollover when this downsampling round should execute After Duration `json:"after"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dropprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dropprocessor.go index 53d0b4992..81af53eb1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dropprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dropprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // DropProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L594-L594 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L594-L594 type DropProcessor struct { // Description Description of the processor. // Useful for describing the purpose of the processor or its configuration. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/duration.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/duration.go index d6b6acab9..1ae9544ea 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/duration.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/duration.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -24,5 +24,5 @@ package types // // string // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Time.ts#L52-L58 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Time.ts#L52-L58 type Duration interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/durationvalueunitfloatmillis.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/durationvalueunitfloatmillis.go index c4cbe3059..4b6b639f3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/durationvalueunitfloatmillis.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/durationvalueunitfloatmillis.go @@ -16,11 +16,11 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // DurationValueUnitFloatMillis type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Time.ts#L67-L67 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Time.ts#L67-L67 type DurationValueUnitFloatMillis Float64 diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/durationvalueunitmillis.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/durationvalueunitmillis.go index 4dada0ba9..7b3ef8b9d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/durationvalueunitmillis.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/durationvalueunitmillis.go @@ -16,11 +16,11 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // DurationValueUnitMillis type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Time.ts#L67-L67 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Time.ts#L67-L67 type DurationValueUnitMillis int64 diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/durationvalueunitnanos.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/durationvalueunitnanos.go index 94941d4be..0999beee9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/durationvalueunitnanos.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/durationvalueunitnanos.go @@ -16,11 +16,11 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // DurationValueUnitNanos type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Time.ts#L67-L67 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Time.ts#L67-L67 type DurationValueUnitNanos int64 diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/durationvalueunitseconds.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/durationvalueunitseconds.go index 94d20fff6..2b4203528 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/durationvalueunitseconds.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/durationvalueunitseconds.go @@ -16,11 +16,11 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // DurationValueUnitSeconds type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Time.ts#L67-L67 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Time.ts#L67-L67 type DurationValueUnitSeconds int64 diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dutchanalyzer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dutchanalyzer.go index a65926ba1..6d0fbfeab 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dutchanalyzer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dutchanalyzer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // DutchAnalyzer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/analyzers.ts#L61-L64 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/analyzers.ts#L61-L64 type DutchAnalyzer struct { Stopwords []string `json:"stopwords,omitempty"` Type string `json:"type,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dynamicproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dynamicproperty.go index 3345be0af..2506ccbb0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dynamicproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dynamicproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -36,7 +36,7 @@ import ( // DynamicProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/core.ts#L285-L316 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/core.ts#L285-L316 type DynamicProperty struct { Analyzer *string `json:"analyzer,omitempty"` Boost *Float64 `json:"boost,omitempty"` @@ -964,9 +964,40 @@ func (s *DynamicProperty) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } case "search_analyzer": var tmp json.RawMessage diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dynamictemplate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dynamictemplate.go index 52d68a4a5..2c059f4fd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dynamictemplate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/dynamictemplate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // DynamicTemplate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/dynamic-template.ts#L22-L30 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/dynamic-template.ts#L22-L30 type DynamicTemplate struct { Mapping Property `json:"mapping,omitempty"` Match *string `json:"match,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/edgengramtokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/edgengramtokenfilter.go index bd952689b..170902bca 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/edgengramtokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/edgengramtokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // EdgeNGramTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L79-L85 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L79-L85 type EdgeNGramTokenFilter struct { MaxGram *int `json:"max_gram,omitempty"` MinGram *int `json:"min_gram,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/edgengramtokenizer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/edgengramtokenizer.go index 2e78de878..59bca1dab 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/edgengramtokenizer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/edgengramtokenizer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // EdgeNGramTokenizer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/tokenizers.ts#L31-L37 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/tokenizers.ts#L31-L37 type EdgeNGramTokenizer struct { CustomTokenChars *string `json:"custom_token_chars,omitempty"` MaxGram int `json:"max_gram"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/elasticsearchversioninfo.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/elasticsearchversioninfo.go index eb3c7776d..81318efb1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/elasticsearchversioninfo.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/elasticsearchversioninfo.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ElasticsearchVersionInfo type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Base.ts#L54-L64 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Base.ts#L54-L64 type ElasticsearchVersionInfo struct { BuildDate DateTime `json:"build_date"` BuildFlavor string `json:"build_flavor"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/elisiontokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/elisiontokenfilter.go index d8dbfbd86..fdedbac55 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/elisiontokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/elisiontokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ElisionTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L187-L192 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L187-L192 type ElisionTokenFilter struct { Articles []string `json:"articles,omitempty"` ArticlesCase Stringifiedboolean `json:"articles_case,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/email.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/email.go index 6bf8312fc..516f83e2c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/email.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/email.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // Email type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Actions.ts#L238-L250 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Actions.ts#L238-L250 type Email struct { Attachments map[string]EmailAttachmentContainer `json:"attachments,omitempty"` Bcc []string `json:"bcc,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/emailaction.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/emailaction.go index 40172ecfc..4cb711e22 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/emailaction.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/emailaction.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // EmailAction type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Actions.ts#L252-L252 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Actions.ts#L252-L252 type EmailAction struct { Attachments map[string]EmailAttachmentContainer `json:"attachments,omitempty"` Bcc []string `json:"bcc,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/emailattachmentcontainer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/emailattachmentcontainer.go index bfcb90f48..5ae7d84c8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/emailattachmentcontainer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/emailattachmentcontainer.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // EmailAttachmentContainer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Actions.ts#L211-L216 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Actions.ts#L211-L216 type EmailAttachmentContainer struct { Data *DataEmailAttachment `json:"data,omitempty"` Http *HttpEmailAttachment `json:"http,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/emailbody.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/emailbody.go index f8c1236f3..1304e3798 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/emailbody.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/emailbody.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // EmailBody type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Actions.ts#L192-L195 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Actions.ts#L192-L195 type EmailBody struct { Html *string `json:"html,omitempty"` Text *string `json:"text,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/emailresult.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/emailresult.go index 4c52f703b..4dd3c3a8e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/emailresult.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/emailresult.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // EmailResult type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Actions.ts#L205-L209 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Actions.ts#L205-L209 type EmailResult struct { Account *string `json:"account,omitempty"` Message Email `json:"message"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/emptyobject.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/emptyobject.go index 7b16c77b6..0097844f7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/emptyobject.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/emptyobject.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // EmptyObject type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L154-L155 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L165-L166 type EmptyObject struct { } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enrichpolicy.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enrichpolicy.go index 5c93b16d7..617074c94 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enrichpolicy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enrichpolicy.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // EnrichPolicy type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/enrich/_types/Policy.ts#L33-L40 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/enrich/_types/Policy.ts#L33-L40 type EnrichPolicy struct { ElasticsearchVersion *string `json:"elasticsearch_version,omitempty"` EnrichFields []string `json:"enrich_fields"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enrichprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enrichprocessor.go index 997c1e113..629d814b5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enrichprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enrichprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // EnrichProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L596-L635 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L596-L635 type EnrichProcessor struct { // Description Description of the processor. // Useful for describing the purpose of the processor or its configuration. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ensemble.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ensemble.go index c0aa027f9..8c0e3f0fb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ensemble.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ensemble.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Ensemble type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/put_trained_model/types.ts#L93-L99 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/put_trained_model/types.ts#L93-L99 type Ensemble struct { AggregateOutput *AggregateOutput `json:"aggregate_output,omitempty"` ClassificationLabels []string `json:"classification_labels,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/accesstokengranttype/accesstokengranttype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/accesstokengranttype/accesstokengranttype.go index 4e0b6e92d..dd5b29fd8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/accesstokengranttype/accesstokengranttype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/accesstokengranttype/accesstokengranttype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package accesstokengranttype package accesstokengranttype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/get_token/types.ts#L23-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/get_token/types.ts#L23-L28 type AccessTokenGrantType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/acknowledgementoptions/acknowledgementoptions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/acknowledgementoptions/acknowledgementoptions.go index febcd5a95..3cfbe092d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/acknowledgementoptions/acknowledgementoptions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/acknowledgementoptions/acknowledgementoptions.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package acknowledgementoptions package acknowledgementoptions import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Action.ts#L109-L113 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Action.ts#L109-L113 type AcknowledgementOptions struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/actionexecutionmode/actionexecutionmode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/actionexecutionmode/actionexecutionmode.go index 757d6be19..5f8b2f30b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/actionexecutionmode/actionexecutionmode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/actionexecutionmode/actionexecutionmode.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package actionexecutionmode package actionexecutionmode import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Action.ts#L73-L94 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Action.ts#L73-L94 type ActionExecutionMode struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/actionstatusoptions/actionstatusoptions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/actionstatusoptions/actionstatusoptions.go index a2fa51556..e332a3fb4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/actionstatusoptions/actionstatusoptions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/actionstatusoptions/actionstatusoptions.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package actionstatusoptions package actionstatusoptions import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Action.ts#L102-L107 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Action.ts#L102-L107 type ActionStatusOptions struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/actiontype/actiontype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/actiontype/actiontype.go index 00d6e57f4..3f6b55569 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/actiontype/actiontype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/actiontype/actiontype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package actiontype package actiontype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Action.ts#L64-L71 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Action.ts#L64-L71 type ActionType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/allocationexplaindecision/allocationexplaindecision.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/allocationexplaindecision/allocationexplaindecision.go index 6c52a41b1..e452c445e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/allocationexplaindecision/allocationexplaindecision.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/allocationexplaindecision/allocationexplaindecision.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package allocationexplaindecision package allocationexplaindecision import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/allocation_explain/types.ts#L32-L37 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/allocation_explain/types.ts#L32-L37 type AllocationExplainDecision struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/apikeygranttype/apikeygranttype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/apikeygranttype/apikeygranttype.go index 224108d4b..2071a0fc9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/apikeygranttype/apikeygranttype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/apikeygranttype/apikeygranttype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package apikeygranttype package apikeygranttype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/grant_api_key/types.ts#L48-L51 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/grant_api_key/types.ts#L48-L51 type ApiKeyGrantType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/appliesto/appliesto.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/appliesto/appliesto.go index a3370f523..61ecf793c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/appliesto/appliesto.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/appliesto/appliesto.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package appliesto package appliesto import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Rule.ts#L67-L72 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Rule.ts#L67-L72 type AppliesTo struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/boundaryscanner/boundaryscanner.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/boundaryscanner/boundaryscanner.go index 256451130..cbd08a52a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/boundaryscanner/boundaryscanner.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/boundaryscanner/boundaryscanner.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package boundaryscanner package boundaryscanner import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/highlighting.ts#L27-L46 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/highlighting.ts#L27-L46 type BoundaryScanner struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/bytes/bytes.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/bytes/bytes.go index 937564824..4427b4351 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/bytes/bytes.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/bytes/bytes.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package bytes package bytes import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L163-L181 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L174-L192 type Bytes struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/calendarinterval/calendarinterval.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/calendarinterval/calendarinterval.go index 62683b8b2..79505b870 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/calendarinterval/calendarinterval.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/calendarinterval/calendarinterval.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package calendarinterval package calendarinterval import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L249-L266 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L249-L266 type CalendarInterval struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/cardinalityexecutionmode/cardinalityexecutionmode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/cardinalityexecutionmode/cardinalityexecutionmode.go index f05104422..99832d4ec 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/cardinalityexecutionmode/cardinalityexecutionmode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/cardinalityexecutionmode/cardinalityexecutionmode.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package cardinalityexecutionmode package cardinalityexecutionmode import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L64-L85 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L64-L85 type CardinalityExecutionMode struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/catanomalydetectorcolumn/catanomalydetectorcolumn.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/catanomalydetectorcolumn/catanomalydetectorcolumn.go index ca3acae9f..ea5e32ca0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/catanomalydetectorcolumn/catanomalydetectorcolumn.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/catanomalydetectorcolumn/catanomalydetectorcolumn.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package catanomalydetectorcolumn package catanomalydetectorcolumn import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/_types/CatBase.ts#L32-L401 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/_types/CatBase.ts#L32-L401 type CatAnomalyDetectorColumn struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/catdatafeedcolumn/catdatafeedcolumn.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/catdatafeedcolumn/catdatafeedcolumn.go index dda2d5fed..d3bbef764 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/catdatafeedcolumn/catdatafeedcolumn.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/catdatafeedcolumn/catdatafeedcolumn.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package catdatafeedcolumn package catdatafeedcolumn import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/_types/CatBase.ts#L405-L471 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/_types/CatBase.ts#L405-L471 type CatDatafeedColumn struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/catdfacolumn/catdfacolumn.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/catdfacolumn/catdfacolumn.go index 6b5bfba47..0e75d3d9c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/catdfacolumn/catdfacolumn.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/catdfacolumn/catdfacolumn.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package catdfacolumn package catdfacolumn import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/_types/CatBase.ts#L472-L557 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/_types/CatBase.ts#L472-L557 type CatDfaColumn struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/categorizationstatus/categorizationstatus.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/categorizationstatus/categorizationstatus.go index 83d09dc79..a8d4e79a8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/categorizationstatus/categorizationstatus.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/categorizationstatus/categorizationstatus.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package categorizationstatus package categorizationstatus import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Model.ts#L83-L86 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Model.ts#L83-L86 type CategorizationStatus struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/cattrainedmodelscolumn/cattrainedmodelscolumn.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/cattrainedmodelscolumn/cattrainedmodelscolumn.go index ab80fefbb..b7de6e968 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/cattrainedmodelscolumn/cattrainedmodelscolumn.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/cattrainedmodelscolumn/cattrainedmodelscolumn.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package cattrainedmodelscolumn package cattrainedmodelscolumn import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/_types/CatBase.ts#L561-L635 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/_types/CatBase.ts#L561-L635 type CatTrainedModelsColumn struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/cattransformcolumn/cattransformcolumn.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/cattransformcolumn/cattransformcolumn.go index 4ca060802..c543b0b69 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/cattransformcolumn/cattransformcolumn.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/cattransformcolumn/cattransformcolumn.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package cattransformcolumn package cattransformcolumn import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/_types/CatBase.ts#L640-L844 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/_types/CatBase.ts#L640-L844 type CatTransformColumn struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/childscoremode/childscoremode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/childscoremode/childscoremode.go index 5cc2c68bf..f1db185d5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/childscoremode/childscoremode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/childscoremode/childscoremode.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package childscoremode package childscoremode import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/joining.ts#L25-L39 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/joining.ts#L25-L39 type ChildScoreMode struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/chunkingmode/chunkingmode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/chunkingmode/chunkingmode.go index 53b2a6f81..800d768ac 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/chunkingmode/chunkingmode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/chunkingmode/chunkingmode.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package chunkingmode package chunkingmode import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Datafeed.ts#L233-L237 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Datafeed.ts#L233-L237 type ChunkingMode struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/clusterinfotarget/clusterinfotarget.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/clusterinfotarget/clusterinfotarget.go index 57a1cf863..2b28c811d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/clusterinfotarget/clusterinfotarget.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/clusterinfotarget/clusterinfotarget.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package clusterinfotarget package clusterinfotarget import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L378-L384 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L389-L395 type ClusterInfoTarget struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/clusterprivilege/clusterprivilege.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/clusterprivilege/clusterprivilege.go index fb1a4f9fe..a88fd59bb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/clusterprivilege/clusterprivilege.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/clusterprivilege/clusterprivilege.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package clusterprivilege package clusterprivilege import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/_types/Privileges.ts#L41-L80 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/_types/Privileges.ts#L41-L80 type ClusterPrivilege struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/clustersearchstatus/clustersearchstatus.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/clustersearchstatus/clustersearchstatus.go index bc36f8168..6752cfa49 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/clustersearchstatus/clustersearchstatus.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/clustersearchstatus/clustersearchstatus.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package clustersearchstatus package clustersearchstatus import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Stats.ts#L37-L43 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Stats.ts#L37-L43 type ClusterSearchStatus struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/combinedfieldsoperator/combinedfieldsoperator.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/combinedfieldsoperator/combinedfieldsoperator.go index 0436c2383..058f00d2c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/combinedfieldsoperator/combinedfieldsoperator.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/combinedfieldsoperator/combinedfieldsoperator.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package combinedfieldsoperator package combinedfieldsoperator import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/abstractions.ts#L473-L476 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/abstractions.ts#L473-L476 type CombinedFieldsOperator struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/combinedfieldszeroterms/combinedfieldszeroterms.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/combinedfieldszeroterms/combinedfieldszeroterms.go index a02dfc225..828c91fe0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/combinedfieldszeroterms/combinedfieldszeroterms.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/combinedfieldszeroterms/combinedfieldszeroterms.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package combinedfieldszeroterms package combinedfieldszeroterms import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/abstractions.ts#L478-L487 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/abstractions.ts#L478-L487 type CombinedFieldsZeroTerms struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/conditionop/conditionop.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/conditionop/conditionop.go index 5e1e163e2..7ab4ad9af 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/conditionop/conditionop.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/conditionop/conditionop.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package conditionop package conditionop import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Conditions.ts#L38-L45 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Conditions.ts#L38-L45 type ConditionOp struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/conditionoperator/conditionoperator.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/conditionoperator/conditionoperator.go index 1c17a3fea..359f70a7c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/conditionoperator/conditionoperator.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/conditionoperator/conditionoperator.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package conditionoperator package conditionoperator import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Rule.ts#L74-L79 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Rule.ts#L74-L79 type ConditionOperator struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/conditiontype/conditiontype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/conditiontype/conditiontype.go index 8fdb933f4..358c98ba3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/conditiontype/conditiontype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/conditiontype/conditiontype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package conditiontype package conditiontype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Conditions.ts#L61-L67 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Conditions.ts#L61-L67 type ConditionType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/conflicts/conflicts.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/conflicts/conflicts.go index 5ac85185a..0d4389a2a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/conflicts/conflicts.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/conflicts/conflicts.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package conflicts package conflicts import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L183-L192 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L194-L203 type Conflicts struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/connectionscheme/connectionscheme.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/connectionscheme/connectionscheme.go index 3abbd34d5..1624de0b6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/connectionscheme/connectionscheme.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/connectionscheme/connectionscheme.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package connectionscheme package connectionscheme import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Input.ts#L39-L42 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Input.ts#L39-L42 type ConnectionScheme struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/converttype/converttype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/converttype/converttype.go index f78e0afd8..02799c784 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/converttype/converttype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/converttype/converttype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package converttype package converttype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L424-L432 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L424-L432 type ConvertType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/dataattachmentformat/dataattachmentformat.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/dataattachmentformat/dataattachmentformat.go index 831578537..8b1fb5b2e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/dataattachmentformat/dataattachmentformat.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/dataattachmentformat/dataattachmentformat.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package dataattachmentformat package dataattachmentformat import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Actions.ts#L187-L190 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Actions.ts#L187-L190 type DataAttachmentFormat struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/datafeedstate/datafeedstate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/datafeedstate/datafeedstate.go index 2dea96b72..ddfd72444 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/datafeedstate/datafeedstate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/datafeedstate/datafeedstate.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package datafeedstate package datafeedstate import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Datafeed.ts#L133-L138 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Datafeed.ts#L133-L138 type DatafeedState struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/dataframestate/dataframestate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/dataframestate/dataframestate.go index 3151f870b..c261b53ec 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/dataframestate/dataframestate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/dataframestate/dataframestate.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package dataframestate package dataframestate import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Dataframe.ts#L20-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Dataframe.ts#L20-L26 type DataframeState struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/day/day.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/day/day.go index bef6492d5..82a2dca73 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/day/day.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/day/day.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package day package day import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Schedule.ts#L37-L45 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Schedule.ts#L37-L45 type Day struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/decision/decision.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/decision/decision.go index a6e126bcd..1c6e0fb3c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/decision/decision.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/decision/decision.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package decision package decision import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/allocation_explain/types.ts#L86-L95 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/allocation_explain/types.ts#L86-L95 type Decision struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/delimitedpayloadencoding/delimitedpayloadencoding.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/delimitedpayloadencoding/delimitedpayloadencoding.go index 68e8ecd51..908b8868d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/delimitedpayloadencoding/delimitedpayloadencoding.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/delimitedpayloadencoding/delimitedpayloadencoding.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package delimitedpayloadencoding package delimitedpayloadencoding import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L62-L66 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L62-L66 type DelimitedPayloadEncoding struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/deploymentallocationstate/deploymentallocationstate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/deploymentallocationstate/deploymentallocationstate.go index c15bd68c5..4e2865e0c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/deploymentallocationstate/deploymentallocationstate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/deploymentallocationstate/deploymentallocationstate.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package deploymentallocationstate package deploymentallocationstate import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/TrainedModel.ts#L288-L301 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/TrainedModel.ts#L288-L301 type DeploymentAllocationState struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/deploymentassignmentstate/deploymentassignmentstate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/deploymentassignmentstate/deploymentassignmentstate.go index d2ba26e17..ef2cf75d6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/deploymentassignmentstate/deploymentassignmentstate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/deploymentassignmentstate/deploymentassignmentstate.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package deploymentassignmentstate package deploymentassignmentstate import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/TrainedModel.ts#L303-L308 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/TrainedModel.ts#L303-L308 type DeploymentAssignmentState struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/deploymentstate/deploymentstate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/deploymentstate/deploymentstate.go index 9b412187d..de3d86ee6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/deploymentstate/deploymentstate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/deploymentstate/deploymentstate.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package deploymentstate package deploymentstate import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/TrainedModel.ts#L273-L286 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/TrainedModel.ts#L273-L286 type DeploymentState struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/deprecationlevel/deprecationlevel.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/deprecationlevel/deprecationlevel.go index 345bbfb01..1a4390f9a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/deprecationlevel/deprecationlevel.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/deprecationlevel/deprecationlevel.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package deprecationlevel package deprecationlevel import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/migration/deprecations/types.ts#L20-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/migration/deprecations/types.ts#L20-L27 type DeprecationLevel struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/dfiindependencemeasure/dfiindependencemeasure.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/dfiindependencemeasure/dfiindependencemeasure.go index 1098c21df..9433ab01c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/dfiindependencemeasure/dfiindependencemeasure.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/dfiindependencemeasure/dfiindependencemeasure.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package dfiindependencemeasure package dfiindependencemeasure import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Similarity.ts#L20-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Similarity.ts#L20-L24 type DFIIndependenceMeasure struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/dfraftereffect/dfraftereffect.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/dfraftereffect/dfraftereffect.go index 167db5554..876cf867b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/dfraftereffect/dfraftereffect.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/dfraftereffect/dfraftereffect.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package dfraftereffect package dfraftereffect import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Similarity.ts#L26-L30 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Similarity.ts#L26-L30 type DFRAfterEffect struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/dfrbasicmodel/dfrbasicmodel.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/dfrbasicmodel/dfrbasicmodel.go index 46546d158..c1d08e049 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/dfrbasicmodel/dfrbasicmodel.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/dfrbasicmodel/dfrbasicmodel.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package dfrbasicmodel package dfrbasicmodel import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Similarity.ts#L32-L40 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Similarity.ts#L32-L40 type DFRBasicModel struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/distanceunit/distanceunit.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/distanceunit/distanceunit.go index 49abc807e..c085e3032 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/distanceunit/distanceunit.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/distanceunit/distanceunit.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package distanceunit package distanceunit import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Geo.ts#L30-L49 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Geo.ts#L30-L49 type DistanceUnit struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/dynamicmapping/dynamicmapping.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/dynamicmapping/dynamicmapping.go index fc0302591..a9ed1b977 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/dynamicmapping/dynamicmapping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/dynamicmapping/dynamicmapping.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package dynamicmapping package dynamicmapping import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/dynamic-template.ts#L37-L46 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/dynamic-template.ts#L37-L46 type DynamicMapping struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/edgengramside/edgengramside.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/edgengramside/edgengramside.go index e4e85ecc9..2bebc2f35 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/edgengramside/edgengramside.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/edgengramside/edgengramside.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package edgengramside package edgengramside import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L74-L77 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L74-L77 type EdgeNGramSide struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/emailpriority/emailpriority.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/emailpriority/emailpriority.go index 6e0bea2b6..821efd59f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/emailpriority/emailpriority.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/emailpriority/emailpriority.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package emailpriority package emailpriority import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Actions.ts#L197-L203 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Actions.ts#L197-L203 type EmailPriority struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/enrichpolicyphase/enrichpolicyphase.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/enrichpolicyphase/enrichpolicyphase.go index c6b30b946..1dcb230b2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/enrichpolicyphase/enrichpolicyphase.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/enrichpolicyphase/enrichpolicyphase.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package enrichpolicyphase package enrichpolicyphase import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/enrich/execute_policy/types.ts#L24-L29 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/enrich/execute_policy/types.ts#L24-L29 type EnrichPolicyPhase struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/excludefrequent/excludefrequent.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/excludefrequent/excludefrequent.go index f9b896bac..0de79f583 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/excludefrequent/excludefrequent.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/excludefrequent/excludefrequent.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package excludefrequent package excludefrequent import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Detector.ts#L127-L132 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Detector.ts#L127-L132 type ExcludeFrequent struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/executionphase/executionphase.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/executionphase/executionphase.go index 9f606ff7e..9d9fb17b9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/executionphase/executionphase.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/executionphase/executionphase.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package executionphase package executionphase import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Execution.ts#L49-L58 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Execution.ts#L49-L58 type ExecutionPhase struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/executionstatus/executionstatus.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/executionstatus/executionstatus.go index 4336ada2c..63b957372 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/executionstatus/executionstatus.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/executionstatus/executionstatus.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package executionstatus package executionstatus import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Execution.ts#L38-L47 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Execution.ts#L38-L47 type ExecutionStatus struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/expandwildcard/expandwildcard.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/expandwildcard/expandwildcard.go index 95752c09a..6a32c0962 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/expandwildcard/expandwildcard.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/expandwildcard/expandwildcard.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package expandwildcard package expandwildcard import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L201-L215 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L212-L226 type ExpandWildcard struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/feature/feature.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/feature/feature.go index 5f237a226..aab88393a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/feature/feature.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/feature/feature.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package feature package feature import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/get/IndicesGetRequest.ts#L90-L94 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/get/IndicesGetRequest.ts#L90-L94 type Feature struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/fieldsortnumerictype/fieldsortnumerictype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/fieldsortnumerictype/fieldsortnumerictype.go index ad3c6fcb5..7ee1429f0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/fieldsortnumerictype/fieldsortnumerictype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/fieldsortnumerictype/fieldsortnumerictype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package fieldsortnumerictype package fieldsortnumerictype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/sort.ts#L37-L42 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/sort.ts#L37-L42 type FieldSortNumericType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/fieldtype/fieldtype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/fieldtype/fieldtype.go index 59f308df4..fb3e6d92a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/fieldtype/fieldtype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/fieldtype/fieldtype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package fieldtype package fieldtype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/Property.ts#L160-L204 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/Property.ts#L160-L204 type FieldType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/fieldvaluefactormodifier/fieldvaluefactormodifier.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/fieldvaluefactormodifier/fieldvaluefactormodifier.go index c8874ad35..bd9684739 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/fieldvaluefactormodifier/fieldvaluefactormodifier.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/fieldvaluefactormodifier/fieldvaluefactormodifier.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package fieldvaluefactormodifier package fieldvaluefactormodifier import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/compound.ts#L298-L341 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/compound.ts#L298-L341 type FieldValueFactorModifier struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/filtertype/filtertype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/filtertype/filtertype.go index 95793c36d..84a8ba321 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/filtertype/filtertype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/filtertype/filtertype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package filtertype package filtertype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Filter.ts#L43-L46 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Filter.ts#L43-L46 type FilterType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/followerindexstatus/followerindexstatus.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/followerindexstatus/followerindexstatus.go index 549fe331b..1f533a7f3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/followerindexstatus/followerindexstatus.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/followerindexstatus/followerindexstatus.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package followerindexstatus package followerindexstatus import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ccr/follow_info/types.ts#L30-L33 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ccr/follow_info/types.ts#L30-L33 type FollowerIndexStatus struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/functionboostmode/functionboostmode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/functionboostmode/functionboostmode.go index cc4774c88..e910bf6a5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/functionboostmode/functionboostmode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/functionboostmode/functionboostmode.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package functionboostmode package functionboostmode import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/compound.ts#L270-L296 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/compound.ts#L270-L296 type FunctionBoostMode struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/functionscoremode/functionscoremode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/functionscoremode/functionscoremode.go index 1cfb75da4..3e37a9e81 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/functionscoremode/functionscoremode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/functionscoremode/functionscoremode.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package functionscoremode package functionscoremode import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/compound.ts#L243-L268 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/compound.ts#L243-L268 type FunctionScoreMode struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/gappolicy/gappolicy.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/gappolicy/gappolicy.go index fc92bcb0c..00c8cfc91 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/gappolicy/gappolicy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/gappolicy/gappolicy.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package gappolicy package gappolicy import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L61-L76 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L61-L76 type GapPolicy struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/geodistancetype/geodistancetype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/geodistancetype/geodistancetype.go index afa5824e0..26aba80c3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/geodistancetype/geodistancetype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/geodistancetype/geodistancetype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package geodistancetype package geodistancetype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Geo.ts#L51-L60 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Geo.ts#L51-L60 type GeoDistanceType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/geoexecution/geoexecution.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/geoexecution/geoexecution.go index f74692824..a2479bc5b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/geoexecution/geoexecution.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/geoexecution/geoexecution.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package geoexecution package geoexecution import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/geo.ts#L52-L55 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/geo.ts#L52-L55 type GeoExecution struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/geoorientation/geoorientation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/geoorientation/geoorientation.go index 5a447d376..3825c37fd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/geoorientation/geoorientation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/geoorientation/geoorientation.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package geoorientation package geoorientation import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/geo.ts#L30-L35 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/geo.ts#L30-L35 type GeoOrientation struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/geoshaperelation/geoshaperelation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/geoshaperelation/geoshaperelation.go index 60a4600cc..e7a4c32a2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/geoshaperelation/geoshaperelation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/geoshaperelation/geoshaperelation.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package geoshaperelation package geoshaperelation import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Geo.ts#L73-L91 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Geo.ts#L73-L91 type GeoShapeRelation struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/geostrategy/geostrategy.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/geostrategy/geostrategy.go index f62659a14..f197cd7bc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/geostrategy/geostrategy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/geostrategy/geostrategy.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package geostrategy package geostrategy import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/geo.ts#L52-L55 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/geo.ts#L52-L55 type GeoStrategy struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/geovalidationmethod/geovalidationmethod.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/geovalidationmethod/geovalidationmethod.go index 7c8e0cace..292dcad4e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/geovalidationmethod/geovalidationmethod.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/geovalidationmethod/geovalidationmethod.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package geovalidationmethod package geovalidationmethod import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/geo.ts#L141-L151 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/geo.ts#L141-L151 type GeoValidationMethod struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/granttype/granttype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/granttype/granttype.go index 2d7ecc31b..81e175ae6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/granttype/granttype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/granttype/granttype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package granttype package granttype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/_types/GrantType.ts#L20-L29 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/_types/GrantType.ts#L20-L29 type GrantType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/gridaggregationtype/gridaggregationtype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/gridaggregationtype/gridaggregationtype.go index 453e7ac25..b12efaa35 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/gridaggregationtype/gridaggregationtype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/gridaggregationtype/gridaggregationtype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package gridaggregationtype package gridaggregationtype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search_mvt/_types/GridType.ts#L30-L33 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search_mvt/_types/GridType.ts#L30-L33 type GridAggregationType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/gridtype/gridtype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/gridtype/gridtype.go index fc25b9672..66c18e8d0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/gridtype/gridtype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/gridtype/gridtype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package gridtype package gridtype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search_mvt/_types/GridType.ts#L20-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search_mvt/_types/GridType.ts#L20-L28 type GridType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/groupby/groupby.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/groupby/groupby.go index b6b4efd58..8f24829ba 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/groupby/groupby.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/groupby/groupby.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package groupby package groupby import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/tasks/_types/GroupBy.ts#L20-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/tasks/_types/GroupBy.ts#L20-L27 type GroupBy struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/healthstatus/healthstatus.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/healthstatus/healthstatus.go index 6a5b6fb11..049501771 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/healthstatus/healthstatus.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/healthstatus/healthstatus.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package healthstatus package healthstatus import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L219-L239 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L230-L250 type HealthStatus struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/highlighterencoder/highlighterencoder.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/highlighterencoder/highlighterencoder.go index 9a79932db..eb19f04e1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/highlighterencoder/highlighterencoder.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/highlighterencoder/highlighterencoder.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package highlighterencoder package highlighterencoder import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/highlighting.ts#L158-L161 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/highlighting.ts#L158-L161 type HighlighterEncoder struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/highlighterfragmenter/highlighterfragmenter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/highlighterfragmenter/highlighterfragmenter.go index 8867fcf94..ac8b73bd4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/highlighterfragmenter/highlighterfragmenter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/highlighterfragmenter/highlighterfragmenter.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package highlighterfragmenter package highlighterfragmenter import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/highlighting.ts#L163-L166 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/highlighting.ts#L163-L166 type HighlighterFragmenter struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/highlighterorder/highlighterorder.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/highlighterorder/highlighterorder.go index 54a592a74..ab9ada83b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/highlighterorder/highlighterorder.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/highlighterorder/highlighterorder.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package highlighterorder package highlighterorder import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/highlighting.ts#L168-L170 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/highlighting.ts#L168-L170 type HighlighterOrder struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/highlightertagsschema/highlightertagsschema.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/highlightertagsschema/highlightertagsschema.go index b9e785203..c7b1b1180 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/highlightertagsschema/highlightertagsschema.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/highlightertagsschema/highlightertagsschema.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package highlightertagsschema package highlightertagsschema import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/highlighting.ts#L172-L174 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/highlighting.ts#L172-L174 type HighlighterTagsSchema struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/highlightertype/highlightertype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/highlightertype/highlightertype.go index 9188f5c78..dc9b82d9f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/highlightertype/highlightertype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/highlightertype/highlightertype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package highlightertype package highlightertype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/highlighting.ts#L176-L191 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/highlighting.ts#L176-L191 type HighlighterType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/holtwinterstype/holtwinterstype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/holtwinterstype/holtwinterstype.go index 4788b95a3..7c9a8abea 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/holtwinterstype/holtwinterstype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/holtwinterstype/holtwinterstype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package holtwinterstype package holtwinterstype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L283-L288 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L283-L288 type HoltWintersType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/httpinputmethod/httpinputmethod.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/httpinputmethod/httpinputmethod.go index 05e4a0174..1f93e293f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/httpinputmethod/httpinputmethod.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/httpinputmethod/httpinputmethod.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package httpinputmethod package httpinputmethod import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Input.ts#L59-L65 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Input.ts#L59-L65 type HttpInputMethod struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/ibdistribution/ibdistribution.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/ibdistribution/ibdistribution.go index a07edf9be..594fb5c8d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/ibdistribution/ibdistribution.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/ibdistribution/ibdistribution.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package ibdistribution package ibdistribution import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Similarity.ts#L42-L45 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Similarity.ts#L42-L45 type IBDistribution struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/iblambda/iblambda.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/iblambda/iblambda.go index 4244a0f53..f17ea9746 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/iblambda/iblambda.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/iblambda/iblambda.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package iblambda package iblambda import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Similarity.ts#L47-L50 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Similarity.ts#L47-L50 type IBLambda struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/icucollationalternate/icucollationalternate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/icucollationalternate/icucollationalternate.go index 81e2ed230..31317170b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/icucollationalternate/icucollationalternate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/icucollationalternate/icucollationalternate.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package icucollationalternate package icucollationalternate import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/icu-plugin.ts#L89-L92 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/icu-plugin.ts#L89-L92 type IcuCollationAlternate struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/icucollationcasefirst/icucollationcasefirst.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/icucollationcasefirst/icucollationcasefirst.go index 74187af4e..4b4f92422 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/icucollationcasefirst/icucollationcasefirst.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/icucollationcasefirst/icucollationcasefirst.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package icucollationcasefirst package icucollationcasefirst import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/icu-plugin.ts#L94-L97 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/icu-plugin.ts#L94-L97 type IcuCollationCaseFirst struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/icucollationdecomposition/icucollationdecomposition.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/icucollationdecomposition/icucollationdecomposition.go index c353621a9..d2e8ad95b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/icucollationdecomposition/icucollationdecomposition.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/icucollationdecomposition/icucollationdecomposition.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package icucollationdecomposition package icucollationdecomposition import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/icu-plugin.ts#L99-L102 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/icu-plugin.ts#L99-L102 type IcuCollationDecomposition struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/icucollationstrength/icucollationstrength.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/icucollationstrength/icucollationstrength.go index 2e3787936..5ef07b832 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/icucollationstrength/icucollationstrength.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/icucollationstrength/icucollationstrength.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package icucollationstrength package icucollationstrength import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/icu-plugin.ts#L104-L110 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/icu-plugin.ts#L104-L110 type IcuCollationStrength struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/icunormalizationmode/icunormalizationmode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/icunormalizationmode/icunormalizationmode.go index 69a90af92..e37168322 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/icunormalizationmode/icunormalizationmode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/icunormalizationmode/icunormalizationmode.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package icunormalizationmode package icunormalizationmode import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/icu-plugin.ts#L78-L81 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/icu-plugin.ts#L78-L81 type IcuNormalizationMode struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/icunormalizationtype/icunormalizationtype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/icunormalizationtype/icunormalizationtype.go index 77535b174..99252c892 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/icunormalizationtype/icunormalizationtype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/icunormalizationtype/icunormalizationtype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package icunormalizationtype package icunormalizationtype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/icu-plugin.ts#L83-L87 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/icu-plugin.ts#L83-L87 type IcuNormalizationType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/icutransformdirection/icutransformdirection.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/icutransformdirection/icutransformdirection.go index bbe81eea8..32eebfec3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/icutransformdirection/icutransformdirection.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/icutransformdirection/icutransformdirection.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package icutransformdirection package icutransformdirection import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/icu-plugin.ts#L73-L76 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/icu-plugin.ts#L73-L76 type IcuTransformDirection struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/impactarea/impactarea.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/impactarea/impactarea.go index 9faeee972..a496c3903 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/impactarea/impactarea.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/impactarea/impactarea.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package impactarea package impactarea import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/health_report/types.ts#L72-L77 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/health_report/types.ts#L72-L77 type ImpactArea struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/include/include.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/include/include.go index df1cc73b5..f454a63f7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/include/include.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/include/include.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package include package include import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Include.ts#L20-L47 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Include.ts#L20-L47 type Include struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/indexcheckonstartup/indexcheckonstartup.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/indexcheckonstartup/indexcheckonstartup.go index a4aefc86a..f38cc04ba 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/indexcheckonstartup/indexcheckonstartup.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/indexcheckonstartup/indexcheckonstartup.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package indexcheckonstartup package indexcheckonstartup import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L253-L260 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L253-L260 type IndexCheckOnStartup struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/indexingjobstate/indexingjobstate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/indexingjobstate/indexingjobstate.go index 173c61d96..63f1698b6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/indexingjobstate/indexingjobstate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/indexingjobstate/indexingjobstate.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package indexingjobstate package indexingjobstate import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/rollup/get_jobs/types.ts#L66-L72 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/rollup/get_jobs/types.ts#L66-L72 type IndexingJobState struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/indexmetadatastate/indexmetadatastate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/indexmetadatastate/indexmetadatastate.go index 322f30d56..9a79d10f2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/indexmetadatastate/indexmetadatastate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/indexmetadatastate/indexmetadatastate.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package indexmetadatastate package indexmetadatastate import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/stats/types.ts#L225-L232 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/stats/types.ts#L225-L232 type IndexMetadataState struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/indexoptions/indexoptions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/indexoptions/indexoptions.go index 7d41f8253..95b4ce99f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/indexoptions/indexoptions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/indexoptions/indexoptions.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package indexoptions package indexoptions import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/core.ts#L242-L247 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/core.ts#L242-L247 type IndexOptions struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/indexprivilege/indexprivilege.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/indexprivilege/indexprivilege.go index cea7643c3..505c876a5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/indexprivilege/indexprivilege.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/indexprivilege/indexprivilege.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package indexprivilege package indexprivilege import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/_types/Privileges.ts#L166-L187 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/_types/Privileges.ts#L166-L187 type IndexPrivilege struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/indexroutingallocationoptions/indexroutingallocationoptions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/indexroutingallocationoptions/indexroutingallocationoptions.go index 6db406e36..1dea6ffe9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/indexroutingallocationoptions/indexroutingallocationoptions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/indexroutingallocationoptions/indexroutingallocationoptions.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package indexroutingallocationoptions package indexroutingallocationoptions import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexRouting.ts#L38-L43 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexRouting.ts#L38-L43 type IndexRoutingAllocationOptions struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/indexroutingrebalanceoptions/indexroutingrebalanceoptions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/indexroutingrebalanceoptions/indexroutingrebalanceoptions.go index 984e6b223..b3583c5ad 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/indexroutingrebalanceoptions/indexroutingrebalanceoptions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/indexroutingrebalanceoptions/indexroutingrebalanceoptions.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package indexroutingrebalanceoptions package indexroutingrebalanceoptions import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexRouting.ts#L45-L50 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexRouting.ts#L45-L50 type IndexRoutingRebalanceOptions struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/indicatorhealthstatus/indicatorhealthstatus.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/indicatorhealthstatus/indicatorhealthstatus.go index 8b6ea1271..7ceb1e5a6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/indicatorhealthstatus/indicatorhealthstatus.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/indicatorhealthstatus/indicatorhealthstatus.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package indicatorhealthstatus package indicatorhealthstatus import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/health_report/types.ts#L25-L30 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/health_report/types.ts#L25-L30 type IndicatorHealthStatus struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/inputtype/inputtype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/inputtype/inputtype.go index 83bb79cc8..e40430eb4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/inputtype/inputtype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/inputtype/inputtype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package inputtype package inputtype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Input.ts#L100-L104 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Input.ts#L100-L104 type InputType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/jobblockedreason/jobblockedreason.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/jobblockedreason/jobblockedreason.go index 20c562161..fccf19a92 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/jobblockedreason/jobblockedreason.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/jobblockedreason/jobblockedreason.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package jobblockedreason package jobblockedreason import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Job.ts#L397-L401 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Job.ts#L397-L401 type JobBlockedReason struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/jobstate/jobstate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/jobstate/jobstate.go index 288fdf446..4903af546 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/jobstate/jobstate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/jobstate/jobstate.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package jobstate package jobstate import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Job.ts#L36-L52 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Job.ts#L36-L52 type JobState struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/jsonprocessorconflictstrategy/jsonprocessorconflictstrategy.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/jsonprocessorconflictstrategy/jsonprocessorconflictstrategy.go index ad4c05874..f56b12a97 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/jsonprocessorconflictstrategy/jsonprocessorconflictstrategy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/jsonprocessorconflictstrategy/jsonprocessorconflictstrategy.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package jsonprocessorconflictstrategy package jsonprocessorconflictstrategy import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L838-L843 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L838-L843 type JsonProcessorConflictStrategy struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/keeptypesmode/keeptypesmode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/keeptypesmode/keeptypesmode.go index be8dbbbdb..9fb7244b1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/keeptypesmode/keeptypesmode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/keeptypesmode/keeptypesmode.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package keeptypesmode package keeptypesmode import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L213-L216 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L213-L216 type KeepTypesMode struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/kuromojitokenizationmode/kuromojitokenizationmode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/kuromojitokenizationmode/kuromojitokenizationmode.go index 095d09a0c..f0fe3ba96 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/kuromojitokenizationmode/kuromojitokenizationmode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/kuromojitokenizationmode/kuromojitokenizationmode.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package kuromojitokenizationmode package kuromojitokenizationmode import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/kuromoji-plugin.ts#L52-L56 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/kuromoji-plugin.ts#L52-L56 type KuromojiTokenizationMode struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/language/language.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/language/language.go index 1cfea5746..95c1ae314 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/language/language.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/language/language.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package language package language import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/languages.ts#L20-L55 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/languages.ts#L20-L55 type Language struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/level/level.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/level/level.go index 3ef8267f8..6cde5d581 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/level/level.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/level/level.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package level package level import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L249-L253 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L260-L264 type Level struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/licensestatus/licensestatus.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/licensestatus/licensestatus.go index bd05774e4..a548e4f0b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/licensestatus/licensestatus.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/licensestatus/licensestatus.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package licensestatus package licensestatus import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/license/_types/License.ts#L35-L40 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/license/_types/License.ts#L35-L40 type LicenseStatus struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/licensetype/licensetype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/licensetype/licensetype.go index 460cd5204..73461502e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/licensetype/licensetype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/licensetype/licensetype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package licensetype package licensetype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/license/_types/License.ts#L23-L33 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/license/_types/License.ts#L23-L33 type LicenseType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/lifecycleoperationmode/lifecycleoperationmode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/lifecycleoperationmode/lifecycleoperationmode.go index eb8d9e03f..85b01c506 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/lifecycleoperationmode/lifecycleoperationmode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/lifecycleoperationmode/lifecycleoperationmode.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package lifecycleoperationmode package lifecycleoperationmode import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Lifecycle.ts#L20-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Lifecycle.ts#L20-L24 type LifecycleOperationMode struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/matchtype/matchtype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/matchtype/matchtype.go index 243c49c2d..44578088b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/matchtype/matchtype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/matchtype/matchtype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package matchtype package matchtype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/dynamic-template.ts#L32-L35 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/dynamic-template.ts#L32-L35 type MatchType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/memorystatus/memorystatus.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/memorystatus/memorystatus.go index 666d13190..44d626be4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/memorystatus/memorystatus.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/memorystatus/memorystatus.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package memorystatus package memorystatus import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Model.ts#L88-L92 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Model.ts#L88-L92 type MemoryStatus struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/metric/metric.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/metric/metric.go index 11928cd15..2191b04d8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/metric/metric.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/metric/metric.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package metric package metric import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/rollup/_types/Metric.ts#L22-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/rollup/_types/Metric.ts#L22-L28 type Metric struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/migrationstatus/migrationstatus.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/migrationstatus/migrationstatus.go index 937ed3690..362af76fd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/migrationstatus/migrationstatus.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/migrationstatus/migrationstatus.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package migrationstatus package migrationstatus import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/migration/get_feature_upgrade_status/GetFeatureUpgradeStatusResponse.ts#L30-L35 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/migration/get_feature_upgrade_status/GetFeatureUpgradeStatusResponse.ts#L30-L35 type MigrationStatus struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/minimuminterval/minimuminterval.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/minimuminterval/minimuminterval.go index 47af846ff..712de1ab6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/minimuminterval/minimuminterval.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/minimuminterval/minimuminterval.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package minimuminterval package minimuminterval import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L102-L109 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L102-L109 type MinimumInterval struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/missingorder/missingorder.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/missingorder/missingorder.go index 5496d096b..c33896e37 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/missingorder/missingorder.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/missingorder/missingorder.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package missingorder package missingorder import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/AggregationContainer.ts#L518-L522 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/AggregationContainer.ts#L518-L522 type MissingOrder struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/month/month.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/month/month.go index 27e76a6e3..5e0ede721 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/month/month.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/month/month.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package month package month import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Schedule.ts#L70-L83 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Schedule.ts#L70-L83 type Month struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/multivaluemode/multivaluemode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/multivaluemode/multivaluemode.go index d2a987e4d..d6143496a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/multivaluemode/multivaluemode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/multivaluemode/multivaluemode.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package multivaluemode package multivaluemode import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/compound.ts#L343-L360 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/compound.ts#L343-L360 type MultiValueMode struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/noderole/noderole.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/noderole/noderole.go index 26221898a..1ad11d304 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/noderole/noderole.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/noderole/noderole.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package noderole package noderole import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Node.ts#L77-L95 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Node.ts#L77-L95 type NodeRole struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/noridecompoundmode/noridecompoundmode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/noridecompoundmode/noridecompoundmode.go index 520c3114f..fd3e849de 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/noridecompoundmode/noridecompoundmode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/noridecompoundmode/noridecompoundmode.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package noridecompoundmode package noridecompoundmode import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/tokenizers.ts#L75-L79 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/tokenizers.ts#L75-L79 type NoriDecompoundMode struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/normalization/normalization.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/normalization/normalization.go index 0d99239d5..2517d25fd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/normalization/normalization.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/normalization/normalization.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package normalization package normalization import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Similarity.ts#L52-L58 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Similarity.ts#L52-L58 type Normalization struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/normalizemethod/normalizemethod.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/normalizemethod/normalizemethod.go index ccd117f6b..d1e10cd97 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/normalizemethod/normalizemethod.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/normalizemethod/normalizemethod.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package normalizemethod package normalizemethod import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L328-L354 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L328-L354 type NormalizeMethod struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/numericfielddataformat/numericfielddataformat.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/numericfielddataformat/numericfielddataformat.go index 5d2791701..bf658744c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/numericfielddataformat/numericfielddataformat.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/numericfielddataformat/numericfielddataformat.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package numericfielddataformat package numericfielddataformat import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/NumericFielddataFormat.ts#L20-L23 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/NumericFielddataFormat.ts#L20-L23 type NumericFielddataFormat struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/onscripterror/onscripterror.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/onscripterror/onscripterror.go index 28a9b005b..fc6d1b506 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/onscripterror/onscripterror.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/onscripterror/onscripterror.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package onscripterror package onscripterror import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/core.ts#L129-L132 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/core.ts#L129-L132 type OnScriptError struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/operationtype/operationtype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/operationtype/operationtype.go index 561bf8b33..98a203a51 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/operationtype/operationtype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/operationtype/operationtype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package operationtype package operationtype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/bulk/types.ts#L83-L88 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/bulk/types.ts#L83-L88 type OperationType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/operator/operator.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/operator/operator.go index e84c749d3..8730cd14d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/operator/operator.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/operator/operator.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package operator package operator import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/Operator.ts#L22-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/Operator.ts#L22-L27 type Operator struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/optype/optype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/optype/optype.go index c270ebfd6..5c5fae774 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/optype/optype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/optype/optype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package optype package optype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L255-L264 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L266-L275 type OpType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/pagerdutycontexttype/pagerdutycontexttype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/pagerdutycontexttype/pagerdutycontexttype.go index d5c840c1a..ab362d279 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/pagerdutycontexttype/pagerdutycontexttype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/pagerdutycontexttype/pagerdutycontexttype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package pagerdutycontexttype package pagerdutycontexttype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Actions.ts#L67-L70 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Actions.ts#L67-L70 type PagerDutyContextType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/pagerdutyeventtype/pagerdutyeventtype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/pagerdutyeventtype/pagerdutyeventtype.go index c6dee4c5e..76036a88e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/pagerdutyeventtype/pagerdutyeventtype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/pagerdutyeventtype/pagerdutyeventtype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package pagerdutyeventtype package pagerdutyeventtype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Actions.ts#L72-L76 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Actions.ts#L72-L76 type PagerDutyEventType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/phoneticencoder/phoneticencoder.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/phoneticencoder/phoneticencoder.go index a7b9fc8e1..74f507f31 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/phoneticencoder/phoneticencoder.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/phoneticencoder/phoneticencoder.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package phoneticencoder package phoneticencoder import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/phonetic-plugin.ts#L23-L36 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/phonetic-plugin.ts#L23-L36 type PhoneticEncoder struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/phoneticlanguage/phoneticlanguage.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/phoneticlanguage/phoneticlanguage.go index af480e5ee..5ef035745 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/phoneticlanguage/phoneticlanguage.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/phoneticlanguage/phoneticlanguage.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package phoneticlanguage package phoneticlanguage import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/phonetic-plugin.ts#L38-L51 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/phonetic-plugin.ts#L38-L51 type PhoneticLanguage struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/phoneticnametype/phoneticnametype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/phoneticnametype/phoneticnametype.go index ec3d26b88..b6952bf7b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/phoneticnametype/phoneticnametype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/phoneticnametype/phoneticnametype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package phoneticnametype package phoneticnametype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/phonetic-plugin.ts#L53-L57 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/phonetic-plugin.ts#L53-L57 type PhoneticNameType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/phoneticruletype/phoneticruletype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/phoneticruletype/phoneticruletype.go index 8753c3772..b324f617a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/phoneticruletype/phoneticruletype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/phoneticruletype/phoneticruletype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package phoneticruletype package phoneticruletype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/phonetic-plugin.ts#L59-L62 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/phonetic-plugin.ts#L59-L62 type PhoneticRuleType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/policytype/policytype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/policytype/policytype.go index 56a745052..2a7eacfb6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/policytype/policytype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/policytype/policytype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package policytype package policytype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/enrich/_types/Policy.ts#L27-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/enrich/_types/Policy.ts#L27-L31 type PolicyType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/quantifier/quantifier.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/quantifier/quantifier.go index 459ed91ba..9d474dbbd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/quantifier/quantifier.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/quantifier/quantifier.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package quantifier package quantifier import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Conditions.ts#L71-L74 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Conditions.ts#L71-L74 type Quantifier struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/queryrulecriteriatype/queryrulecriteriatype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/queryrulecriteriatype/queryrulecriteriatype.go index a118b359c..231dbf515 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/queryrulecriteriatype/queryrulecriteriatype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/queryrulecriteriatype/queryrulecriteriatype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package queryrulecriteriatype package queryrulecriteriatype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/query_ruleset/_types/QueryRuleset.ts#L54-L65 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/query_ruleset/_types/QueryRuleset.ts#L54-L65 type QueryRuleCriteriaType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/queryruletype/queryruletype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/queryruletype/queryruletype.go index 52777e403..f31f3a553 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/queryruletype/queryruletype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/queryruletype/queryruletype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package queryruletype package queryruletype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/query_ruleset/_types/QueryRuleset.ts#L44-L46 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/query_ruleset/_types/QueryRuleset.ts#L44-L46 type QueryRuleType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/rangerelation/rangerelation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/rangerelation/rangerelation.go index 9b8e0a849..33f009094 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/rangerelation/rangerelation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/rangerelation/rangerelation.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package rangerelation package rangerelation import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/term.ts#L170-L183 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/term.ts#L170-L183 type RangeRelation struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/ratemode/ratemode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/ratemode/ratemode.go index 4028574ef..cc4cb8d73 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/ratemode/ratemode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/ratemode/ratemode.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package ratemode package ratemode import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L243-L252 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L243-L252 type RateMode struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/refresh/refresh.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/refresh/refresh.go index 9a5628895..1ee251703 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/refresh/refresh.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/refresh/refresh.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package refresh package refresh import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L266-L273 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L277-L284 type Refresh struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/responsecontenttype/responsecontenttype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/responsecontenttype/responsecontenttype.go index 0497c02bc..baee47ae9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/responsecontenttype/responsecontenttype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/responsecontenttype/responsecontenttype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package responsecontenttype package responsecontenttype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Input.ts#L106-L110 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Input.ts#L106-L110 type ResponseContentType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/result/result.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/result/result.go index bf88b75ce..54ab44888 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/result/result.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/result/result.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package result package result import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Result.ts#L20-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Result.ts#L20-L27 type Result struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/resultposition/resultposition.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/resultposition/resultposition.go index 278822a21..46061e14d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/resultposition/resultposition.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/resultposition/resultposition.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package resultposition package resultposition import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/eql/search/types.ts#L20-L32 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/eql/search/types.ts#L20-L32 type ResultPosition struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/routingstate/routingstate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/routingstate/routingstate.go index aebd44e02..89971f169 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/routingstate/routingstate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/routingstate/routingstate.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package routingstate package routingstate import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/TrainedModel.ts#L350-L371 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/TrainedModel.ts#L350-L371 type RoutingState struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/ruleaction/ruleaction.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/ruleaction/ruleaction.go index 81d15c7b3..7ff2e3241 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/ruleaction/ruleaction.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/ruleaction/ruleaction.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package ruleaction package ruleaction import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Rule.ts#L41-L50 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Rule.ts#L41-L50 type RuleAction struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/runtimefieldtype/runtimefieldtype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/runtimefieldtype/runtimefieldtype.go index 38fa0ead7..919a9e068 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/runtimefieldtype/runtimefieldtype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/runtimefieldtype/runtimefieldtype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package runtimefieldtype package runtimefieldtype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/RuntimeFields.ts#L56-L65 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/RuntimeFields.ts#L56-L65 type RuntimeFieldType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/sampleraggregationexecutionhint/sampleraggregationexecutionhint.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/sampleraggregationexecutionhint/sampleraggregationexecutionhint.go index 928e2a2c9..0a690a29a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/sampleraggregationexecutionhint/sampleraggregationexecutionhint.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/sampleraggregationexecutionhint/sampleraggregationexecutionhint.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package sampleraggregationexecutionhint package sampleraggregationexecutionhint import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L343-L356 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L343-L356 type SamplerAggregationExecutionHint struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/scoremode/scoremode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/scoremode/scoremode.go index 23cab852f..0a34c4786 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/scoremode/scoremode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/scoremode/scoremode.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package scoremode package scoremode import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/rescoring.ts#L52-L74 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/rescoring.ts#L52-L74 type ScoreMode struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/scriptlanguage/scriptlanguage.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/scriptlanguage/scriptlanguage.go index cf12f7a49..06af1b5ab 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/scriptlanguage/scriptlanguage.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/scriptlanguage/scriptlanguage.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package scriptlanguage package scriptlanguage import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Scripting.ts#L24-L45 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Scripting.ts#L24-L45 type ScriptLanguage struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/scriptsorttype/scriptsorttype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/scriptsorttype/scriptsorttype.go index a54760598..87657b4f5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/scriptsorttype/scriptsorttype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/scriptsorttype/scriptsorttype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package scriptsorttype package scriptsorttype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/sort.ts#L76-L80 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/sort.ts#L76-L80 type ScriptSortType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/searchtype/searchtype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/searchtype/searchtype.go index 5f8c81bd8..f4aa5de39 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/searchtype/searchtype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/searchtype/searchtype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package searchtype package searchtype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L275-L280 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L286-L291 type SearchType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/segmentsortmissing/segmentsortmissing.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/segmentsortmissing/segmentsortmissing.go index 437adee7a..3eae1b9b0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/segmentsortmissing/segmentsortmissing.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/segmentsortmissing/segmentsortmissing.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package segmentsortmissing package segmentsortmissing import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSegmentSort.ts#L43-L48 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSegmentSort.ts#L43-L48 type SegmentSortMissing struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/segmentsortmode/segmentsortmode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/segmentsortmode/segmentsortmode.go index b568574aa..12f58961c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/segmentsortmode/segmentsortmode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/segmentsortmode/segmentsortmode.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package segmentsortmode package segmentsortmode import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSegmentSort.ts#L36-L41 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSegmentSort.ts#L36-L41 type SegmentSortMode struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/segmentsortorder/segmentsortorder.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/segmentsortorder/segmentsortorder.go index 3ff293cb9..2cbc91b67 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/segmentsortorder/segmentsortorder.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/segmentsortorder/segmentsortorder.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package segmentsortorder package segmentsortorder import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSegmentSort.ts#L29-L34 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSegmentSort.ts#L29-L34 type SegmentSortOrder struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/shapetype/shapetype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/shapetype/shapetype.go index b8f9810f4..5cbe268d4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/shapetype/shapetype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/shapetype/shapetype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package shapetype package shapetype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L1029-L1032 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L1029-L1032 type ShapeType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/shardroutingstate/shardroutingstate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/shardroutingstate/shardroutingstate.go index 1bbb0b82b..634d02232 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/shardroutingstate/shardroutingstate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/shardroutingstate/shardroutingstate.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package shardroutingstate package shardroutingstate import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/stats/types.ts#L169-L174 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/stats/types.ts#L169-L174 type ShardRoutingState struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/shardsstatsstage/shardsstatsstage.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/shardsstatsstage/shardsstatsstage.go index 6198f3baf..7b4d47c4e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/shardsstatsstage/shardsstatsstage.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/shardsstatsstage/shardsstatsstage.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package shardsstatsstage package shardsstatsstage import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/_types/SnapshotShardsStatsStage.ts#L20-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/_types/SnapshotShardsStatsStage.ts#L20-L31 type ShardsStatsStage struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/shardstoreallocation/shardstoreallocation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/shardstoreallocation/shardstoreallocation.go index 324d087e7..41d99d3e4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/shardstoreallocation/shardstoreallocation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/shardstoreallocation/shardstoreallocation.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package shardstoreallocation package shardstoreallocation import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/shard_stores/types.ts#L45-L49 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/shard_stores/types.ts#L45-L49 type ShardStoreAllocation struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/shardstorestatus/shardstorestatus.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/shardstorestatus/shardstorestatus.go index ec616146f..7dbde99a3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/shardstorestatus/shardstorestatus.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/shardstorestatus/shardstorestatus.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package shardstorestatus package shardstorestatus import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/shard_stores/types.ts#L60-L69 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/shard_stores/types.ts#L60-L69 type ShardStoreStatus struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/shutdownstatus/shutdownstatus.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/shutdownstatus/shutdownstatus.go index 5fd11ab49..cf40a056c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/shutdownstatus/shutdownstatus.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/shutdownstatus/shutdownstatus.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package shutdownstatus package shutdownstatus import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/shutdown/get_node/ShutdownGetNodeResponse.ts#L45-L50 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/shutdown/get_node/ShutdownGetNodeResponse.ts#L45-L50 type ShutdownStatus struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/shutdowntype/shutdowntype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/shutdowntype/shutdowntype.go index b6b1c906d..4bcc67173 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/shutdowntype/shutdowntype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/shutdowntype/shutdowntype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package shutdowntype package shutdowntype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/shutdown/get_node/ShutdownGetNodeResponse.ts#L40-L43 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/shutdown/get_node/ShutdownGetNodeResponse.ts#L40-L43 type ShutdownType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/snapshotsort/snapshotsort.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/snapshotsort/snapshotsort.go index 24c39307e..6c34d263f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/snapshotsort/snapshotsort.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/snapshotsort/snapshotsort.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package snapshotsort package snapshotsort import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/_types/SnapshotInfo.ts#L73-L93 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/_types/SnapshotInfo.ts#L73-L93 type SnapshotSort struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/snapshotupgradestate/snapshotupgradestate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/snapshotupgradestate/snapshotupgradestate.go index 552d2a1f4..192c19e36 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/snapshotupgradestate/snapshotupgradestate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/snapshotupgradestate/snapshotupgradestate.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package snapshotupgradestate package snapshotupgradestate import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Model.ts#L94-L99 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Model.ts#L94-L99 type SnapshotUpgradeState struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/snowballlanguage/snowballlanguage.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/snowballlanguage/snowballlanguage.go index e271a7f95..a3b7b6b09 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/snowballlanguage/snowballlanguage.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/snowballlanguage/snowballlanguage.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package snowballlanguage package snowballlanguage import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/languages.ts#L57-L80 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/languages.ts#L57-L80 type SnowballLanguage struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/sortmode/sortmode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/sortmode/sortmode.go index eb4c48ec4..c7a2760db 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/sortmode/sortmode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/sortmode/sortmode.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package sortmode package sortmode import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/sort.ts#L103-L112 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/sort.ts#L103-L112 type SortMode struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/sortorder/sortorder.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/sortorder/sortorder.go index 563393d03..48ebdc13c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/sortorder/sortorder.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/sortorder/sortorder.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package sortorder package sortorder import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/sort.ts#L114-L123 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/sort.ts#L114-L123 type SortOrder struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/sourcefieldmode/sourcefieldmode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/sourcefieldmode/sourcefieldmode.go index 6a7ce2a29..321d1d005 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/sourcefieldmode/sourcefieldmode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/sourcefieldmode/sourcefieldmode.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package sourcefieldmode package sourcefieldmode import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/meta-fields.ts#L67-L75 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/meta-fields.ts#L67-L75 type SourceFieldMode struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/statslevel/statslevel.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/statslevel/statslevel.go index 796a7166b..065db45f7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/statslevel/statslevel.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/statslevel/statslevel.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package statslevel package statslevel import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/searchable_snapshots/_types/stats.ts#L20-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/searchable_snapshots/_types/stats.ts#L20-L24 type StatsLevel struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/storagetype/storagetype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/storagetype/storagetype.go index 82aa62a73..c9ba6fb00 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/storagetype/storagetype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/storagetype/storagetype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package storagetype package storagetype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L502-L532 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L502-L532 type StorageType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/stringdistance/stringdistance.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/stringdistance/stringdistance.go index 3e2732da9..d1e9590e1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/stringdistance/stringdistance.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/stringdistance/stringdistance.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package stringdistance package stringdistance import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/suggester.ts#L469-L490 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/suggester.ts#L469-L490 type StringDistance struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/suggestmode/suggestmode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/suggestmode/suggestmode.go index 43e7e8d05..1456bbdfd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/suggestmode/suggestmode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/suggestmode/suggestmode.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package suggestmode package suggestmode import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L282-L295 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L293-L306 type SuggestMode struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/suggestsort/suggestsort.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/suggestsort/suggestsort.go index 29a448920..d274109ca 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/suggestsort/suggestsort.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/suggestsort/suggestsort.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package suggestsort package suggestsort import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/suggester.ts#L492-L501 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/suggester.ts#L492-L501 type SuggestSort struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/synonymformat/synonymformat.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/synonymformat/synonymformat.go index b96074074..17fd007b4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/synonymformat/synonymformat.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/synonymformat/synonymformat.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package synonymformat package synonymformat import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L105-L108 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L105-L108 type SynonymFormat struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/tasktype/tasktype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/tasktype/tasktype.go new file mode 100644 index 000000000..1a57ad8a9 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/tasktype/tasktype.go @@ -0,0 +1,57 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated from the elasticsearch-specification DO NOT EDIT. +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c + +// Package tasktype +package tasktype + +import "strings" + +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/inference/_types/TaskType.ts#L20-L26 +type TaskType struct { + Name string +} + +var ( + Sparseembedding = TaskType{"sparse_embedding"} + + Textembedding = TaskType{"text_embedding"} +) + +func (t TaskType) MarshalText() (text []byte, err error) { + return []byte(t.String()), nil +} + +func (t *TaskType) UnmarshalText(text []byte) error { + switch strings.ReplaceAll(strings.ToLower(string(text)), "\"", "") { + + case "sparse_embedding": + *t = Sparseembedding + case "text_embedding": + *t = Textembedding + default: + *t = TaskType{string(text)} + } + + return nil +} + +func (t TaskType) String() string { + return t.Name +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/templateformat/templateformat.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/templateformat/templateformat.go index 1c057e457..1af879cc4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/templateformat/templateformat.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/templateformat/templateformat.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package templateformat package templateformat import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/get_role/types.ts#L44-L47 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/_types/RoleTemplate.ts#L22-L25 type TemplateFormat struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/termsaggregationcollectmode/termsaggregationcollectmode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/termsaggregationcollectmode/termsaggregationcollectmode.go index 90662a08c..23e616939 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/termsaggregationcollectmode/termsaggregationcollectmode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/termsaggregationcollectmode/termsaggregationcollectmode.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package termsaggregationcollectmode package termsaggregationcollectmode import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L980-L989 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L980-L989 type TermsAggregationCollectMode struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/termsaggregationexecutionhint/termsaggregationexecutionhint.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/termsaggregationexecutionhint/termsaggregationexecutionhint.go index 348acee3e..215e8802a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/termsaggregationexecutionhint/termsaggregationexecutionhint.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/termsaggregationexecutionhint/termsaggregationexecutionhint.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package termsaggregationexecutionhint package termsaggregationexecutionhint import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L991-L996 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L991-L996 type TermsAggregationExecutionHint struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/termvectoroption/termvectoroption.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/termvectoroption/termvectoroption.go index f20e5a796..f9f9ba036 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/termvectoroption/termvectoroption.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/termvectoroption/termvectoroption.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package termvectoroption package termvectoroption import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/TermVectorOption.ts#L20-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/TermVectorOption.ts#L20-L28 type TermVectorOption struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/textquerytype/textquerytype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/textquerytype/textquerytype.go index 1e8a9966a..b2f2d17f6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/textquerytype/textquerytype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/textquerytype/textquerytype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package textquerytype package textquerytype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/fulltext.ts#L541-L567 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/fulltext.ts#L541-L567 type TextQueryType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/threadtype/threadtype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/threadtype/threadtype.go index 8ed4e9f86..fcb06baae 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/threadtype/threadtype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/threadtype/threadtype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package threadtype package threadtype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L297-L303 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L308-L314 type ThreadType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/timeseriesmetrictype/timeseriesmetrictype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/timeseriesmetrictype/timeseriesmetrictype.go index 3a7e513ac..7d0080f02 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/timeseriesmetrictype/timeseriesmetrictype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/timeseriesmetrictype/timeseriesmetrictype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package timeseriesmetrictype package timeseriesmetrictype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/TimeSeriesMetricType.ts#L20-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/TimeSeriesMetricType.ts#L20-L26 type TimeSeriesMetricType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/timeunit/timeunit.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/timeunit/timeunit.go index f0af3c5cf..828aab929 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/timeunit/timeunit.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/timeunit/timeunit.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package timeunit package timeunit import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Time.ts#L69-L84 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Time.ts#L69-L84 type TimeUnit struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/tokenchar/tokenchar.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/tokenchar/tokenchar.go index 63cb676d3..72453cb5a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/tokenchar/tokenchar.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/tokenchar/tokenchar.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package tokenchar package tokenchar import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/tokenizers.ts#L47-L54 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/tokenizers.ts#L47-L54 type TokenChar struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/tokenizationtruncate/tokenizationtruncate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/tokenizationtruncate/tokenizationtruncate.go index d2b93d835..049beae78 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/tokenizationtruncate/tokenizationtruncate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/tokenizationtruncate/tokenizationtruncate.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package tokenizationtruncate package tokenizationtruncate import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/inference.ts#L350-L354 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/inference.ts#L350-L354 type TokenizationTruncate struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/totalhitsrelation/totalhitsrelation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/totalhitsrelation/totalhitsrelation.go index 28b9002d0..4a2664ea6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/totalhitsrelation/totalhitsrelation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/totalhitsrelation/totalhitsrelation.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package totalhitsrelation package totalhitsrelation import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/hits.ts#L99-L104 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/hits.ts#L99-L104 type TotalHitsRelation struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/trainedmodeltype/trainedmodeltype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/trainedmodeltype/trainedmodeltype.go index 9adb0b119..f62a7b010 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/trainedmodeltype/trainedmodeltype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/trainedmodeltype/trainedmodeltype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package trainedmodeltype package trainedmodeltype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/TrainedModel.ts#L257-L271 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/TrainedModel.ts#L257-L271 type TrainedModelType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/trainingpriority/trainingpriority.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/trainingpriority/trainingpriority.go index dd26ab27a..8e65091d1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/trainingpriority/trainingpriority.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/trainingpriority/trainingpriority.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package trainingpriority package trainingpriority import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/TrainedModel.ts#L310-L313 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/TrainedModel.ts#L310-L313 type TrainingPriority struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/translogdurability/translogdurability.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/translogdurability/translogdurability.go index 2b913f218..abea197a0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/translogdurability/translogdurability.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/translogdurability/translogdurability.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package translogdurability package translogdurability import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L356-L371 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L356-L371 type TranslogDurability struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/ttesttype/ttesttype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/ttesttype/ttesttype.go index 73be45464..0041b3ce4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/ttesttype/ttesttype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/ttesttype/ttesttype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package ttesttype package ttesttype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L322-L335 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L322-L335 type TTestType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/type_/type_.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/type_/type_.go index 9cc295d9c..b6420e39b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/type_/type_.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/type_/type_.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package type_ package type_ import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/shutdown/_types/types.ts#L20-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/shutdown/_types/types.ts#L20-L24 type Type struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/unassignedinformationreason/unassignedinformationreason.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/unassignedinformationreason/unassignedinformationreason.go index 8402f1092..16ec559df 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/unassignedinformationreason/unassignedinformationreason.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/unassignedinformationreason/unassignedinformationreason.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package unassignedinformationreason package unassignedinformationreason import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/allocation_explain/types.ts#L127-L146 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/allocation_explain/types.ts#L127-L146 type UnassignedInformationReason struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/useragentproperty/useragentproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/useragentproperty/useragentproperty.go index 486ac6395..caf3c33aa 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/useragentproperty/useragentproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/useragentproperty/useragentproperty.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package useragentproperty package useragentproperty import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L260-L271 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L260-L271 type UserAgentProperty struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/valuetype/valuetype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/valuetype/valuetype.go index 37c9c9a20..74a08d44c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/valuetype/valuetype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/valuetype/valuetype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package valuetype package valuetype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L419-L430 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L419-L430 type ValueType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/versiontype/versiontype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/versiontype/versiontype.go index b0d0142ac..dc1e2f8fa 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/versiontype/versiontype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/versiontype/versiontype.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package versiontype package versiontype import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L100-L116 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L111-L127 type VersionType struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/waitforevents/waitforevents.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/waitforevents/waitforevents.go index 4bacebd32..91f7d697a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/waitforevents/waitforevents.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/waitforevents/waitforevents.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package waitforevents package waitforevents import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L311-L318 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L322-L329 type WaitForEvents struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/watcherstate/watcherstate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/watcherstate/watcherstate.go index 8ef06a2bb..015a70590 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/watcherstate/watcherstate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/watcherstate/watcherstate.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package watcherstate package watcherstate import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/stats/types.ts#L26-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/stats/types.ts#L26-L31 type WatcherState struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/zerotermsquery/zerotermsquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/zerotermsquery/zerotermsquery.go index 7010a3963..254375e57 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/zerotermsquery/zerotermsquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/zerotermsquery/zerotermsquery.go @@ -16,14 +16,14 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Package zerotermsquery package zerotermsquery import "strings" -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/fulltext.ts#L569-L578 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/fulltext.ts#L569-L578 type ZeroTermsQuery struct { Name string } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/epochtimeunitmillis.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/epochtimeunitmillis.go index 996cddb4e..aba582c3d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/epochtimeunitmillis.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/epochtimeunitmillis.go @@ -16,11 +16,11 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // EpochTimeUnitMillis type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Time.ts#L40-L40 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Time.ts#L40-L40 type EpochTimeUnitMillis int64 diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/epochtimeunitseconds.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/epochtimeunitseconds.go index 54bf301ec..a9dff35f5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/epochtimeunitseconds.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/epochtimeunitseconds.go @@ -16,11 +16,11 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // EpochTimeUnitSeconds type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Time.ts#L40-L40 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Time.ts#L40-L40 type EpochTimeUnitSeconds int64 diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/eql.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/eql.go index 12305fea9..89c7e92e3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/eql.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/eql.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Eql type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L351-L354 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L351-L354 type Eql struct { Available bool `json:"available"` Enabled bool `json:"enabled"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/eqlfeatures.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/eqlfeatures.go index ba5607917..6b5835261 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/eqlfeatures.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/eqlfeatures.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // EqlFeatures type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L99-L107 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L99-L107 type EqlFeatures struct { Event uint `json:"event"` Join uint `json:"join"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/eqlfeaturesjoin.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/eqlfeaturesjoin.go index e17cd2d8c..5ba3930a7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/eqlfeaturesjoin.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/eqlfeaturesjoin.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // EqlFeaturesJoin type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L109-L115 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L109-L115 type EqlFeaturesJoin struct { JoinQueriesFiveOrMore uint `json:"join_queries_five_or_more"` JoinQueriesFour uint `json:"join_queries_four"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/eqlfeatureskeys.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/eqlfeatureskeys.go index 74ec2d2b6..2a0602a61 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/eqlfeatureskeys.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/eqlfeatureskeys.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // EqlFeaturesKeys type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L117-L123 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L117-L123 type EqlFeaturesKeys struct { JoinKeysFiveOrMore uint `json:"join_keys_five_or_more"` JoinKeysFour uint `json:"join_keys_four"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/eqlfeaturespipes.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/eqlfeaturespipes.go index beb0cb86f..f68ef96fd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/eqlfeaturespipes.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/eqlfeaturespipes.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // EqlFeaturesPipes type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L125-L128 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L125-L128 type EqlFeaturesPipes struct { PipeHead uint `json:"pipe_head"` PipeTail uint `json:"pipe_tail"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/eqlfeaturessequences.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/eqlfeaturessequences.go index 400e3b2fb..89a21de67 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/eqlfeaturessequences.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/eqlfeaturessequences.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // EqlFeaturesSequences type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L130-L137 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L130-L137 type EqlFeaturesSequences struct { SequenceMaxspan uint `json:"sequence_maxspan"` SequenceQueriesFiveOrMore uint `json:"sequence_queries_five_or_more"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/eqlhits.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/eqlhits.go index e2d80901f..356494ea9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/eqlhits.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/eqlhits.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // EqlHits type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/eql/_types/EqlHits.ts#L25-L39 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/eql/_types/EqlHits.ts#L25-L39 type EqlHits struct { // Events Contains events matching the query. Each object represents a matching event. Events []HitsEvent `json:"events,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/errorcause.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/errorcause.go index e7dd1e37b..a93f32b54 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/errorcause.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/errorcause.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // ErrorCause type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Errors.ts#L25-L48 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Errors.ts#L25-L48 type ErrorCause struct { CausedBy *ErrorCause `json:"caused_by,omitempty"` Metadata map[string]json.RawMessage `json:"-"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/errorresponsebase.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/errorresponsebase.go new file mode 100644 index 000000000..ddd725815 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/errorresponsebase.go @@ -0,0 +1,85 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated from the elasticsearch-specification DO NOT EDIT. +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c + +package types + +import ( + "bytes" + "encoding/json" + "errors" + "io" + "strconv" +) + +// ErrorResponseBase type. +// +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Base.ts#L66-L75 +type ErrorResponseBase struct { + Error ErrorCause `json:"error"` + Status int `json:"status"` +} + +func (s *ErrorResponseBase) UnmarshalJSON(data []byte) error { + + dec := json.NewDecoder(bytes.NewReader(data)) + + for { + t, err := dec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "error": + if err := dec.Decode(&s.Error); err != nil { + return err + } + + case "status": + + var tmp interface{} + dec.Decode(&tmp) + switch v := tmp.(type) { + case string: + value, err := strconv.Atoi(v) + if err != nil { + return err + } + s.Status = value + case float64: + f := int(v) + s.Status = f + } + + } + } + return nil +} + +// NewErrorResponseBase returns a ErrorResponseBase. +func NewErrorResponseBase() *ErrorResponseBase { + r := &ErrorResponseBase{} + + return r +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/esqlcolumns.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/esqlcolumns.go new file mode 100644 index 000000000..81d4fb879 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/esqlcolumns.go @@ -0,0 +1,26 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated from the elasticsearch-specification DO NOT EDIT. +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c + +package types + +// EsqlColumns type alias. +// +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Binary.ts#L24-L24 +type EsqlColumns []byte diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/eventdatastream.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/eventdatastream.go index d7084a444..3607d6e5c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/eventdatastream.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/eventdatastream.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // EventDataStream type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/search_application/_types/BehavioralAnalytics.ts#L29-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/search_application/_types/BehavioralAnalytics.ts#L29-L31 type EventDataStream struct { Name string `json:"name"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ewmamodelsettings.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ewmamodelsettings.go index edc7ea1e9..82cd5d745 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ewmamodelsettings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ewmamodelsettings.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // EwmaModelSettings type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L267-L269 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L267-L269 type EwmaModelSettings struct { Alpha *float32 `json:"alpha,omitempty"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ewmamovingaverageaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ewmamovingaverageaggregation.go index 42764227d..968930152 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ewmamovingaverageaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ewmamovingaverageaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // EwmaMovingAverageAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L252-L255 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L252-L255 type EwmaMovingAverageAggregation struct { // BucketsPath Path to the buckets that contain one set of values to correlate. BucketsPath BucketsPath `json:"buckets_path,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/executeenrichpolicystatus.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/executeenrichpolicystatus.go index 6efcfa6ec..72ab49f04 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/executeenrichpolicystatus.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/executeenrichpolicystatus.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,7 +26,7 @@ import ( // ExecuteEnrichPolicyStatus type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/enrich/execute_policy/types.ts#L20-L22 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/enrich/execute_policy/types.ts#L20-L22 type ExecuteEnrichPolicyStatus struct { Phase enrichpolicyphase.EnrichPolicyPhase `json:"phase"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/executingpolicy.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/executingpolicy.go index 26575f28c..4f773a145 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/executingpolicy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/executingpolicy.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // ExecutingPolicy type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/enrich/stats/types.ts#L24-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/enrich/stats/types.ts#L24-L27 type ExecutingPolicy struct { Name string `json:"name"` Task TaskInfo `json:"task"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/executionresult.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/executionresult.go index 1d4c806a9..884d5199e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/executionresult.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/executionresult.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // ExecutionResult type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Execution.ts#L60-L66 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Execution.ts#L60-L66 type ExecutionResult struct { Actions []ExecutionResultAction `json:"actions"` Condition ExecutionResultCondition `json:"condition"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/executionresultaction.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/executionresultaction.go index ce6eac866..6e397afd0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/executionresultaction.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/executionresultaction.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -33,7 +33,7 @@ import ( // ExecutionResultAction type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Execution.ts#L74-L86 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Execution.ts#L74-L86 type ExecutionResultAction struct { Email *EmailResult `json:"email,omitempty"` Error *ErrorCause `json:"error,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/executionresultcondition.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/executionresultcondition.go index 6dc6942d0..5fbf3fef9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/executionresultcondition.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/executionresultcondition.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -33,7 +33,7 @@ import ( // ExecutionResultCondition type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Execution.ts#L68-L72 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Execution.ts#L68-L72 type ExecutionResultCondition struct { Met bool `json:"met"` Status actionstatusoptions.ActionStatusOptions `json:"status"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/executionresultinput.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/executionresultinput.go index 5ac34da56..7ee8b1981 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/executionresultinput.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/executionresultinput.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // ExecutionResultInput type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Execution.ts#L88-L92 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Execution.ts#L88-L92 type ExecutionResultInput struct { Payload map[string]json.RawMessage `json:"payload"` Status actionstatusoptions.ActionStatusOptions `json:"status"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/executionstate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/executionstate.go index 71b5bbfc5..adf741157 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/executionstate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/executionstate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ExecutionState type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Action.ts#L120-L124 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Action.ts#L120-L124 type ExecutionState struct { Reason *string `json:"reason,omitempty"` Successful bool `json:"successful"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/executionthreadpool.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/executionthreadpool.go index 4db2bfde3..5abea1ed2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/executionthreadpool.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/executionthreadpool.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ExecutionThreadPool type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Execution.ts#L94-L97 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Execution.ts#L94-L97 type ExecutionThreadPool struct { MaxSize int64 `json:"max_size"` QueueSize int64 `json:"queue_size"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/existsquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/existsquery.go index 449fce4a8..91834c142 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/existsquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/existsquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ExistsQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/term.ts#L36-L41 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/term.ts#L36-L41 type ExistsQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/expandwildcards.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/expandwildcards.go index 69ed7e2bf..a532626cf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/expandwildcards.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/expandwildcards.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,5 +26,5 @@ import ( // ExpandWildcards type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L217-L217 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L228-L228 type ExpandWildcards []expandwildcard.ExpandWildcard diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/explainanalyzetoken.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/explainanalyzetoken.go index 48bed86c6..cb4002707 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/explainanalyzetoken.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/explainanalyzetoken.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // ExplainAnalyzeToken type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/analyze/types.ts#L52-L64 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/analyze/types.ts#L52-L64 type ExplainAnalyzeToken struct { Bytes string `json:"bytes"` EndOffset int64 `json:"end_offset"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/explanation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/explanation.go index e16a74925..35872c091 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/explanation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/explanation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Explanation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/explain/types.ts#L22-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/explain/types.ts#L22-L26 type Explanation struct { Description string `json:"description"` Details []ExplanationDetail `json:"details"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/explanationdetail.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/explanationdetail.go index 713a191fc..883e40ba7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/explanationdetail.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/explanationdetail.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ExplanationDetail type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/explain/types.ts#L28-L32 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/explain/types.ts#L28-L32 type ExplanationDetail struct { Description string `json:"description"` Details []ExplanationDetail `json:"details,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/explorecontrols.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/explorecontrols.go index 8480b7ad1..0c6729c6f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/explorecontrols.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/explorecontrols.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ExploreControls type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/graph/_types/ExploreControls.ts#L24-L49 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/graph/_types/ExploreControls.ts#L24-L49 type ExploreControls struct { // SampleDiversity To avoid the top-matching documents sample being dominated by a single source // of results, it is sometimes necessary to request diversity in the sample. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/extendedboundsdouble.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/extendedboundsdouble.go index 95c59c742..1279e893f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/extendedboundsdouble.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/extendedboundsdouble.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ExtendedBoundsdouble type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L489-L498 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L489-L498 type ExtendedBoundsdouble struct { // Max Maximum value for the bound. Max Float64 `json:"max"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/extendedboundsfielddatemath.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/extendedboundsfielddatemath.go index b74305b37..d3da4d213 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/extendedboundsfielddatemath.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/extendedboundsfielddatemath.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // ExtendedBoundsFieldDateMath type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L489-L498 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L489-L498 type ExtendedBoundsFieldDateMath struct { // Max Maximum value for the bound. Max FieldDateMath `json:"max"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/extendedmemorystats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/extendedmemorystats.go index fa5f40d00..7e8a3fc32 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/extendedmemorystats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/extendedmemorystats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ExtendedMemoryStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L622-L631 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L622-L631 type ExtendedMemoryStats struct { // AdjustedTotalInBytes If the amount of physical memory has been overridden using the // `es`.`total_memory_bytes` system property then this reports the overridden diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/extendedstatsaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/extendedstatsaggregate.go index 87c1b19f1..ef05fd9e9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/extendedstatsaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/extendedstatsaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ExtendedStatsAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L278-L296 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L278-L296 type ExtendedStatsAggregate struct { Avg Float64 `json:"avg,omitempty"` AvgAsString *string `json:"avg_as_string,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/extendedstatsaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/extendedstatsaggregation.go index ecd62fa91..8d20e7aaf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/extendedstatsaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/extendedstatsaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ExtendedStatsAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L101-L106 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L101-L106 type ExtendedStatsAggregation struct { // Field The field on which to run the aggregation. Field *string `json:"field,omitempty"` @@ -81,9 +81,40 @@ func (s *ExtendedStatsAggregation) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } case "sigma": var tmp interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/extendedstatsbucketaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/extendedstatsbucketaggregate.go index c4c245e3a..a93869893 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/extendedstatsbucketaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/extendedstatsbucketaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ExtendedStatsBucketAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L298-L299 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L298-L299 type ExtendedStatsBucketAggregate struct { Avg Float64 `json:"avg,omitempty"` AvgAsString *string `json:"avg_as_string,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/extendedstatsbucketaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/extendedstatsbucketaggregation.go index 8eefe18a0..33e35d97c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/extendedstatsbucketaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/extendedstatsbucketaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // ExtendedStatsBucketAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L198-L203 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L198-L203 type ExtendedStatsBucketAggregation struct { // BucketsPath Path to the buckets that contain one set of values to correlate. BucketsPath BucketsPath `json:"buckets_path,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/failprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/failprocessor.go index 802fb94fe..cc14d67a5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/failprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/failprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FailProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L637-L643 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L637-L643 type FailProcessor struct { // Description Description of the processor. // Useful for describing the purpose of the processor or its configuration. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/feature.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/feature.go index 9b5b2d8f4..7fd598c0d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/feature.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/feature.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Feature type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/features/_types/Feature.ts#L20-L23 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/features/_types/Feature.ts#L20-L23 type Feature struct { Description string `json:"description"` Name string `json:"name"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/features.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/features.go index e3c7b811f..9a3db346e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/features.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/features.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,5 +26,5 @@ import ( // Features type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/get/IndicesGetRequest.ts#L95-L95 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/get/IndicesGetRequest.ts#L95-L95 type Features []feature.Feature diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/featuretoggle.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/featuretoggle.go index c6e8f558e..0ba6259f6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/featuretoggle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/featuretoggle.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FeatureToggle type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L40-L42 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L40-L42 type FeatureToggle struct { Enabled bool `json:"enabled"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fetchprofile.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fetchprofile.go index e85a33481..c58d524a8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fetchprofile.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fetchprofile.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FetchProfile type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/profile.ts#L139-L146 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/profile.ts#L139-L146 type FetchProfile struct { Breakdown FetchProfileBreakdown `json:"breakdown"` Children []FetchProfile `json:"children,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fetchprofilebreakdown.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fetchprofilebreakdown.go index 819591d23..39d02e1b9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fetchprofilebreakdown.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fetchprofilebreakdown.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FetchProfileBreakdown type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/profile.ts#L148-L157 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/profile.ts#L148-L157 type FetchProfileBreakdown struct { LoadSource *int `json:"load_source,omitempty"` LoadSourceCount *int `json:"load_source_count,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fetchprofiledebug.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fetchprofiledebug.go index 765c37f49..ab44775b3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fetchprofiledebug.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fetchprofiledebug.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FetchProfileDebug type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/profile.ts#L159-L162 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/profile.ts#L159-L162 type FetchProfileDebug struct { FastPath *int `json:"fast_path,omitempty"` StoredFields []string `json:"stored_fields,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldaliasproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldaliasproperty.go index 033de996d..aab47b6d4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldaliasproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldaliasproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // FieldAliasProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/specialized.ts#L49-L52 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/specialized.ts#L49-L52 type FieldAliasProperty struct { Dynamic *dynamicmapping.DynamicMapping `json:"dynamic,omitempty"` Fields map[string]Property `json:"fields,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldandformat.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldandformat.go index 092cdc65f..fcf7603fc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldandformat.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldandformat.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FieldAndFormat type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/abstractions.ts#L489-L503 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/abstractions.ts#L489-L503 type FieldAndFormat struct { // Field Wildcard pattern. The request returns values for field names matching this // pattern. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldcapability.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldcapability.go index 6015ef6e8..2b31a1f81 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldcapability.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldcapability.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // FieldCapability type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/field_caps/types.ts#L23-L81 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/field_caps/types.ts#L23-L81 type FieldCapability struct { // Aggregatable Whether this field can be aggregated on all indices. Aggregatable bool `json:"aggregatable"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldcollapse.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldcollapse.go index 04f7f9c68..357767d13 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldcollapse.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldcollapse.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FieldCollapse type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/FieldCollapse.ts#L24-L38 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/FieldCollapse.ts#L24-L38 type FieldCollapse struct { Collapse *FieldCollapse `json:"collapse,omitempty"` // Field The field to collapse the result set on diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fielddatafrequencyfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fielddatafrequencyfilter.go index b45471531..cbe8c204a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fielddatafrequencyfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fielddatafrequencyfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FielddataFrequencyFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/FielddataFrequencyFilter.ts#L22-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/FielddataFrequencyFilter.ts#L22-L26 type FielddataFrequencyFilter struct { Max Float64 `json:"max"` Min Float64 `json:"min"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fielddatarecord.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fielddatarecord.go index 5a3c8b554..8a95dc94e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fielddatarecord.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fielddatarecord.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FielddataRecord type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/fielddata/types.ts#L20-L48 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/fielddata/types.ts#L20-L48 type FielddataRecord struct { // Field field name Field *string `json:"field,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fielddatastats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fielddatastats.go index d5abb9134..b1e271d86 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fielddatastats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fielddatastats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FielddataStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Stats.ts#L111-L116 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Stats.ts#L111-L116 type FielddataStats struct { Evictions *int64 `json:"evictions,omitempty"` Fields map[string]FieldMemoryUsage `json:"fields,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fielddatemath.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fielddatemath.go index b4ffb16b9..324e60d7d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fielddatemath.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fielddatemath.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // string // Float64 // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L296-L303 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L296-L303 type FieldDateMath interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldlookup.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldlookup.go index 8d652316d..2c485f9d5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldlookup.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldlookup.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // FieldLookup type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/abstractions.ts#L393-L410 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/abstractions.ts#L393-L410 type FieldLookup struct { // Id `id` of the document. Id string `json:"id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldmapping.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldmapping.go index 68cab86e8..b4d76d9a8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldmapping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldmapping.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FieldMapping type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/meta-fields.ts#L24-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/meta-fields.ts#L24-L27 type FieldMapping struct { FullName string `json:"full_name"` Mapping map[string]Property `json:"mapping"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldmemoryusage.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldmemoryusage.go index 74af13680..6a04f780a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldmemoryusage.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldmemoryusage.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FieldMemoryUsage type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Stats.ts#L118-L121 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Stats.ts#L118-L121 type FieldMemoryUsage struct { MemorySize ByteSize `json:"memory_size,omitempty"` MemorySizeInBytes int64 `json:"memory_size_in_bytes"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldmetric.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldmetric.go index 0a2270721..4265849c4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldmetric.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldmetric.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // FieldMetric type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/rollup/_types/Metric.ts#L30-L35 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/rollup/_types/Metric.ts#L30-L35 type FieldMetric struct { // Field The field to collect metrics for. This must be a numeric of some kind. Field string `json:"field"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldnamesfield.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldnamesfield.go index d8b00194f..c52ddb588 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldnamesfield.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldnamesfield.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FieldNamesField type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/meta-fields.ts#L42-L44 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/meta-fields.ts#L42-L44 type FieldNamesField struct { Enabled bool `json:"enabled"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldrule.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldrule.go index 25ea2f556..aff7c5c67 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldrule.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldrule.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // FieldRule type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/_types/RoleMappingRule.ts#L33-L42 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/_types/RoleMappingRule.ts#L33-L42 type FieldRule struct { Dn []string `json:"dn,omitempty"` Groups []string `json:"groups,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fields.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fields.go index 2a22927a8..3fbc5a03b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fields.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fields.go @@ -16,11 +16,11 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // Fields type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L134-L134 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L145-L145 type Fields []string diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldsecurity.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldsecurity.go index 0b67eec43..ce7e5648f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldsecurity.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldsecurity.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // FieldSecurity type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/_types/FieldSecurity.ts#L22-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/_types/FieldSecurity.ts#L22-L25 type FieldSecurity struct { Except []string `json:"except,omitempty"` Grant []string `json:"grant,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldsizeusage.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldsizeusage.go index 3fb914733..a0b9074e3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldsizeusage.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldsizeusage.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FieldSizeUsage type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Stats.ts#L92-L95 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Stats.ts#L92-L95 type FieldSizeUsage struct { Size ByteSize `json:"size,omitempty"` SizeInBytes int64 `json:"size_in_bytes"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldsort.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldsort.go index b9b36d8d9..24cd62a62 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldsort.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldsort.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -35,7 +35,7 @@ import ( // FieldSort type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/sort.ts#L44-L53 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/sort.ts#L44-L53 type FieldSort struct { Format *string `json:"format,omitempty"` Missing Missing `json:"missing,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldstat.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldstat.go index 9eca4dfb4..29f55e87d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldstat.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldstat.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FieldStat type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/text_structure/find_structure/types.ts#L23-L33 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/text_structure/find_structure/types.ts#L23-L33 type FieldStat struct { Cardinality int `json:"cardinality"` Count int `json:"count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldstatistics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldstatistics.go index 967a693d4..dc5bfd689 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldstatistics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldstatistics.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FieldStatistics type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/termvectors/types.ts#L28-L32 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/termvectors/types.ts#L28-L32 type FieldStatistics struct { DocCount int `json:"doc_count"` SumDocFreq int64 `json:"sum_doc_freq"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldsuggester.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldsuggester.go index bf750538b..6ece2c6f6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldsuggester.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldsuggester.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FieldSuggester type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/suggester.ts#L106-L139 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/suggester.ts#L106-L139 type FieldSuggester struct { // Completion Provides auto-complete/search-as-you-type functionality. Completion *CompletionSuggester `json:"completion,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldsummary.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldsummary.go index 9ad3ed990..7b7c1bf4e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldsummary.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldsummary.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // FieldSummary type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/field_usage_stats/IndicesFieldUsageStatsResponse.ts#L54-L63 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/field_usage_stats/IndicesFieldUsageStatsResponse.ts#L54-L63 type FieldSummary struct { Any uint `json:"any"` DocValues uint `json:"doc_values"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldsusagebody.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldsusagebody.go index b58647387..d91114af6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldsusagebody.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldsusagebody.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -27,7 +27,7 @@ import ( // FieldsUsageBody type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/field_usage_stats/IndicesFieldUsageStatsResponse.ts#L32-L36 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/field_usage_stats/IndicesFieldUsageStatsResponse.ts#L32-L36 type FieldsUsageBody struct { FieldsUsageBody map[string]UsageStatsIndex `json:"-"` Shards_ ShardStatistics `json:"_shards"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldtypes.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldtypes.go index 072147963..c17b27488 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldtypes.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldtypes.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FieldTypes type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/stats/types.ts#L136-L167 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/stats/types.ts#L136-L167 type FieldTypes struct { // Count The number of occurrences of the field type in selected nodes. Count int `json:"count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldtypesmappings.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldtypesmappings.go index bb06875fb..8b1d3898e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldtypesmappings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldtypesmappings.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FieldTypesMappings type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/stats/types.ts#L109-L134 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/stats/types.ts#L109-L134 type FieldTypesMappings struct { // FieldTypes Contains statistics about field data types used in selected nodes. FieldTypes []FieldTypes `json:"field_types"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldvalue.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldvalue.go index 0dd961d77..125c899f7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldvalue.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldvalue.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,5 +29,5 @@ package types // nil // json.RawMessage // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L25-L37 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L25-L37 type FieldValue interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldvaluefactorscorefunction.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldvaluefactorscorefunction.go index c6d926042..a9a78ea95 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldvaluefactorscorefunction.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fieldvaluefactorscorefunction.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // FieldValueFactorScoreFunction type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/compound.ts#L132-L151 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/compound.ts#L132-L151 type FieldValueFactorScoreFunction struct { // Factor Optional factor to multiply the field value with. Factor *Float64 `json:"factor,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filecountsnapshotstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filecountsnapshotstats.go index e028e81e4..2e5a90459 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filecountsnapshotstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filecountsnapshotstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FileCountSnapshotStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/_types/FileCountSnapshotStats.ts#L22-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/_types/FileCountSnapshotStats.ts#L22-L25 type FileCountSnapshotStats struct { FileCount int `json:"file_count"` SizeInBytes int64 `json:"size_in_bytes"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filedetails.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filedetails.go index 6e84928d9..cebcc35b4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filedetails.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filedetails.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FileDetails type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/recovery/types.ts#L50-L54 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/recovery/types.ts#L50-L54 type FileDetails struct { Length int64 `json:"length"` Name string `json:"name"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filesystem.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filesystem.go index 384d609be..877aba0d4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filesystem.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filesystem.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FileSystem type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L698-L716 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L698-L716 type FileSystem struct { // Data List of all file stores. Data []DataPathStats `json:"data,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filesystemtotal.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filesystemtotal.go index 7f679e548..d1bff26a1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filesystemtotal.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filesystemtotal.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FileSystemTotal type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L757-L786 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L757-L786 type FileSystemTotal struct { // Available Total disk space available to this Java virtual machine on all file stores. // Depending on OS or process level restrictions, this might appear less than diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fillmaskinferenceoptions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fillmaskinferenceoptions.go index 3da421b81..0525e2a45 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fillmaskinferenceoptions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fillmaskinferenceoptions.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FillMaskInferenceOptions type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/inference.ts#L266-L280 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/inference.ts#L266-L280 type FillMaskInferenceOptions struct { // MaskToken The string/token which will be removed from incoming documents and replaced // with the inference prediction(s). diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fillmaskinferenceupdateoptions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fillmaskinferenceupdateoptions.go index 236c0c689..1c81e75bd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fillmaskinferenceupdateoptions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fillmaskinferenceupdateoptions.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FillMaskInferenceUpdateOptions type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/inference.ts#L411-L418 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/inference.ts#L411-L418 type FillMaskInferenceUpdateOptions struct { // NumTopClasses Specifies the number of top class predictions to return. Defaults to 0. NumTopClasses *int `json:"num_top_classes,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filteraggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filteraggregate.go index 69607e412..84235ac27 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filteraggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filteraggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // FilterAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L495-L496 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L495-L496 type FilterAggregate struct { Aggregations map[string]Aggregate `json:"-"` DocCount int64 `json:"doc_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filterref.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filterref.go index 2b7861e10..1ae839292 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filterref.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filterref.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // FilterRef type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Filter.ts#L31-L41 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Filter.ts#L31-L41 type FilterRef struct { // FilterId The identifier for the filter. FilterId string `json:"filter_id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filtersaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filtersaggregate.go index 5f57b18b6..c9f92907f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filtersaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filtersaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // FiltersAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L568-L569 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L568-L569 type FiltersAggregate struct { Buckets BucketsFiltersBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filtersaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filtersaggregation.go index d2f1254a9..ac8446a97 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filtersaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filtersaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FiltersAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L358-L378 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L358-L378 type FiltersAggregation struct { // Filters Collection of queries from which to build buckets. Filters BucketsQuery `json:"filters,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filtersbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filtersbucket.go index a6bb24e04..6a87f0fed 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filtersbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/filtersbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // FiltersBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L571-L571 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L571-L571 type FiltersBucket struct { Aggregations map[string]Aggregate `json:"-"` DocCount int64 `json:"doc_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fingerprintanalyzer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fingerprintanalyzer.go index 4662e58c4..28ce6c7df 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fingerprintanalyzer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fingerprintanalyzer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FingerprintAnalyzer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/analyzers.ts#L37-L45 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/analyzers.ts#L37-L45 type FingerprintAnalyzer struct { MaxOutputSize int `json:"max_output_size"` PreserveOriginal bool `json:"preserve_original"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fingerprinttokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fingerprinttokenfilter.go index eb06f6221..befb14252 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fingerprinttokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fingerprinttokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FingerprintTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L194-L198 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L194-L198 type FingerprintTokenFilter struct { MaxOutputSize *int `json:"max_output_size,omitempty"` Separator *string `json:"separator,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/flattened.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/flattened.go index 5b580a90e..517f39a95 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/flattened.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/flattened.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Flattened type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L356-L358 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L356-L358 type Flattened struct { Available bool `json:"available"` Enabled bool `json:"enabled"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/flattenedproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/flattenedproperty.go index beb25c7d0..a26e4b63a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/flattenedproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/flattenedproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -33,7 +33,7 @@ import ( // FlattenedProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/complex.ts#L26-L37 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/complex.ts#L26-L37 type FlattenedProperty struct { Boost *Float64 `json:"boost,omitempty"` DepthLimit *int `json:"depth_limit,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/floatnumberproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/floatnumberproperty.go index df4b3cf73..5ecc7f117 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/floatnumberproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/floatnumberproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -34,7 +34,7 @@ import ( // FloatNumberProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/core.ts#L134-L137 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/core.ts#L134-L137 type FloatNumberProperty struct { Boost *Float64 `json:"boost,omitempty"` Coerce *bool `json:"coerce,omitempty"` @@ -830,9 +830,40 @@ func (s *FloatNumberProperty) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } case "similarity": var tmp json.RawMessage diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/floatrangeproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/floatrangeproperty.go index 8783638f8..d4e3df3af 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/floatrangeproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/floatrangeproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // FloatRangeProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/range.ts#L38-L40 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/range.ts#L38-L40 type FloatRangeProperty struct { Boost *Float64 `json:"boost,omitempty"` Coerce *bool `json:"coerce,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/flushstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/flushstats.go index 333e614b0..9118e9c9c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/flushstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/flushstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FlushStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Stats.ts#L123-L128 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Stats.ts#L123-L128 type FlushStats struct { Periodic int64 `json:"periodic"` Total int64 `json:"total"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/followerindex.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/followerindex.go index 6b1864964..a3e8f5af9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/followerindex.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/followerindex.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // FollowerIndex type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ccr/follow_info/types.ts#L22-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ccr/follow_info/types.ts#L22-L28 type FollowerIndex struct { FollowerIndex string `json:"follower_index"` LeaderIndex string `json:"leader_index"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/followerindexparameters.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/followerindexparameters.go index 1155bd2fc..0d7d9f9f9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/followerindexparameters.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/followerindexparameters.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FollowerIndexParameters type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ccr/follow_info/types.ts#L38-L49 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ccr/follow_info/types.ts#L38-L49 type FollowerIndexParameters struct { MaxOutstandingReadRequests int `json:"max_outstanding_read_requests"` MaxOutstandingWriteRequests int `json:"max_outstanding_write_requests"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/followindexstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/followindexstats.go index 676ec26aa..eb9979343 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/followindexstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/followindexstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // FollowIndexStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ccr/_types/FollowIndexStats.ts#L30-L33 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ccr/_types/FollowIndexStats.ts#L30-L33 type FollowIndexStats struct { Index string `json:"index"` Shards []CcrShardStats `json:"shards"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/followstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/followstats.go index 3eab971ab..d93959b96 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/followstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/followstats.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // FollowStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ccr/stats/types.ts.ts#L41-L43 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ccr/stats/types.ts.ts#L41-L43 type FollowStats struct { Indices []FollowIndexStats `json:"indices"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/forcemergeconfiguration.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/forcemergeconfiguration.go index 632bb5db8..64afc8afe 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/forcemergeconfiguration.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/forcemergeconfiguration.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ForceMergeConfiguration type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ilm/_types/Phase.ts#L56-L58 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ilm/_types/Phase.ts#L56-L58 type ForceMergeConfiguration struct { MaxNumSegments int `json:"max_num_segments"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/forcemergeresponsebody.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/forcemergeresponsebody.go index 36f47e24e..b14f9ae2f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/forcemergeresponsebody.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/forcemergeresponsebody.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ForceMergeResponseBody type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/forcemerge/_types/response.ts#L22-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/forcemerge/_types/response.ts#L22-L28 type ForceMergeResponseBody struct { Shards_ ShardStatistics `json:"_shards"` // Task task contains a task id returned when wait_for_completion=false, diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/foreachprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/foreachprocessor.go index 84742e214..87307276b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/foreachprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/foreachprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ForeachProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L645-L659 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L645-L659 type ForeachProcessor struct { // Description Description of the processor. // Useful for describing the purpose of the processor or its configuration. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/formattablemetricaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/formattablemetricaggregation.go index 1043e5da7..8871ae6fd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/formattablemetricaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/formattablemetricaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FormattableMetricAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L51-L53 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L51-L53 type FormattableMetricAggregation struct { // Field The field on which to run the aggregation. Field *string `json:"field,omitempty"` @@ -79,9 +79,40 @@ func (s *FormattableMetricAggregation) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } } } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/foundstatus.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/foundstatus.go index 97df3801e..e6a04474d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/foundstatus.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/foundstatus.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FoundStatus type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/delete_privileges/types.ts#L20-L22 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/delete_privileges/types.ts#L20-L22 type FoundStatus struct { Found bool `json:"found"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/frequencyencodingpreprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/frequencyencodingpreprocessor.go index 01dfc70ab..9a52354c6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/frequencyencodingpreprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/frequencyencodingpreprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FrequencyEncodingPreprocessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/put_trained_model/types.ts#L38-L42 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/put_trained_model/types.ts#L38-L42 type FrequencyEncodingPreprocessor struct { FeatureName string `json:"feature_name"` Field string `json:"field"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/frequentitemsetsaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/frequentitemsetsaggregate.go index 147acc051..f65c167bf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/frequentitemsetsaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/frequentitemsetsaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // FrequentItemSetsAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L639-L640 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L639-L640 type FrequentItemSetsAggregate struct { Buckets BucketsFrequentItemSetsBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/frequentitemsetsaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/frequentitemsetsaggregation.go index 7ebb4d550..2718c5435 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/frequentitemsetsaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/frequentitemsetsaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FrequentItemSetsAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L1159-L1183 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L1159-L1183 type FrequentItemSetsAggregation struct { // Fields Fields to analyze. Fields []FrequentItemSetsField `json:"fields"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/frequentitemsetsbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/frequentitemsetsbucket.go index 7133c66d5..83193e443 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/frequentitemsetsbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/frequentitemsetsbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // FrequentItemSetsBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L642-L645 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L642-L645 type FrequentItemSetsBucket struct { Aggregations map[string]Aggregate `json:"-"` DocCount int64 `json:"doc_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/frequentitemsetsfield.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/frequentitemsetsfield.go index e141a5056..191de5b97 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/frequentitemsetsfield.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/frequentitemsetsfield.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // FrequentItemSetsField type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L1145-L1157 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L1145-L1157 type FrequentItemSetsField struct { // Exclude Values to exclude. // Can be regular expression strings or arrays of strings of exact terms. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/frozenindices.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/frozenindices.go index 759fd3d71..8dc1e7e67 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/frozenindices.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/frozenindices.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FrozenIndices type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L360-L362 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L360-L362 type FrozenIndices struct { Available bool `json:"available"` Enabled bool `json:"enabled"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/functionscore.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/functionscore.go index 8f878ef45..6c900d5c2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/functionscore.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/functionscore.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FunctionScore type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/compound.ts#L201-L241 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/compound.ts#L201-L241 type FunctionScore struct { // Exp Function that scores a document with a exponential decay, depending on the // distance of a numeric field value of the document from an origin. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/functionscorequery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/functionscorequery.go index 070992190..8aec027cc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/functionscorequery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/functionscorequery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -33,7 +33,7 @@ import ( // FunctionScoreQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/compound.ts#L92-L118 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/compound.ts#L92-L118 type FunctionScoreQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fuzziness.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fuzziness.go index ba478bf08..abd0d6f4b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fuzziness.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fuzziness.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // string // int // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L127-L128 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L138-L139 type Fuzziness interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fuzzyquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fuzzyquery.go index 5e205c19c..6b012d63f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fuzzyquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/fuzzyquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // FuzzyQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/term.ts#L43-L78 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/term.ts#L43-L78 type FuzzyQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/garbagecollector.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/garbagecollector.go index b5444594f..36ca482c0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/garbagecollector.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/garbagecollector.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // GarbageCollector type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L923-L928 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L923-L928 type GarbageCollector struct { // Collectors Contains statistics about JVM garbage collectors for the node. Collectors map[string]GarbageCollectorTotal `json:"collectors,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/garbagecollectortotal.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/garbagecollectortotal.go index 39a7a8312..5410bffae 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/garbagecollectortotal.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/garbagecollectortotal.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // GarbageCollectorTotal type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L930-L943 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L930-L943 type GarbageCollectorTotal struct { // CollectionCount Total number of JVM garbage collectors that collect objects. CollectionCount *int64 `json:"collection_count,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoboundingboxquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoboundingboxquery.go index 5cbc7f694..5dd5a3407 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoboundingboxquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoboundingboxquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -34,7 +34,7 @@ import ( // GeoBoundingBoxQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/geo.ts#L32-L50 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/geo.ts#L32-L50 type GeoBoundingBoxQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geobounds.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geobounds.go index c747b2808..2ba795277 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geobounds.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geobounds.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -27,5 +27,5 @@ package types // TopRightBottomLeftGeoBounds // WktGeoBounds // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Geo.ts#L144-L157 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Geo.ts#L144-L157 type GeoBounds interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoboundsaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoboundsaggregate.go index 806b100be..1bdc37183 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoboundsaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoboundsaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // GeoBoundsAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L303-L306 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L303-L306 type GeoBoundsAggregate struct { Bounds GeoBounds `json:"bounds,omitempty"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoboundsaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoboundsaggregation.go index 81aa9b47d..9074edbcd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoboundsaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoboundsaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // GeoBoundsAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L108-L114 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L108-L114 type GeoBoundsAggregation struct { // Field The field on which to run the aggregation. Field *string `json:"field,omitempty"` @@ -69,9 +69,40 @@ func (s *GeoBoundsAggregation) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } case "wrap_longitude": var tmp interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geocentroidaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geocentroidaggregate.go index 2c29d4f98..4d5cb3f9b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geocentroidaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geocentroidaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // GeoCentroidAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L308-L312 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L308-L312 type GeoCentroidAggregate struct { Count int64 `json:"count"` Location GeoLocation `json:"location,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geocentroidaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geocentroidaggregation.go index 854c17e52..e5e678457 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geocentroidaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geocentroidaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // GeoCentroidAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L116-L119 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L116-L119 type GeoCentroidAggregation struct { Count *int64 `json:"count,omitempty"` // Field The field on which to run the aggregation. @@ -88,9 +88,40 @@ func (s *GeoCentroidAggregation) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } } } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geodecayfunction.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geodecayfunction.go index 352a496ed..82e4391f8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geodecayfunction.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geodecayfunction.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // GeoDecayFunction type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/compound.ts#L190-L192 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/compound.ts#L190-L192 type GeoDecayFunction struct { GeoDecayFunction map[string]DecayPlacementGeoLocationDistance `json:"GeoDecayFunction,omitempty"` // MultiValueMode Determines how the distance is calculated when a field used for computing the diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geodistanceaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geodistanceaggregate.go index 5a6d2560f..74abf838c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geodistanceaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geodistanceaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // GeoDistanceAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L550-L554 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L550-L554 type GeoDistanceAggregate struct { Buckets BucketsRangeBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geodistanceaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geodistanceaggregation.go index b55ea8cc8..e94b89fe4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geodistanceaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geodistanceaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -33,7 +33,7 @@ import ( // GeoDistanceAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L380-L403 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L380-L403 type GeoDistanceAggregation struct { // DistanceType The distance calculation type. DistanceType *geodistancetype.GeoDistanceType `json:"distance_type,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geodistancefeaturequery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geodistancefeaturequery.go index c819398ba..e565231fc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geodistancefeaturequery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geodistancefeaturequery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // GeoDistanceFeatureQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/specialized.ts#L62-L65 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/specialized.ts#L62-L65 type GeoDistanceFeatureQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geodistancequery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geodistancequery.go index 3967a5b97..3029036df 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geodistancequery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geodistancequery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -34,7 +34,7 @@ import ( // GeoDistanceQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/geo.ts#L57-L79 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/geo.ts#L57-L79 type GeoDistanceQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geodistancesort.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geodistancesort.go index abacbaad8..7f92450fe 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geodistancesort.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geodistancesort.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -36,7 +36,7 @@ import ( // GeoDistanceSort type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/sort.ts#L58-L66 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/sort.ts#L58-L66 type GeoDistanceSort struct { DistanceType *geodistancetype.GeoDistanceType `json:"distance_type,omitempty"` GeoDistanceSort map[string][]GeoLocation `json:"GeoDistanceSort,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geohashgridaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geohashgridaggregate.go index c48455eb0..41af252c5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geohashgridaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geohashgridaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // GeoHashGridAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L506-L508 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L506-L508 type GeoHashGridAggregate struct { Buckets BucketsGeoHashGridBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geohashgridaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geohashgridaggregation.go index 1e5891786..fd66a29d4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geohashgridaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geohashgridaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // GeoHashGridAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L405-L430 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L405-L430 type GeoHashGridAggregation struct { // Bounds The bounding box to filter the points in each bucket. Bounds GeoBounds `json:"bounds,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geohashgridbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geohashgridbucket.go index b20d6c9b6..77fcce342 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geohashgridbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geohashgridbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // GeoHashGridBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L510-L512 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L510-L512 type GeoHashGridBucket struct { Aggregations map[string]Aggregate `json:"-"` DocCount int64 `json:"doc_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geohashlocation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geohashlocation.go index 1b0dd1980..eebbe80ed 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geohashlocation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geohashlocation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // GeoHashLocation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Geo.ts#L140-L142 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Geo.ts#L140-L142 type GeoHashLocation struct { Geohash string `json:"geohash"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geohashprecision.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geohashprecision.go index db047f8ae..c38b61b4b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geohashprecision.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geohashprecision.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // int // string // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Geo.ts#L95-L99 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Geo.ts#L95-L99 type GeoHashPrecision interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geohexgridaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geohexgridaggregate.go index eec095421..ca482c625 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geohexgridaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geohexgridaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // GeoHexGridAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L522-L523 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L522-L523 type GeoHexGridAggregate struct { Buckets BucketsGeoHexGridBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geohexgridaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geohexgridaggregation.go index f5c7d0b42..82d869d3d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geohexgridaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geohexgridaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // GeohexGridAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L460-L485 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L460-L485 type GeohexGridAggregation struct { // Bounds Bounding box used to filter the geo-points in each bucket. Bounds GeoBounds `json:"bounds,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geohexgridbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geohexgridbucket.go index 6c48de81b..bb0b94fa8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geohexgridbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geohexgridbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // GeoHexGridBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L525-L527 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L525-L527 type GeoHexGridBucket struct { Aggregations map[string]Aggregate `json:"-"` DocCount int64 `json:"doc_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoipdownloadstatistics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoipdownloadstatistics.go index 2cb9288f6..d4ce5fb82 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoipdownloadstatistics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoipdownloadstatistics.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // GeoIpDownloadStatistics type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/geo_ip_stats/types.ts#L24-L35 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/geo_ip_stats/types.ts#L24-L35 type GeoIpDownloadStatistics struct { // DatabaseCount Current number of databases available for use. DatabaseCount int `json:"database_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoipnodedatabasename.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoipnodedatabasename.go index 833fcfa47..8b4256984 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoipnodedatabasename.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoipnodedatabasename.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // GeoIpNodeDatabaseName type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/geo_ip_stats/types.ts#L45-L48 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/geo_ip_stats/types.ts#L45-L48 type GeoIpNodeDatabaseName struct { // Name Name of the database. Name string `json:"name"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoipnodedatabases.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoipnodedatabases.go index 96b2a5dd6..4206f11d9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoipnodedatabases.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoipnodedatabases.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // GeoIpNodeDatabases type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/geo_ip_stats/types.ts#L37-L43 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/geo_ip_stats/types.ts#L37-L43 type GeoIpNodeDatabases struct { // Databases Downloaded databases for the node. Databases []GeoIpNodeDatabaseName `json:"databases"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoipprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoipprocessor.go index 29c00e3b0..576a7f892 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoipprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoipprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // GeoIpProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L328-L357 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L328-L357 type GeoIpProcessor struct { // DatabaseFile The database filename referring to a database the module ships with // (GeoLite2-City.mmdb, GeoLite2-Country.mmdb, or GeoLite2-ASN.mmdb) or a custom diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoline.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoline.go index 22c08754e..2e3a0ddcb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoline.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoline.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // GeoLine type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Geo.ts#L65-L71 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Geo.ts#L65-L71 type GeoLine struct { // Coordinates Array of `[lon, lat]` coordinates Coordinates [][]Float64 `json:"coordinates"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geolineaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geolineaggregate.go index 695a6a799..5e91df51c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geolineaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geolineaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // GeoLineAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L784-L791 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L784-L791 type GeoLineAggregate struct { Geometry GeoLine `json:"geometry"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geolineaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geolineaggregation.go index fd1deb46a..65ebeca81 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geolineaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geolineaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // GeoLineAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L121-L146 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L121-L146 type GeoLineAggregation struct { // IncludeSort When `true`, returns an additional array of the sort values in the feature // properties. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geolinepoint.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geolinepoint.go index 977b5d013..25fe1889a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geolinepoint.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geolinepoint.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // GeoLinePoint type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L155-L160 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L155-L160 type GeoLinePoint struct { // Field The name of the geo_point field. Field string `json:"field"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geolinesort.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geolinesort.go index 9b63a2a54..58a83f642 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geolinesort.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geolinesort.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // GeoLineSort type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L148-L153 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L148-L153 type GeoLineSort struct { // Field The name of the numeric field to use as the sort key for ordering the points. Field string `json:"field"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geolocation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geolocation.go index 8371fee53..f15feb533 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geolocation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geolocation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -27,5 +27,5 @@ package types // []Float64 // string // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Geo.ts#L113-L127 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Geo.ts#L113-L127 type GeoLocation interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geopointproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geopointproperty.go index 2dd90e21d..0c27c87f3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geopointproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geopointproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // GeoPointProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/geo.ts#L23-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/geo.ts#L23-L28 type GeoPointProperty struct { CopyTo []string `json:"copy_to,omitempty"` DocValues *bool `json:"doc_values,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geopolygonpoints.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geopolygonpoints.go index f9d348ab5..762d629ce 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geopolygonpoints.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geopolygonpoints.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // GeoPolygonPoints type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/geo.ts#L81-L83 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/geo.ts#L81-L83 type GeoPolygonPoints struct { Points []GeoLocation `json:"points"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geopolygonquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geopolygonquery.go index bc3d07bd4..71698ad78 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geopolygonquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geopolygonquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -33,7 +33,7 @@ import ( // GeoPolygonQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/geo.ts#L85-L93 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/geo.ts#L85-L93 type GeoPolygonQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/georesults.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/georesults.go index 4f41671ca..20a8cbf07 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/georesults.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/georesults.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // GeoResults type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Anomaly.ts#L145-L154 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Anomaly.ts#L145-L154 type GeoResults struct { // ActualPoint The actual value for the bucket formatted as a `geo_point`. ActualPoint string `json:"actual_point"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoshapefieldquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoshapefieldquery.go index 46f60a30a..c2099a1b0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoshapefieldquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoshapefieldquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // GeoShapeFieldQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/geo.ts#L100-L111 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/geo.ts#L100-L111 type GeoShapeFieldQuery struct { // IndexedShape Query using an indexed shape retrieved from the the specified document and // path. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoshapeproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoshapeproperty.go index 565f21557..7a6ac8932 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoshapeproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoshapeproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -34,7 +34,7 @@ import ( // GeoShapeProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/geo.ts#L37-L50 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/geo.ts#L37-L50 type GeoShapeProperty struct { Coerce *bool `json:"coerce,omitempty"` CopyTo []string `json:"copy_to,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoshapequery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoshapequery.go index 14c162888..a5bcc2fd8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoshapequery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geoshapequery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // GeoShapeQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/geo.ts#L115-L125 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/geo.ts#L115-L125 type GeoShapeQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geotilegridaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geotilegridaggregate.go index 4f5e9db43..0ed297851 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geotilegridaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geotilegridaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // GeoTileGridAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L514-L516 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L514-L516 type GeoTileGridAggregate struct { Buckets BucketsGeoTileGridBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geotilegridaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geotilegridaggregation.go index e80d9e2fe..e1007eaf6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geotilegridaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geotilegridaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // GeoTileGridAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L432-L458 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L432-L458 type GeoTileGridAggregation struct { // Bounds A bounding box to filter the geo-points or geo-shapes in each bucket. Bounds GeoBounds `json:"bounds,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geotilegridbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geotilegridbucket.go index cac23cf8b..fbb5bfb2c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geotilegridbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/geotilegridbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // GeoTileGridBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L518-L520 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L518-L520 type GeoTileGridBucket struct { Aggregations map[string]Aggregate `json:"-"` DocCount int64 `json:"doc_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/getmigrationfeature.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/getmigrationfeature.go index 5dd0b3f72..f4fd93966 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/getmigrationfeature.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/getmigrationfeature.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // GetMigrationFeature type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/migration/get_feature_upgrade_status/GetFeatureUpgradeStatusResponse.ts#L37-L42 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/migration/get_feature_upgrade_status/GetFeatureUpgradeStatusResponse.ts#L37-L42 type GetMigrationFeature struct { FeatureName string `json:"feature_name"` Indices []MigrationFeatureIndexInfo `json:"indices"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/getresult.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/getresult.go index f4e1fb5bc..66c9cdb66 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/getresult.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/getresult.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // GetResult type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/get/types.ts#L25-L35 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/get/types.ts#L25-L35 type GetResult struct { Fields map[string]json.RawMessage `json:"fields,omitempty"` Found bool `json:"found"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/getscriptcontext.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/getscriptcontext.go index 0d276895c..95a6d1ff5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/getscriptcontext.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/getscriptcontext.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // GetScriptContext type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/get_script_context/types.ts#L22-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/get_script_context/types.ts#L22-L25 type GetScriptContext struct { Methods []ContextMethod `json:"methods"` Name string `json:"name"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/getstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/getstats.go index 974f8fd0b..114a17bbd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/getstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/getstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // GetStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Stats.ts#L130-L141 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Stats.ts#L130-L141 type GetStats struct { Current int64 `json:"current"` ExistsTime Duration `json:"exists_time,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/getuserprofileerrors.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/getuserprofileerrors.go index 212a2eb20..70e1501a9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/getuserprofileerrors.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/getuserprofileerrors.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // GetUserProfileErrors type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/get_user_profile/types.ts#L25-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/get_user_profile/types.ts#L25-L28 type GetUserProfileErrors struct { Count int64 `json:"count"` Details map[string]ErrorCause `json:"details"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/globalaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/globalaggregate.go index 743bcb475..984afae3d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/globalaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/globalaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // GlobalAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L492-L493 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L492-L493 type GlobalAggregate struct { Aggregations map[string]Aggregate `json:"-"` DocCount int64 `json:"doc_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/globalaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/globalaggregation.go index 8aef19ac1..f3952aa05 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/globalaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/globalaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // GlobalAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L487-L487 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L487-L487 type GlobalAggregation struct { Meta Metadata `json:"meta,omitempty"` Name *string `json:"name,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/globalprivilege.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/globalprivilege.go index f8c1997e8..6160e4152 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/globalprivilege.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/globalprivilege.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // GlobalPrivilege type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/_types/Privileges.ts#L189-L191 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/_types/Privileges.ts#L189-L191 type GlobalPrivilege struct { Application ApplicationGlobalUserPrivileges `json:"application"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/googlenormalizeddistanceheuristic.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/googlenormalizeddistanceheuristic.go index eb0c47cbf..a1b8ed7bb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/googlenormalizeddistanceheuristic.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/googlenormalizeddistanceheuristic.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // GoogleNormalizedDistanceHeuristic type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L746-L751 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L746-L751 type GoogleNormalizedDistanceHeuristic struct { // BackgroundIsSuperset Set to `false` if you defined a custom background filter that represents a // different set of documents that you want to compare to. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/grantapikey.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/grantapikey.go index e2998e71c..02c897604 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/grantapikey.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/grantapikey.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // GrantApiKey type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/grant_api_key/types.ts#L25-L46 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/grant_api_key/types.ts#L25-L46 type GrantApiKey struct { // Expiration Expiration time for the API key. By default, API keys never expire. Expiration *string `json:"expiration,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/grokprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/grokprocessor.go index fe6d216b5..f62c7f2d9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/grokprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/grokprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // GrokProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L661-L686 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L661-L686 type GrokProcessor struct { // Description Description of the processor. // Useful for describing the purpose of the processor or its configuration. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/groupings.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/groupings.go index e4bd0805a..f27fe2a77 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/groupings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/groupings.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // Groupings type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/rollup/_types/Groupings.ts#L24-L40 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/rollup/_types/Groupings.ts#L24-L40 type Groupings struct { // DateHistogram A date histogram group aggregates a date field into time-based buckets. // This group is mandatory; you currently cannot roll up documents without a diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/gsubprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/gsubprocessor.go index 44087e7e6..f5b8368dd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/gsubprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/gsubprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // GsubProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L688-L712 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L688-L712 type GsubProcessor struct { // Description Description of the processor. // Useful for describing the purpose of the processor or its configuration. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/halffloatnumberproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/halffloatnumberproperty.go index 3d44f5f42..6055e4053 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/halffloatnumberproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/halffloatnumberproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -34,7 +34,7 @@ import ( // HalfFloatNumberProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/core.ts#L139-L142 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/core.ts#L139-L142 type HalfFloatNumberProperty struct { Boost *Float64 `json:"boost,omitempty"` Coerce *bool `json:"coerce,omitempty"` @@ -830,9 +830,40 @@ func (s *HalfFloatNumberProperty) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } case "similarity": var tmp json.RawMessage diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/haschildquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/haschildquery.go index 6f0c57e98..9f9a51fab 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/haschildquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/haschildquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // HasChildQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/joining.ts#L41-L76 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/joining.ts#L41-L76 type HasChildQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hasparentquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hasparentquery.go index c6ee7868f..5d47bf9b3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hasparentquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hasparentquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // HasParentQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/joining.ts#L78-L104 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/joining.ts#L78-L104 type HasParentQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hasprivilegesuserprofileerrors.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hasprivilegesuserprofileerrors.go index 82a71087d..7e660a1ab 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hasprivilegesuserprofileerrors.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hasprivilegesuserprofileerrors.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // HasPrivilegesUserProfileErrors type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/has_privileges_user_profile/types.ts#L39-L42 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/has_privileges_user_profile/types.ts#L39-L42 type HasPrivilegesUserProfileErrors struct { Count int64 `json:"count"` Details map[string]ErrorCause `json:"details"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hdrmethod.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hdrmethod.go index 107e8e8a1..a2c49b7f0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hdrmethod.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hdrmethod.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // HdrMethod type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L216-L221 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L216-L221 type HdrMethod struct { // NumberOfSignificantValueDigits Specifies the resolution of values for the histogram in number of significant // digits. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hdrpercentileranksaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hdrpercentileranksaggregate.go index 8461c60d6..fe9b83471 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hdrpercentileranksaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hdrpercentileranksaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // HdrPercentileRanksAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L169-L170 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L169-L170 type HdrPercentileRanksAggregate struct { Meta Metadata `json:"meta,omitempty"` Values Percentiles `json:"values"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hdrpercentilesaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hdrpercentilesaggregate.go index 46aae8498..2d8fc37b3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hdrpercentilesaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hdrpercentilesaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // HdrPercentilesAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L166-L167 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L166-L167 type HdrPercentilesAggregate struct { Meta Metadata `json:"meta,omitempty"` Values Percentiles `json:"values"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/healthrecord.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/healthrecord.go index 6f3e6c72d..c4b27a88a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/healthrecord.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/healthrecord.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // HealthRecord type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/health/types.ts#L23-L94 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/health/types.ts#L23-L94 type HealthRecord struct { // ActiveShardsPercent active number of shards in percent ActiveShardsPercent *string `json:"active_shards_percent,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/healthresponsebody.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/healthresponsebody.go index 81b1f5625..6e486fbf0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/healthresponsebody.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/healthresponsebody.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // HealthResponseBody type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/health/ClusterHealthResponse.ts#L39-L72 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/health/ClusterHealthResponse.ts#L39-L72 type HealthResponseBody struct { // ActivePrimaryShards The number of active primary shards. ActivePrimaryShards int `json:"active_primary_shards"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/healthstatistics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/healthstatistics.go index a4007abdd..130f8e131 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/healthstatistics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/healthstatistics.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // HealthStatistics type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L153-L155 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L153-L155 type HealthStatistics struct { Available bool `json:"available"` Enabled bool `json:"enabled"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/helprecord.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/helprecord.go index ea935e06b..bbddf567d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/helprecord.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/helprecord.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // HelpRecord type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/help/types.ts#L20-L22 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/help/types.ts#L20-L22 type HelpRecord struct { Endpoint string `json:"endpoint"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/highlight.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/highlight.go index dcdca0cb5..f6eb35333 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/highlight.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/highlight.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -37,7 +37,7 @@ import ( // Highlight type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/highlighting.ts#L153-L156 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/highlighting.ts#L153-L156 type Highlight struct { // BoundaryChars A string that contains each boundary character. BoundaryChars *string `json:"boundary_chars,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/highlightfield.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/highlightfield.go index 81bf2796f..4f51db832 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/highlightfield.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/highlightfield.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -36,7 +36,7 @@ import ( // HighlightField type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/highlighting.ts#L193-L197 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/highlighting.ts#L193-L197 type HighlightField struct { Analyzer Analyzer `json:"analyzer,omitempty"` // BoundaryChars A string that contains each boundary character. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hint.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hint.go index 82d0f2844..ce898c99b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hint.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hint.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // Hint type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/suggest_user_profiles/types.ts#L23-L34 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/suggest_user_profiles/types.ts#L23-L34 type Hint struct { // Labels A single key-value pair to match against the labels section // of a profile. A profile is considered matching if it matches diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/histogramaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/histogramaggregate.go index 0cca03e3e..f0d2dc2e1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/histogramaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/histogramaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // HistogramAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L340-L341 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L340-L341 type HistogramAggregate struct { Buckets BucketsHistogramBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/histogramaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/histogramaggregation.go index f6262f87a..de8d9f0ed 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/histogramaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/histogramaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // HistogramAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L500-L546 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L500-L546 type HistogramAggregation struct { // ExtendedBounds Enables extending the bounds of the histogram beyond the data itself. ExtendedBounds *ExtendedBoundsdouble `json:"extended_bounds,omitempty"` @@ -226,9 +226,40 @@ func (s *HistogramAggregation) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } } } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/histogrambucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/histogrambucket.go index a1664202d..4c798e166 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/histogrambucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/histogrambucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // HistogramBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L343-L346 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L343-L346 type HistogramBucket struct { Aggregations map[string]Aggregate `json:"-"` DocCount int64 `json:"doc_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/histogramgrouping.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/histogramgrouping.go index f9c697727..315e7cab5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/histogramgrouping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/histogramgrouping.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // HistogramGrouping type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/rollup/_types/Groupings.ts#L84-L97 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/rollup/_types/Groupings.ts#L84-L97 type HistogramGrouping struct { // Fields The set of fields that you wish to build histograms for. // All fields specified must be some kind of numeric. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/histogramproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/histogramproperty.go index 9454d5d6b..d7d70ef34 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/histogramproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/histogramproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // HistogramProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/specialized.ts#L54-L57 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/specialized.ts#L54-L57 type HistogramProperty struct { Dynamic *dynamicmapping.DynamicMapping `json:"dynamic,omitempty"` Fields map[string]Property `json:"fields,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hit.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hit.go index 6793c666a..de8bf10da 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hit.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hit.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Hit type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/hits.ts#L40-L64 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/hits.ts#L40-L64 type Hit struct { Explanation_ *Explanation `json:"_explanation,omitempty"` Fields map[string]json.RawMessage `json:"fields,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hitsevent.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hitsevent.go index 5b75fd695..3f68a95b7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hitsevent.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hitsevent.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // HitsEvent type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/eql/_types/EqlHits.ts#L41-L49 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/eql/_types/EqlHits.ts#L41-L49 type HitsEvent struct { Fields map[string][]json.RawMessage `json:"fields,omitempty"` // Id_ Unique identifier for the event. This ID is only unique within the index. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hitsmetadata.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hitsmetadata.go index 21b2f6fc4..c8eaf6de1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hitsmetadata.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hitsmetadata.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // HitsMetadata type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/hits.ts#L66-L72 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/hits.ts#L66-L72 type HitsMetadata struct { Hits []Hit `json:"hits"` MaxScore Float64 `json:"max_score,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hitssequence.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hitssequence.go index de516f632..1bc3d05ac 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hitssequence.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hitssequence.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,7 +26,7 @@ import ( // HitsSequence type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/eql/_types/EqlHits.ts#L51-L59 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/eql/_types/EqlHits.ts#L51-L59 type HitsSequence struct { // Events Contains events matching the query. Each object represents a matching event. Events []HitsEvent `json:"events"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/holtlinearmodelsettings.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/holtlinearmodelsettings.go index 89ca804e7..83fc38aaa 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/holtlinearmodelsettings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/holtlinearmodelsettings.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // HoltLinearModelSettings type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L271-L274 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L271-L274 type HoltLinearModelSettings struct { Alpha *float32 `json:"alpha,omitempty"` Beta *float32 `json:"beta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/holtmovingaverageaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/holtmovingaverageaggregation.go index 58b356b56..794ddd030 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/holtmovingaverageaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/holtmovingaverageaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // HoltMovingAverageAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L257-L260 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L257-L260 type HoltMovingAverageAggregation struct { // BucketsPath Path to the buckets that contain one set of values to correlate. BucketsPath BucketsPath `json:"buckets_path,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/holtwintersmodelsettings.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/holtwintersmodelsettings.go index b8930b317..681d1a80f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/holtwintersmodelsettings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/holtwintersmodelsettings.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // HoltWintersModelSettings type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L275-L282 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L275-L282 type HoltWintersModelSettings struct { Alpha *float32 `json:"alpha,omitempty"` Beta *float32 `json:"beta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/holtwintersmovingaverageaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/holtwintersmovingaverageaggregation.go index 853b200b8..32a425597 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/holtwintersmovingaverageaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/holtwintersmovingaverageaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // HoltWintersMovingAverageAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L262-L265 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L262-L265 type HoltWintersMovingAverageAggregation struct { // BucketsPath Path to the buckets that contain one set of values to correlate. BucketsPath BucketsPath `json:"buckets_path,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hop.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hop.go index ee61f06ad..8d6eb4ab3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hop.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hop.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // Hop type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/graph/_types/Hop.ts#L23-L36 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/graph/_types/Hop.ts#L23-L36 type Hop struct { // Connections Specifies one or more fields from which you want to extract terms that are // associated with the specified vertices. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hotthread.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hotthread.go index 753b2b76c..041456b47 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hotthread.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hotthread.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // HotThread type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/hot_threads/types.ts#L23-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/hot_threads/types.ts#L23-L28 type HotThread struct { Hosts []string `json:"hosts"` NodeId string `json:"node_id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hourandminute.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hourandminute.go index 3974d30de..42e9e0aee 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hourandminute.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hourandminute.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // HourAndMinute type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Schedule.ts#L110-L113 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Schedule.ts#L110-L113 type HourAndMinute struct { Hour []int `json:"hour"` Minute []int `json:"minute"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hourlyschedule.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hourlyschedule.go index 666cffad2..ced7a4b12 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hourlyschedule.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hourlyschedule.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // HourlySchedule type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Schedule.ts#L47-L49 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Schedule.ts#L47-L49 type HourlySchedule struct { Minute []int `json:"minute"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/htmlstripcharfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/htmlstripcharfilter.go index 61dafd688..866e400e4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/htmlstripcharfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/htmlstripcharfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // HtmlStripCharFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/char_filters.ts#L43-L45 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/char_filters.ts#L43-L45 type HtmlStripCharFilter struct { Type string `json:"type,omitempty"` Version *string `json:"version,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/http.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/http.go index 5f5e4f910..5fac5f9ba 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/http.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/http.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Http type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L633-L647 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L633-L647 type Http struct { // Clients Information on current and recently-closed HTTP client connections. // Clients that have been closed longer than the diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpemailattachment.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpemailattachment.go index 8b8954b05..132838b2a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpemailattachment.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpemailattachment.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // HttpEmailAttachment type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Actions.ts#L218-L222 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Actions.ts#L218-L222 type HttpEmailAttachment struct { ContentType *string `json:"content_type,omitempty"` Inline *bool `json:"inline,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpheaders.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpheaders.go index 49af7f9bc..1fbefa303 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpheaders.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpheaders.go @@ -16,11 +16,11 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // HttpHeaders type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L152-L152 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L163-L163 type HttpHeaders map[string][]string diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpinput.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpinput.go index dcd92cfd3..e15a4dc43 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpinput.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpinput.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,7 +26,7 @@ import ( // HttpInput type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Input.ts#L44-L48 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Input.ts#L44-L48 type HttpInput struct { Extract []string `json:"extract,omitempty"` Request *HttpInputRequestDefinition `json:"request,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpinputauthentication.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpinputauthentication.go index 5f31c30c8..c7214c21c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpinputauthentication.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpinputauthentication.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // HttpInputAuthentication type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Input.ts#L50-L52 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Input.ts#L50-L52 type HttpInputAuthentication struct { Basic HttpInputBasicAuthentication `json:"basic"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpinputbasicauthentication.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpinputbasicauthentication.go index fc693b457..4ccff2897 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpinputbasicauthentication.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpinputbasicauthentication.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // HttpInputBasicAuthentication type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Input.ts#L54-L57 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Input.ts#L54-L57 type HttpInputBasicAuthentication struct { Password string `json:"password"` Username string `json:"username"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpinputproxy.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpinputproxy.go index f55110e82..9387fe793 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpinputproxy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpinputproxy.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // HttpInputProxy type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Input.ts#L67-L70 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Input.ts#L67-L70 type HttpInputProxy struct { Host string `json:"host"` Port uint `json:"port"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpinputrequestdefinition.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpinputrequestdefinition.go index aab56312c..94f5f78c1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpinputrequestdefinition.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpinputrequestdefinition.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -33,7 +33,7 @@ import ( // HttpInputRequestDefinition type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Input.ts#L72-L86 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Input.ts#L72-L86 type HttpInputRequestDefinition struct { Auth *HttpInputAuthentication `json:"auth,omitempty"` Body *string `json:"body,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpinputrequestresult.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpinputrequestresult.go index 5e0e2054a..337e6d4ad 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpinputrequestresult.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpinputrequestresult.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -33,7 +33,7 @@ import ( // HttpInputRequestResult type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Actions.ts#L300-L300 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Actions.ts#L300-L300 type HttpInputRequestResult struct { Auth *HttpInputAuthentication `json:"auth,omitempty"` Body *string `json:"body,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpinputresponseresult.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpinputresponseresult.go index 5e6a4746e..b363eadbf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpinputresponseresult.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/httpinputresponseresult.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // HttpInputResponseResult type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Actions.ts#L302-L306 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Actions.ts#L302-L306 type HttpInputResponseResult struct { Body string `json:"body"` Headers HttpHeaders `json:"headers"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hunspelltokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hunspelltokenfilter.go index d29ddf199..24baacf3d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hunspelltokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hunspelltokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // HunspellTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L200-L206 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L200-L206 type HunspellTokenFilter struct { Dedup *bool `json:"dedup,omitempty"` Dictionary *string `json:"dictionary,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hyperparameter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hyperparameter.go index bfe995bbc..a8cc7bd98 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hyperparameter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hyperparameter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Hyperparameter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/TrainedModel.ts#L216-L230 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/TrainedModel.ts#L216-L230 type Hyperparameter struct { // AbsoluteImportance A positive number showing how much the parameter influences the variation of // the loss function. For hyperparameters with values that are not specified by diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hyperparameters.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hyperparameters.go index e708d5164..290148583 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hyperparameters.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hyperparameters.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Hyperparameters type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeAnalytics.ts#L419-L525 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeAnalytics.ts#L419-L525 type Hyperparameters struct { // Alpha Advanced configuration option. // Machine learning uses loss guided tree growing, which means that the decision diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hyphenationdecompoundertokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hyphenationdecompoundertokenfilter.go index 81c3c35fc..77880e757 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hyphenationdecompoundertokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/hyphenationdecompoundertokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // HyphenationDecompounderTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L58-L60 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L58-L60 type HyphenationDecompounderTokenFilter struct { HyphenationPatternsPath *string `json:"hyphenation_patterns_path,omitempty"` MaxSubwordSize *int `json:"max_subword_size,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/icuanalyzer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/icuanalyzer.go index c6b52a378..03f5cc4e7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/icuanalyzer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/icuanalyzer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // IcuAnalyzer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/icu-plugin.ts#L67-L71 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/icu-plugin.ts#L67-L71 type IcuAnalyzer struct { Method icunormalizationtype.IcuNormalizationType `json:"method"` Mode icunormalizationmode.IcuNormalizationMode `json:"mode"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/icucollationtokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/icucollationtokenfilter.go index 401de64ba..34ecbec80 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/icucollationtokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/icucollationtokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -35,7 +35,7 @@ import ( // IcuCollationTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/icu-plugin.ts#L51-L65 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/icu-plugin.ts#L51-L65 type IcuCollationTokenFilter struct { Alternate *icucollationalternate.IcuCollationAlternate `json:"alternate,omitempty"` CaseFirst *icucollationcasefirst.IcuCollationCaseFirst `json:"caseFirst,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/icufoldingtokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/icufoldingtokenfilter.go index e85e0196a..efb36098c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/icufoldingtokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/icufoldingtokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // IcuFoldingTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/icu-plugin.ts#L46-L49 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/icu-plugin.ts#L46-L49 type IcuFoldingTokenFilter struct { Type string `json:"type,omitempty"` UnicodeSetFilter string `json:"unicode_set_filter"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/icunormalizationcharfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/icunormalizationcharfilter.go index 4b799b43f..02c0c616a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/icunormalizationcharfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/icunormalizationcharfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // IcuNormalizationCharFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/icu-plugin.ts#L40-L44 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/icu-plugin.ts#L40-L44 type IcuNormalizationCharFilter struct { Mode *icunormalizationmode.IcuNormalizationMode `json:"mode,omitempty"` Name *icunormalizationtype.IcuNormalizationType `json:"name,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/icunormalizationtokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/icunormalizationtokenfilter.go index 61e25393f..52c6de3fc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/icunormalizationtokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/icunormalizationtokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // IcuNormalizationTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/icu-plugin.ts#L35-L38 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/icu-plugin.ts#L35-L38 type IcuNormalizationTokenFilter struct { Name icunormalizationtype.IcuNormalizationType `json:"name"` Type string `json:"type,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/icutokenizer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/icutokenizer.go index 8b9d19b1f..b77ef7399 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/icutokenizer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/icutokenizer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // IcuTokenizer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/icu-plugin.ts#L30-L33 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/icu-plugin.ts#L30-L33 type IcuTokenizer struct { RuleFiles string `json:"rule_files"` Type string `json:"type,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/icutransformtokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/icutransformtokenfilter.go index 33352d0fd..a092bdf79 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/icutransformtokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/icutransformtokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // IcuTransformTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/icu-plugin.ts#L24-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/icu-plugin.ts#L24-L28 type IcuTransformTokenFilter struct { Dir *icutransformdirection.IcuTransformDirection `json:"dir,omitempty"` Id string `json:"id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ids.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ids.go index 4a038e86c..cfb243332 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ids.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ids.go @@ -16,11 +16,11 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // Ids type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L56-L56 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L62-L62 type Ids []string diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/idsquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/idsquery.go index 75da9682d..ab794a652 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/idsquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/idsquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // IdsQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/term.ts#L80-L85 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/term.ts#L80-L85 type IdsQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ilm.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ilm.go index 1372cddc8..774e27d01 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ilm.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ilm.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Ilm type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L162-L165 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L162-L165 type Ilm struct { PolicyCount int `json:"policy_count"` PolicyStats []IlmPolicyStatistics `json:"policy_stats"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ilmindicator.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ilmindicator.go index 62431ff83..0f33dcee0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ilmindicator.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ilmindicator.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // IlmIndicator type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/health_report/types.ts#L145-L149 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/health_report/types.ts#L145-L149 type IlmIndicator struct { Details *IlmIndicatorDetails `json:"details,omitempty"` Diagnosis []Diagnosis `json:"diagnosis,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ilmindicatordetails.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ilmindicatordetails.go index b846d1f72..b4effe9d7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ilmindicatordetails.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ilmindicatordetails.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // IlmIndicatorDetails type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/health_report/types.ts#L150-L153 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/health_report/types.ts#L150-L153 type IlmIndicatorDetails struct { IlmStatus lifecycleoperationmode.LifecycleOperationMode `json:"ilm_status"` Policies int64 `json:"policies"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ilmpolicy.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ilmpolicy.go index d5e940fc3..af37a3a2f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ilmpolicy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ilmpolicy.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // IlmPolicy type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ilm/_types/Policy.ts#L23-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ilm/_types/Policy.ts#L23-L26 type IlmPolicy struct { Meta_ Metadata `json:"_meta,omitempty"` Phases Phases `json:"phases"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ilmpolicystatistics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ilmpolicystatistics.go index 0002d925c..debc8ec58 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ilmpolicystatistics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ilmpolicystatistics.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // IlmPolicyStatistics type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L157-L160 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L157-L160 type IlmPolicyStatistics struct { IndicesManaged int `json:"indices_managed"` Phases Phases `json:"phases"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/impact.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/impact.go index ed5227f71..59d25e655 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/impact.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/impact.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // Impact type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/health_report/types.ts#L65-L70 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/health_report/types.ts#L65-L70 type Impact struct { Description string `json:"description"` Id string `json:"id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexaction.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexaction.go index bbd3b5953..6d23a3c9f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexaction.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexaction.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // IndexAction type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Actions.ts#L256-L265 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Actions.ts#L256-L265 type IndexAction struct { DocId *string `json:"doc_id,omitempty"` ExecutionTimeField *string `json:"execution_time_field,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexaliases.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexaliases.go index d20cfd446..c209798fd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexaliases.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexaliases.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // IndexAliases type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/get_alias/IndicesGetAliasResponse.ts#L36-L38 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/get_alias/IndicesGetAliasResponse.ts#L36-L38 type IndexAliases struct { Aliases map[string]AliasDefinition `json:"aliases"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexanddatastreamaction.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexanddatastreamaction.go index b9fdd0f5a..d88d24cd2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexanddatastreamaction.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexanddatastreamaction.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // IndexAndDataStreamAction type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/modify_data_stream/types.ts#L39-L44 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/modify_data_stream/types.ts#L39-L44 type IndexAndDataStreamAction struct { // DataStream Data stream targeted by the action. DataStream string `json:"data_stream"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexcapabilities.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexcapabilities.go index cf6333237..4792bf898 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexcapabilities.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexcapabilities.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // IndexCapabilities type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/rollup/get_rollup_index_caps/types.ts#L24-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/rollup/get_rollup_index_caps/types.ts#L24-L26 type IndexCapabilities struct { RollupJobs []RollupJobSummary `json:"rollup_jobs"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexdetails.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexdetails.go index ef0d213ea..9e062ecb7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexdetails.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexdetails.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // IndexDetails type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/_types/SnapshotIndexDetails.ts#L23-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/_types/SnapshotIndexDetails.ts#L23-L28 type IndexDetails struct { MaxSegmentsPerShard int64 `json:"max_segments_per_shard"` ShardCount int `json:"shard_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexfield.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexfield.go index a5b5dcec4..dbc69514e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexfield.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexfield.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // IndexField type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/meta-fields.ts#L46-L48 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/meta-fields.ts#L46-L48 type IndexField struct { Enabled bool `json:"enabled"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexhealthstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexhealthstats.go index f2ad707c1..fbbb07631 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexhealthstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexhealthstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // IndexHealthStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/health/types.ts#L24-L34 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/health/types.ts#L24-L34 type IndexHealthStats struct { ActivePrimaryShards int `json:"active_primary_shards"` ActiveShards int `json:"active_shards"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexingpressurememorysummary.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexingpressurememorysummary.go index 84383f529..d8da7f308 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexingpressurememorysummary.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexingpressurememorysummary.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // IndexingPressureMemorySummary type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/stats/types.ts#L580-L589 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/stats/types.ts#L580-L589 type IndexingPressureMemorySummary struct { AllInBytes int64 `json:"all_in_bytes"` CombinedCoordinatingAndPrimaryInBytes int64 `json:"combined_coordinating_and_primary_in_bytes"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexingslowlogsettings.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexingslowlogsettings.go index b18fd5577..0fd8fb3a0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexingslowlogsettings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexingslowlogsettings.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // IndexingSlowlogSettings type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L547-L552 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L547-L552 type IndexingSlowlogSettings struct { Level *string `json:"level,omitempty"` Reformat *bool `json:"reformat,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexingslowlogtresholds.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexingslowlogtresholds.go index dfb117cbc..36e5c9cf7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexingslowlogtresholds.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexingslowlogtresholds.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // IndexingSlowlogTresholds type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L554-L561 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L554-L561 type IndexingSlowlogTresholds struct { // Index The indexing slow log, similar in functionality to the search slow log. The // log file name ends with `_index_indexing_slowlog.json`. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexingstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexingstats.go index 4a05f425c..372653d70 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexingstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexingstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // IndexingStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Stats.ts#L143-L159 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Stats.ts#L143-L159 type IndexingStats struct { DeleteCurrent int64 `json:"delete_current"` DeleteTime Duration `json:"delete_time,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexmappingrecord.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexmappingrecord.go index 916f21279..8f2ecf8ca 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexmappingrecord.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexmappingrecord.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // IndexMappingRecord type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/get_mapping/IndicesGetMappingResponse.ts#L28-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/get_mapping/IndicesGetMappingResponse.ts#L28-L31 type IndexMappingRecord struct { Item *TypeMapping `json:"item,omitempty"` Mappings TypeMapping `json:"mappings"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexoperation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexoperation.go index d24e68eca..21f8623f0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexoperation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexoperation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // IndexOperation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/bulk/types.ts#L132-L132 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/bulk/types.ts#L132-L132 type IndexOperation struct { // DynamicTemplates A map from the full name of fields to the name of dynamic templates. // Defaults to an empty map. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexprivilegescheck.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexprivilegescheck.go index f64635aea..2c31b25bc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexprivilegescheck.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexprivilegescheck.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // IndexPrivilegesCheck type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/has_privileges/types.ts#L33-L44 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/has_privileges/types.ts#L33-L44 type IndexPrivilegesCheck struct { // AllowRestrictedIndices This needs to be set to true (default is false) if using wildcards or regexps // for patterns that cover restricted indices. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexresult.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexresult.go index aa5b6d5bb..c75e62070 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexresult.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexresult.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // IndexResult type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Actions.ts#L267-L269 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Actions.ts#L267-L269 type IndexResult struct { Response IndexResultSummary `json:"response"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexresultsummary.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexresultsummary.go index 9893943b2..a28dda09e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexresultsummary.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexresultsummary.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // IndexResultSummary type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Actions.ts#L271-L277 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Actions.ts#L271-L277 type IndexResultSummary struct { Created bool `json:"created"` Id string `json:"id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexrouting.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexrouting.go index df402ef62..162ed77bb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexrouting.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexrouting.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // IndexRouting type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexRouting.ts#L22-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexRouting.ts#L22-L25 type IndexRouting struct { Allocation *IndexRoutingAllocation `json:"allocation,omitempty"` Rebalance *IndexRoutingRebalance `json:"rebalance,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexroutingallocation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexroutingallocation.go index 4e918a519..476abcf4d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexroutingallocation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexroutingallocation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,7 +26,7 @@ import ( // IndexRoutingAllocation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexRouting.ts#L27-L32 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexRouting.ts#L27-L32 type IndexRoutingAllocation struct { Disk *IndexRoutingAllocationDisk `json:"disk,omitempty"` Enable *indexroutingallocationoptions.IndexRoutingAllocationOptions `json:"enable,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexroutingallocationdisk.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexroutingallocationdisk.go index bf929ca73..d70f880fa 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexroutingallocationdisk.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexroutingallocationdisk.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // IndexRoutingAllocationDisk type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexRouting.ts#L62-L64 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexRouting.ts#L62-L64 type IndexRoutingAllocationDisk struct { ThresholdEnabled string `json:"threshold_enabled,omitempty"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexroutingallocationinclude.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexroutingallocationinclude.go index 78b90c0bf..98512339a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexroutingallocationinclude.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexroutingallocationinclude.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // IndexRoutingAllocationInclude type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexRouting.ts#L52-L55 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexRouting.ts#L52-L55 type IndexRoutingAllocationInclude struct { Id_ *string `json:"_id,omitempty"` TierPreference_ *string `json:"_tier_preference,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexroutingallocationinitialrecovery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexroutingallocationinitialrecovery.go index 1eda20254..54a3a3804 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexroutingallocationinitialrecovery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexroutingallocationinitialrecovery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // IndexRoutingAllocationInitialRecovery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexRouting.ts#L57-L59 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexRouting.ts#L57-L59 type IndexRoutingAllocationInitialRecovery struct { Id_ *string `json:"_id,omitempty"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexroutingrebalance.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexroutingrebalance.go index b18b86303..3f82861fd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexroutingrebalance.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexroutingrebalance.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,7 +26,7 @@ import ( // IndexRoutingRebalance type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexRouting.ts#L34-L36 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexRouting.ts#L34-L36 type IndexRoutingRebalance struct { Enable indexroutingrebalanceoptions.IndexRoutingRebalanceOptions `json:"enable"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexsegment.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexsegment.go index 07b5ca170..f99f5e5ec 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexsegment.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexsegment.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // IndexSegment type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/segments/types.ts#L24-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/segments/types.ts#L24-L26 type IndexSegment struct { Shards map[string][]ShardsSegment `json:"shards"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexsegmentsort.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexsegmentsort.go index 925dabb26..695ab7a56 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexsegmentsort.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexsegmentsort.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -33,7 +33,7 @@ import ( // IndexSegmentSort type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSegmentSort.ts#L22-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSegmentSort.ts#L22-L27 type IndexSegmentSort struct { Field []string `json:"field,omitempty"` Missing []segmentsortmissing.SegmentSortMissing `json:"missing,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexsettingblocks.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexsettingblocks.go index 0a4c0e404..b64b87e5f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexsettingblocks.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexsettingblocks.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // IndexSettingBlocks type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L245-L251 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L245-L251 type IndexSettingBlocks struct { Metadata Stringifiedboolean `json:"metadata,omitempty"` Read Stringifiedboolean `json:"read,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexsettings.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexsettings.go index ef6dc73f8..ac646fea3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexsettings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexsettings.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -33,7 +33,7 @@ import ( // IndexSettings type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L69-L168 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L69-L168 type IndexSettings struct { Analysis *IndexSettingsAnalysis `json:"analysis,omitempty"` // Analyze Settings to define analyzers, tokenizers, token filters and character diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexsettingsanalysis.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexsettingsanalysis.go index 348acc1e1..1524431f4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexsettingsanalysis.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexsettingsanalysis.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // IndexSettingsAnalysis type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L310-L316 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L310-L316 type IndexSettingsAnalysis struct { Analyzer map[string]Analyzer `json:"analyzer,omitempty"` CharFilter map[string]CharFilter `json:"char_filter,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexsettingslifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexsettingslifecycle.go index 55731b91e..1f6b6af7c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexsettingslifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexsettingslifecycle.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // IndexSettingsLifecycle type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L267-L300 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L267-L300 type IndexSettingsLifecycle struct { // IndexingComplete Indicates whether or not the index has been rolled over. Automatically set to // true when ILM completes the rollover action. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexsettingslifecyclestep.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexsettingslifecyclestep.go index a3ea55b3d..94a9dfad1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexsettingslifecyclestep.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexsettingslifecyclestep.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // IndexSettingsLifecycleStep type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L302-L308 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L302-L308 type IndexSettingsLifecycleStep struct { // WaitTimeThreshold Time to wait for the cluster to resolve allocation issues during an ILM // shrink action. Must be greater than 1h (1 hour). diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexsettingstimeseries.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexsettingstimeseries.go index b55fe6d33..c0e710f87 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexsettingstimeseries.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexsettingstimeseries.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // IndexSettingsTimeSeries type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L318-L321 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L318-L321 type IndexSettingsTimeSeries struct { EndTime DateTime `json:"end_time,omitempty"` StartTime DateTime `json:"start_time,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexstate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexstate.go index 9ec691248..30d9e40a8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexstate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexstate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // IndexState type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexState.ts#L27-L40 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexState.ts#L27-L40 type IndexState struct { Aliases map[string]Alias `json:"aliases,omitempty"` DataStream *string `json:"data_stream,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexstats.go index 10f689df4..4e627c5d3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexstats.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // IndexStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/stats/types.ts#L52-L93 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/stats/types.ts#L52-L93 type IndexStats struct { Bulk *BulkStats `json:"bulk,omitempty"` // Completion Contains statistics about completions across all shards assigned to the node. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indextemplate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indextemplate.go index a6a583005..3f1d0e300 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indextemplate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indextemplate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // IndexTemplate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexTemplate.ts#L31-L70 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexTemplate.ts#L31-L70 type IndexTemplate struct { AllowAutoCreate *bool `json:"allow_auto_create,omitempty"` // ComposedOf An ordered list of component template names. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indextemplatedatastreamconfiguration.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indextemplatedatastreamconfiguration.go index 5ef093da0..97e41da48 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indextemplatedatastreamconfiguration.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indextemplatedatastreamconfiguration.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // IndexTemplateDataStreamConfiguration type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexTemplate.ts#L72-L83 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexTemplate.ts#L72-L83 type IndexTemplateDataStreamConfiguration struct { // AllowCustomRouting If true, the data stream supports custom routing. AllowCustomRouting *bool `json:"allow_custom_routing,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indextemplateitem.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indextemplateitem.go index 30c4dc2e2..2155a6e94 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indextemplateitem.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indextemplateitem.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // IndexTemplateItem type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/get_index_template/IndicesGetIndexTemplateResponse.ts#L29-L32 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/get_index_template/IndicesGetIndexTemplateResponse.ts#L29-L32 type IndexTemplateItem struct { IndexTemplate IndexTemplate `json:"index_template"` Name string `json:"name"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indextemplatemapping.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indextemplatemapping.go index 864692a06..aad536859 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indextemplatemapping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indextemplatemapping.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // IndexTemplateMapping type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/put_index_template/IndicesPutIndexTemplateRequest.ts#L97-L119 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/put_index_template/IndicesPutIndexTemplateRequest.ts#L97-L119 type IndexTemplateMapping struct { // Aliases Aliases to add. // If the index template includes a `data_stream` object, these are data stream diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indextemplatesummary.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indextemplatesummary.go index d4f902ee2..1e65ccef2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indextemplatesummary.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indextemplatesummary.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // IndexTemplateSummary type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexTemplate.ts#L85-L107 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexTemplate.ts#L85-L107 type IndexTemplateSummary struct { // Aliases Aliases to add. // If the index template includes a `data_stream` object, these are data stream diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexversioning.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexversioning.go index 10c08a925..93fa4b4fd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexversioning.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indexversioning.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // IndexVersioning type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L262-L265 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L262-L265 type IndexVersioning struct { Created *string `json:"created,omitempty"` CreatedString *string `json:"created_string,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicatornode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicatornode.go index c0e79defd..6e1f80341 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicatornode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicatornode.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // IndicatorNode type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/health_report/types.ts#L90-L93 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/health_report/types.ts#L90-L93 type IndicatorNode struct { Name string `json:"name,omitempty"` NodeId string `json:"node_id,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicators.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicators.go index ed0b8608b..b46dda7ef 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicators.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicators.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // Indicators type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/health_report/types.ts#L32-L40 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/health_report/types.ts#L32-L40 type Indicators struct { Disk *DiskIndicator `json:"disk,omitempty"` Ilm *IlmIndicator `json:"ilm,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indices.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indices.go index d15f927e1..d19682ffb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indices.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indices.go @@ -16,11 +16,11 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // Indices type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L61-L61 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L67-L67 type Indices []string diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesaction.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesaction.go index 1f678affb..743418c18 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesaction.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesaction.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // IndicesAction type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/update_aliases/types.ts#L23-L39 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/update_aliases/types.ts#L23-L39 type IndicesAction struct { // Add Adds a data stream or index to an alias. // If the alias doesn’t exist, the `add` action creates it. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesblockstatus.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesblockstatus.go index d5bf827fe..67e28cf4c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesblockstatus.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesblockstatus.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // IndicesBlockStatus type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/add_block/IndicesAddBlockResponse.ts#L30-L33 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/add_block/IndicesAddBlockResponse.ts#L30-L33 type IndicesBlockStatus struct { Blocked bool `json:"blocked"` Name string `json:"name"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesindexingpressure.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesindexingpressure.go index 2514dd18a..fee1e9429 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesindexingpressure.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesindexingpressure.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // IndicesIndexingPressure type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L534-L536 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L534-L536 type IndicesIndexingPressure struct { Memory IndicesIndexingPressureMemory `json:"memory"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesindexingpressurememory.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesindexingpressurememory.go index 9e5cf3967..0c96e273b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesindexingpressurememory.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesindexingpressurememory.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // IndicesIndexingPressureMemory type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L538-L545 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L538-L545 type IndicesIndexingPressureMemory struct { // Limit Number of outstanding bytes that may be consumed by indexing requests. When // this limit is reached or exceeded, diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesmodifyaction.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesmodifyaction.go index 2ed6e811f..496882341 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesmodifyaction.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesmodifyaction.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // IndicesModifyAction type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/modify_data_stream/types.ts#L22-L37 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/modify_data_stream/types.ts#L22-L37 type IndicesModifyAction struct { // AddBackingIndex Adds an existing index as a backing index for a data stream. // The index is hidden as part of this operation. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesoptions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesoptions.go index 11a5a40a9..eed4793b8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesoptions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesoptions.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // IndicesOptions type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L332-L359 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L343-L370 type IndicesOptions struct { // AllowNoIndices If false, the request returns an error if any wildcard expression, index // alias, or `_all` value targets only diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesprivileges.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesprivileges.go index bcd426334..add03c543 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesprivileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesprivileges.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // IndicesPrivileges type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/_types/Privileges.ts#L82-L105 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/_types/Privileges.ts#L82-L105 type IndicesPrivileges struct { // AllowRestrictedIndices Set to `true` if using wildcard or regular expressions for patterns that // cover restricted indices. Implicitly, restricted indices have limited diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesprivilegesquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesprivilegesquery.go index c774f7e8d..a45732d88 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesprivilegesquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesprivilegesquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,5 +26,5 @@ package types // Query // RoleTemplateQuery // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/_types/Privileges.ts#L131-L139 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/_types/Privileges.ts#L131-L139 type IndicesPrivilegesQuery interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesrecord.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesrecord.go index 13269e690..03bab5d88 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesrecord.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesrecord.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // IndicesRecord type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/indices/types.ts#L20-L801 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/indices/types.ts#L20-L801 type IndicesRecord struct { // BulkAvgSizeInBytes average size in bytes of shard bulk BulkAvgSizeInBytes *string `json:"bulk.avg_size_in_bytes,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesshardsstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesshardsstats.go index 653eb40f0..e4e4ab1a6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesshardsstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesshardsstats.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // IndicesShardsStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/field_usage_stats/IndicesFieldUsageStatsResponse.ts#L49-L52 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/field_usage_stats/IndicesFieldUsageStatsResponse.ts#L49-L52 type IndicesShardsStats struct { AllFields FieldSummary `json:"all_fields"` Fields map[string]FieldSummary `json:"fields"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesshardstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesshardstats.go index 99ed2ce10..8f41e7bf5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesshardstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesshardstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,7 +26,7 @@ import ( // IndicesShardStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/stats/types.ts#L192-L223 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/stats/types.ts#L192-L223 type IndicesShardStats struct { Bulk *BulkStats `json:"bulk,omitempty"` Commit *ShardCommit `json:"commit,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesshardstores.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesshardstores.go index 878296524..02667ac48 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesshardstores.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesshardstores.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // IndicesShardStores type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/shard_stores/types.ts#L26-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/shard_stores/types.ts#L26-L28 type IndicesShardStores struct { Shards map[string]ShardStoreWrapper `json:"shards"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesstats.go index 3a005e0ac..d4f0d9b83 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // IndicesStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/stats/types.ts#L95-L110 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/stats/types.ts#L95-L110 type IndicesStats struct { Health *healthstatus.HealthStatus `json:"health,omitempty"` Primaries *IndexStats `json:"primaries,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesvalidationexplanation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesvalidationexplanation.go index cfba4e58e..41bf69605 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesvalidationexplanation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesvalidationexplanation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // IndicesValidationExplanation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/validate_query/IndicesValidateQueryResponse.ts#L32-L37 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/validate_query/IndicesValidateQueryResponse.ts#L32-L37 type IndicesValidationExplanation struct { Error *string `json:"error,omitempty"` Explanation *string `json:"explanation,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesversions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesversions.go index 90461687b..964a55a10 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesversions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/indicesversions.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // IndicesVersions type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/stats/types.ts#L263-L268 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/stats/types.ts#L263-L268 type IndicesVersions struct { IndexCount int `json:"index_count"` PrimaryShardCount int `json:"primary_shard_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceaggregate.go index 0e2bea667..e7e9d8e15 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // InferenceAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L659-L670 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L659-L670 type InferenceAggregate struct { Data map[string]json.RawMessage `json:"-"` FeatureImportance []InferenceFeatureImportance `json:"feature_importance,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceaggregation.go index 6a8ff2a10..a77bb5477 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // InferenceAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L205-L214 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L205-L214 type InferenceAggregation struct { // BucketsPath Path to the buckets that contain one set of values to correlate. BucketsPath BucketsPath `json:"buckets_path,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceclassimportance.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceclassimportance.go index 54b69ec63..ee7ff7214 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceclassimportance.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceclassimportance.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // InferenceClassImportance type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L684-L687 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L684-L687 type InferenceClassImportance struct { ClassName string `json:"class_name"` Importance Float64 `json:"importance"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceconfig.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceconfig.go index e52f0ad12..150b3efeb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceconfig.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceconfig.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // InferenceConfig type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L735-L747 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L735-L747 type InferenceConfig struct { // Classification Classification configuration for inference. Classification *InferenceConfigClassification `json:"classification,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceconfigclassification.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceconfigclassification.go index ad9457c78..b22adb9c7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceconfigclassification.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceconfigclassification.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // InferenceConfigClassification type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L762-L788 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L762-L788 type InferenceConfigClassification struct { // NumTopClasses Specifies the number of top class predictions to return. NumTopClasses *int `json:"num_top_classes,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceconfigcontainer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceconfigcontainer.go index 504db7ee1..ceba50e04 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceconfigcontainer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceconfigcontainer.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // InferenceConfigContainer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L216-L222 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L216-L222 type InferenceConfigContainer struct { // Classification Classification configuration for inference. Classification *ClassificationInferenceOptions `json:"classification,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceconfigcreatecontainer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceconfigcreatecontainer.go index 877c63cb2..02482ff27 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceconfigcreatecontainer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceconfigcreatecontainer.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // InferenceConfigCreateContainer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/inference.ts#L23-L80 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/inference.ts#L23-L80 type InferenceConfigCreateContainer struct { // Classification Classification configuration for inference. Classification *ClassificationInferenceOptions `json:"classification,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceconfigregression.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceconfigregression.go index aacba3507..3d8d6e41c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceconfigregression.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceconfigregression.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // InferenceConfigRegression type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L749-L760 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L749-L760 type InferenceConfigRegression struct { // NumTopFeatureImportanceValues Specifies the maximum number of feature importance values per document. NumTopFeatureImportanceValues *int `json:"num_top_feature_importance_values,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceconfigupdatecontainer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceconfigupdatecontainer.go index dc68f6f59..993829649 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceconfigupdatecontainer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceconfigupdatecontainer.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // InferenceConfigUpdateContainer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/inference.ts#L296-L318 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/inference.ts#L296-L318 type InferenceConfigUpdateContainer struct { // Classification Classification configuration for inference. Classification *ClassificationInferenceOptions `json:"classification,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferencefeatureimportance.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferencefeatureimportance.go index 4df6b101a..e2052f475 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferencefeatureimportance.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferencefeatureimportance.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // InferenceFeatureImportance type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L678-L682 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L678-L682 type InferenceFeatureImportance struct { Classes []InferenceClassImportance `json:"classes,omitempty"` FeatureName string `json:"feature_name"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceprocessor.go index 68abdadb0..c02afe24a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // InferenceProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L714-L733 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L714-L733 type InferenceProcessor struct { // Description Description of the processor. // Useful for describing the purpose of the processor or its configuration. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceresponseresult.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceresponseresult.go index 9b9104ddc..890ea5546 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceresponseresult.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceresponseresult.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // InferenceResponseResult type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/inference.ts#L459-L506 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/inference.ts#L459-L506 type InferenceResponseResult struct { // Entities If the model is trained for named entity recognition (NER) tasks, the // response contains the recognized entities. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceresult.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceresult.go new file mode 100644 index 000000000..42cc1dc23 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferenceresult.go @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated from the elasticsearch-specification DO NOT EDIT. +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c + +package types + +// InferenceResult type. +// +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/inference/_types/Results.ts#L46-L53 +type InferenceResult struct { + SparseEmbedding []SparseEmbeddingResult `json:"sparse_embedding,omitempty"` + TextEmbedding []TextEmbeddingResult `json:"text_embedding,omitempty"` +} + +// NewInferenceResult returns a InferenceResult. +func NewInferenceResult() *InferenceResult { + r := &InferenceResult{} + + return r +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferencetopclassentry.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferencetopclassentry.go index 9f71e8e67..d9c343cfd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferencetopclassentry.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inferencetopclassentry.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // InferenceTopClassEntry type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L672-L676 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L672-L676 type InferenceTopClassEntry struct { ClassName FieldValue `json:"class_name"` ClassProbability Float64 `json:"class_probability"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/influence.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/influence.go index 6cdb11ae8..e40766f0e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/influence.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/influence.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Influence type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Anomaly.ts#L140-L143 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Anomaly.ts#L140-L143 type Influence struct { InfluencerFieldName string `json:"influencer_field_name"` InfluencerFieldValues []string `json:"influencer_field_values"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/influencer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/influencer.go index 921e9c464..37a10d2b4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/influencer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/influencer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Influencer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Influencer.ts#L31-L83 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Influencer.ts#L31-L83 type Influencer struct { // BucketSpan The length of the bucket in seconds. This value matches the bucket span that // is specified in the job. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/infofeaturestate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/infofeaturestate.go index 29f6f3b27..a9fc0629a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/infofeaturestate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/infofeaturestate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // InfoFeatureState type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/_types/SnapshotInfoFeatureState.ts#L22-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/_types/SnapshotInfoFeatureState.ts#L22-L25 type InfoFeatureState struct { FeatureName string `json:"feature_name"` Indices []string `json:"indices"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ingestpipeline.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ingestpipeline.go index 02c8387c6..9b8843872 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ingestpipeline.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ingestpipeline.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,10 +30,13 @@ import ( // IngestPipeline type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Pipeline.ts#L23-L41 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Pipeline.ts#L23-L45 type IngestPipeline struct { // Description Description of the ingest pipeline. Description *string `json:"description,omitempty"` + // Meta_ Arbitrary metadata about the ingest pipeline. This map is not automatically + // generated by Elasticsearch. + Meta_ Metadata `json:"_meta"` // OnFailure Processors to run immediately after a processor failure. OnFailure []ProcessorContainer `json:"on_failure,omitempty"` // Processors Processors used to perform transformations on documents before indexing. @@ -70,6 +73,11 @@ func (s *IngestPipeline) UnmarshalJSON(data []byte) error { } s.Description = &o + case "_meta": + if err := dec.Decode(&s.Meta_); err != nil { + return err + } + case "on_failure": if err := dec.Decode(&s.OnFailure); err != nil { return err diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ingesttotal.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ingesttotal.go index 0446adae0..b88377c7e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ingesttotal.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ingesttotal.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // IngestTotal type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L356-L377 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L356-L377 type IngestTotal struct { // Count Total number of documents ingested during the lifetime of this node. Count *int64 `json:"count,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inlineget.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inlineget.go index 44f9cc3fe..764aa8498 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inlineget.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inlineget.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // InlineGet type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L321-L330 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L332-L341 type InlineGet struct { Fields map[string]json.RawMessage `json:"fields,omitempty"` Found bool `json:"found"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inlinegetdictuserdefined.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inlinegetdictuserdefined.go index f23559150..a4cd2781d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inlinegetdictuserdefined.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inlinegetdictuserdefined.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // InlineGetDictUserDefined type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L321-L330 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L332-L341 type InlineGetDictUserDefined struct { Fields map[string]json.RawMessage `json:"fields,omitempty"` Found bool `json:"found"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inlinescript.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inlinescript.go index f5b361562..3c9175162 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inlinescript.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inlinescript.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // InlineScript type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Scripting.ts#L67-L79 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Scripting.ts#L67-L79 type InlineScript struct { // Lang Specifies the language the script is written in. Lang *scriptlanguage.ScriptLanguage `json:"lang,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/innerhits.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/innerhits.go index 42fd00120..0ff4d4354 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/innerhits.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/innerhits.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // InnerHits type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/hits.ts#L106-L140 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/hits.ts#L106-L140 type InnerHits struct { Collapse *FieldCollapse `json:"collapse,omitempty"` DocvalueFields []FieldAndFormat `json:"docvalue_fields,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/innerhitsresult.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/innerhitsresult.go index 1c05aaf57..a8a72f249 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/innerhitsresult.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/innerhitsresult.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // InnerHitsResult type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/hits.ts#L84-L86 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/hits.ts#L84-L86 type InnerHitsResult struct { Hits *HitsMetadata `json:"hits,omitempty"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inprogress.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inprogress.go index 9d3f84d8d..a9c576fa4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inprogress.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/inprogress.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // InProgress type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/slm/_types/SnapshotLifecycle.ts#L131-L136 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/slm/_types/SnapshotLifecycle.ts#L131-L136 type InProgress struct { Name string `json:"name"` StartTimeMillis int64 `json:"start_time_millis"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/input.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/input.go index 22e522be9..07036f9ea 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/input.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/input.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // Input type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/put_trained_model/types.ts#L56-L58 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/put_trained_model/types.ts#L56-L58 type Input struct { FieldNames []string `json:"field_names"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/integernumberproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/integernumberproperty.go index 61b799188..7c86d467d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/integernumberproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/integernumberproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -34,7 +34,7 @@ import ( // IntegerNumberProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/core.ts#L149-L152 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/core.ts#L149-L152 type IntegerNumberProperty struct { Boost *Float64 `json:"boost,omitempty"` Coerce *bool `json:"coerce,omitempty"` @@ -830,9 +830,40 @@ func (s *IntegerNumberProperty) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } case "similarity": var tmp json.RawMessage diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/integerrangeproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/integerrangeproperty.go index cc3109c04..3526d395d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/integerrangeproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/integerrangeproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // IntegerRangeProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/range.ts#L42-L44 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/range.ts#L42-L44 type IntegerRangeProperty struct { Boost *Float64 `json:"boost,omitempty"` Coerce *bool `json:"coerce,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervals.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervals.go index 93306584d..06c637bce 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervals.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervals.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // Intervals type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/fulltext.ts#L83-L110 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/fulltext.ts#L83-L110 type Intervals struct { // AllOf Returns matches that span a combination of other rules. AllOf *IntervalsAllOf `json:"all_of,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervalsallof.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervalsallof.go index a56617e7b..46c30a61e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervalsallof.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervalsallof.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // IntervalsAllOf type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/fulltext.ts#L50-L70 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/fulltext.ts#L50-L70 type IntervalsAllOf struct { // Filter Rule used to filter returned intervals. Filter *IntervalsFilter `json:"filter,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervalsanyof.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervalsanyof.go index 6efccf229..f4b7a920d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervalsanyof.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervalsanyof.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // IntervalsAnyOf type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/fulltext.ts#L72-L81 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/fulltext.ts#L72-L81 type IntervalsAnyOf struct { // Filter Rule used to filter returned intervals. Filter *IntervalsFilter `json:"filter,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervalsfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervalsfilter.go index ef2c23c21..24b249695 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervalsfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervalsfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // IntervalsFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/fulltext.ts#L112-L152 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/fulltext.ts#L112-L152 type IntervalsFilter struct { // After Query used to return intervals that follow an interval from the `filter` // rule. @@ -116,9 +116,40 @@ func (s *IntervalsFilter) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } } } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervalsfuzzy.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervalsfuzzy.go index 1fc043987..71e5e8765 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervalsfuzzy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervalsfuzzy.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // IntervalsFuzzy type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/fulltext.ts#L154-L184 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/fulltext.ts#L154-L184 type IntervalsFuzzy struct { // Analyzer Analyzer used to normalize the term. Analyzer *string `json:"analyzer,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervalsmatch.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervalsmatch.go index 578e9e407..93c0aeceb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervalsmatch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervalsmatch.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // IntervalsMatch type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/fulltext.ts#L186-L216 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/fulltext.ts#L186-L216 type IntervalsMatch struct { // Analyzer Analyzer used to analyze terms in the query. Analyzer *string `json:"analyzer,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervalsprefix.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervalsprefix.go index f046c1b94..01bc25f09 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervalsprefix.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervalsprefix.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // IntervalsPrefix type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/fulltext.ts#L218-L233 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/fulltext.ts#L218-L233 type IntervalsPrefix struct { // Analyzer Analyzer used to analyze the `prefix`. Analyzer *string `json:"analyzer,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervalsquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervalsquery.go index 9b6e82c58..3054a8574 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervalsquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervalsquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // IntervalsQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/fulltext.ts#L235-L263 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/fulltext.ts#L235-L263 type IntervalsQuery struct { // AllOf Returns matches that span a combination of other rules. AllOf *IntervalsAllOf `json:"all_of,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervalswildcard.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervalswildcard.go index 9af9ced59..6577679b0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervalswildcard.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/intervalswildcard.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // IntervalsWildcard type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/fulltext.ts#L265-L280 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/fulltext.ts#L265-L280 type IntervalsWildcard struct { // Analyzer Analyzer used to analyze the `pattern`. // Defaults to the top-level field's analyzer. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/invertedindex.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/invertedindex.go index 3d4f5289d..42b8a9177 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/invertedindex.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/invertedindex.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // InvertedIndex type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/field_usage_stats/IndicesFieldUsageStatsResponse.ts#L65-L73 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/field_usage_stats/IndicesFieldUsageStatsResponse.ts#L65-L73 type InvertedIndex struct { Offsets uint `json:"offsets"` Payloads uint `json:"payloads"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/invocation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/invocation.go index 93a5d1d8b..1cfc80aa2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/invocation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/invocation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // Invocation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/slm/_types/SnapshotLifecycle.ts#L138-L141 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/slm/_types/SnapshotLifecycle.ts#L138-L141 type Invocation struct { SnapshotName string `json:"snapshot_name"` Time DateTime `json:"time"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/invocations.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/invocations.go index c458d3fe6..02b899c51 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/invocations.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/invocations.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Invocations type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L44-L46 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L44-L46 type Invocations struct { Total int64 `json:"total"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/iostatdevice.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/iostatdevice.go index ac032523a..328d88eca 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/iostatdevice.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/iostatdevice.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // IoStatDevice type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L730-L755 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L730-L755 type IoStatDevice struct { // DeviceName The Linux device name. DeviceName *string `json:"device_name,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/iostats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/iostats.go index db4f7a041..8a503b9b0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/iostats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/iostats.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // IoStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L718-L728 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L718-L728 type IoStats struct { // Devices Array of disk metrics for each device that is backing an Elasticsearch data // path. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ipfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ipfilter.go index 070c61397..8c652dd7a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ipfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ipfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // IpFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L167-L170 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L167-L170 type IpFilter struct { Http bool `json:"http"` Transport bool `json:"transport"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ipprefixaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ipprefixaggregate.go index 46202dc6e..6bd4b223c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ipprefixaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ipprefixaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // IpPrefixAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L629-L630 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L629-L630 type IpPrefixAggregate struct { Buckets BucketsIpPrefixBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ipprefixaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ipprefixaggregation.go index 933f7bba7..b680694b2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ipprefixaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ipprefixaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // IpPrefixAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L1114-L1143 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L1114-L1143 type IpPrefixAggregation struct { // AppendPrefixLength Defines whether the prefix length is appended to IP address keys in the // response. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ipprefixbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ipprefixbucket.go index c186d270e..bf2e3c341 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ipprefixbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ipprefixbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // IpPrefixBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L632-L637 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L632-L637 type IpPrefixBucket struct { Aggregations map[string]Aggregate `json:"-"` DocCount int64 `json:"doc_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ipproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ipproperty.go index 88347493a..fc6adf5be 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ipproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ipproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -33,7 +33,7 @@ import ( // IpProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/specialized.ts#L59-L73 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/specialized.ts#L59-L73 type IpProperty struct { Boost *Float64 `json:"boost,omitempty"` CopyTo []string `json:"copy_to,omitempty"` @@ -807,9 +807,40 @@ func (s *IpProperty) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } case "similarity": var tmp json.RawMessage diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/iprangeaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/iprangeaggregate.go index 9ad40c0d2..7cb6e80d8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/iprangeaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/iprangeaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // IpRangeAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L556-L558 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L556-L558 type IpRangeAggregate struct { Buckets BucketsIpRangeBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/iprangeaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/iprangeaggregation.go index 2080066e9..6ef7a2b0f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/iprangeaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/iprangeaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // IpRangeAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L548-L557 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L548-L557 type IpRangeAggregation struct { // Field The date field whose values are used to build ranges. Field *string `json:"field,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/iprangeaggregationrange.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/iprangeaggregationrange.go index f8f87944d..d740e6c8c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/iprangeaggregationrange.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/iprangeaggregationrange.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // IpRangeAggregationRange type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L559-L572 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L559-L572 type IpRangeAggregationRange struct { // From Start of the range. From string `json:"from,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/iprangebucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/iprangebucket.go index 53e82a668..9350f92bc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/iprangebucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/iprangebucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // IpRangeBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L560-L564 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L560-L564 type IpRangeBucket struct { Aggregations map[string]Aggregate `json:"-"` DocCount int64 `json:"doc_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/iprangeproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/iprangeproperty.go index b29dc0274..425dcbf72 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/iprangeproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/iprangeproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // IpRangeProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/range.ts#L46-L48 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/range.ts#L46-L48 type IpRangeProperty struct { Boost *Float64 `json:"boost,omitempty"` Coerce *bool `json:"coerce,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/job.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/job.go index 3accc2862..63fdf4766 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/job.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Job type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Job.ts#L61-L180 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Job.ts#L61-L180 type Job struct { // AllowLazyOpen Advanced configuration option. // Specifies whether this job can open when there is insufficient machine diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jobblocked.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jobblocked.go index 07be87322..8cf91f51b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jobblocked.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jobblocked.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // JobBlocked type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Job.ts#L392-L395 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Job.ts#L392-L395 type JobBlocked struct { Reason jobblockedreason.JobBlockedReason `json:"reason"` TaskId TaskId `json:"task_id,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jobconfig.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jobconfig.go index c166337fb..7b134999a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jobconfig.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jobconfig.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // JobConfig type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Job.ts#L182-L283 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Job.ts#L182-L283 type JobConfig struct { // AllowLazyOpen Advanced configuration option. Specifies whether this job can open when there // is insufficient machine learning node capacity for it to be immediately diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jobforecaststatistics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jobforecaststatistics.go index 6c0c5b7d1..98461e09e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jobforecaststatistics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jobforecaststatistics.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // JobForecastStatistics type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Job.ts#L343-L350 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Job.ts#L343-L350 type JobForecastStatistics struct { ForecastedJobs int `json:"forecasted_jobs"` MemoryBytes *JobStatistics `json:"memory_bytes,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jobsrecord.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jobsrecord.go index b2ac81960..4fe82f7aa 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jobsrecord.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jobsrecord.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -34,7 +34,7 @@ import ( // JobsRecord type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/ml_jobs/types.ts#L24-L347 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/ml_jobs/types.ts#L24-L347 type JobsRecord struct { // AssignmentExplanation For open anomaly detection jobs only, contains messages relating to the // selection of a node to run the job. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jobstatistics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jobstatistics.go index b950a7a18..98496d5bf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jobstatistics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jobstatistics.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // JobStatistics type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Job.ts#L54-L59 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Job.ts#L54-L59 type JobStatistics struct { Avg Float64 `json:"avg"` Max Float64 `json:"max"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jobstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jobstats.go index 6848de848..8038a7477 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jobstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jobstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // JobStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Job.ts#L284-L330 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Job.ts#L284-L330 type JobStats struct { // AssignmentExplanation For open anomaly detection jobs only, contains messages relating to the // selection of a node to run the job. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jobtimingstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jobtimingstats.go index a23f6b75d..680145f5b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jobtimingstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jobtimingstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // JobTimingStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Job.ts#L332-L341 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Job.ts#L332-L341 type JobTimingStats struct { AverageBucketProcessingTimeMs Float64 `json:"average_bucket_processing_time_ms,omitempty"` BucketCount int64 `json:"bucket_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jobusage.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jobusage.go index e916c3d4c..2ac5ae3aa 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jobusage.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jobusage.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // JobUsage type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L364-L370 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L364-L370 type JobUsage struct { Count int `json:"count"` CreatedBy map[string]int64 `json:"created_by"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/joinprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/joinprocessor.go index 41517e79f..279d01afc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/joinprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/joinprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // JoinProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L790-L805 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L790-L805 type JoinProcessor struct { // Description Description of the processor. // Useful for describing the purpose of the processor or its configuration. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/joinproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/joinproperty.go index 5ad14408b..2ec0be90b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/joinproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/joinproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // JoinProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/core.ts#L83-L87 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/core.ts#L83-L87 type JoinProperty struct { Dynamic *dynamicmapping.DynamicMapping `json:"dynamic,omitempty"` EagerGlobalOrdinals *bool `json:"eager_global_ordinals,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jsonprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jsonprocessor.go index ca472cd4f..4709564a6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jsonprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jsonprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // JsonProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L807-L836 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L807-L836 type JsonProcessor struct { // AddToRoot Flag that forces the parsed JSON to be added at the top level of the // document. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jvm.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jvm.go index 03c5aa3b9..d0a13d62f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jvm.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jvm.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Jvm type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L811-L845 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L811-L845 type Jvm struct { // BufferPools Contains statistics about JVM buffer pools for the node. BufferPools map[string]NodeBufferPool `json:"buffer_pools,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jvmclasses.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jvmclasses.go index 1830dd72a..7e1ffb00f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jvmclasses.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jvmclasses.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // JvmClasses type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L908-L921 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L908-L921 type JvmClasses struct { // CurrentLoadedCount Number of classes currently loaded by JVM. CurrentLoadedCount *int64 `json:"current_loaded_count,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jvmmemorystats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jvmmemorystats.go index 02f9fea8f..b480e264d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jvmmemorystats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jvmmemorystats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // JvmMemoryStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L847-L876 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L847-L876 type JvmMemoryStats struct { // HeapCommittedInBytes Amount of memory, in bytes, available for use by the heap. HeapCommittedInBytes *int64 `json:"heap_committed_in_bytes,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jvmstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jvmstats.go index f0e63d99d..11fb74ae5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jvmstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jvmstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // JvmStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/get_memory_stats/types.ts#L50-L63 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/get_memory_stats/types.ts#L50-L63 type JvmStats struct { // HeapMax Maximum amount of memory available for use by the heap. HeapMax ByteSize `json:"heap_max,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jvmthreads.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jvmthreads.go index 938cc139a..e1c3c379c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jvmthreads.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/jvmthreads.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // JvmThreads type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L897-L906 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L897-L906 type JvmThreads struct { // Count Number of active threads in use by JVM. Count *int64 `json:"count,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keeptypestokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keeptypestokenfilter.go index 5091b43e3..9a4f2932c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keeptypestokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keeptypestokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // KeepTypesTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L218-L222 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L218-L222 type KeepTypesTokenFilter struct { Mode *keeptypesmode.KeepTypesMode `json:"mode,omitempty"` Type string `json:"type,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keepwordstokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keepwordstokenfilter.go index af654b2b2..b1850ffb8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keepwordstokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keepwordstokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // KeepWordsTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L224-L229 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L224-L229 type KeepWordsTokenFilter struct { KeepWords []string `json:"keep_words,omitempty"` KeepWordsCase *bool `json:"keep_words_case,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keyedpercentiles.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keyedpercentiles.go index 78fe3ad73..768f0a1db 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keyedpercentiles.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keyedpercentiles.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -34,7 +34,7 @@ import ( // KeyedPercentiles type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L158-L158 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L158-L158 type KeyedPercentiles map[string]string func (s KeyedPercentiles) UnmarshalJSON(data []byte) error { diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keyedprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keyedprocessor.go index 1b4e3c9d3..c487ed85f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keyedprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keyedprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // KeyedProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L379-L382 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L379-L382 type KeyedProcessor struct { Stats *Processor `json:"stats,omitempty"` Type *string `json:"type,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keyvalueprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keyvalueprocessor.go index c5ac27831..0716a63fd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keyvalueprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keyvalueprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // KeyValueProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L845-L897 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L845-L897 type KeyValueProcessor struct { // Description Description of the processor. // Useful for describing the purpose of the processor or its configuration. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keywordanalyzer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keywordanalyzer.go index 7b2e15257..01956d889 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keywordanalyzer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keywordanalyzer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // KeywordAnalyzer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/analyzers.ts#L47-L50 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/analyzers.ts#L47-L50 type KeywordAnalyzer struct { Type string `json:"type,omitempty"` Version *string `json:"version,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keywordmarkertokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keywordmarkertokenfilter.go index b6eaefb9e..9c4168baf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keywordmarkertokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keywordmarkertokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // KeywordMarkerTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L231-L237 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L231-L237 type KeywordMarkerTokenFilter struct { IgnoreCase *bool `json:"ignore_case,omitempty"` Keywords []string `json:"keywords,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keywordproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keywordproperty.go index cb388e9c4..673a2e298 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keywordproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keywordproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -33,7 +33,7 @@ import ( // KeywordProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/core.ts#L89-L105 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/core.ts#L89-L105 type KeywordProperty struct { Boost *Float64 `json:"boost,omitempty"` CopyTo []string `json:"copy_to,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keywordtokenizer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keywordtokenizer.go index 00122a3a6..6d574cebf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keywordtokenizer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/keywordtokenizer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // KeywordTokenizer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/tokenizers.ts#L62-L65 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/tokenizers.ts#L62-L65 type KeywordTokenizer struct { BufferSize int `json:"buffer_size"` Type string `json:"type,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/kibanatoken.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/kibanatoken.go index de7b11326..2d949c7fb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/kibanatoken.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/kibanatoken.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // KibanaToken type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/enroll_kibana/Response.ts#L27-L30 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/enroll_kibana/Response.ts#L27-L30 type KibanaToken struct { Name string `json:"name"` Value string `json:"value"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/knnquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/knnquery.go index 55ca43788..5f1397463 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/knnquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/knnquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // KnnQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Knn.ts#L26-L43 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Knn.ts#L26-L43 type KnnQuery struct { // Boost Boost value to apply to kNN scores Boost *float32 `json:"boost,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/kstemtokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/kstemtokenfilter.go index 149dc6684..71704d093 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/kstemtokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/kstemtokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // KStemTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L239-L241 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L239-L241 type KStemTokenFilter struct { Type string `json:"type,omitempty"` Version *string `json:"version,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/kuromojianalyzer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/kuromojianalyzer.go index c0e0a29a0..4b3fdbe3e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/kuromojianalyzer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/kuromojianalyzer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // KuromojiAnalyzer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/kuromoji-plugin.ts#L25-L29 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/kuromoji-plugin.ts#L25-L29 type KuromojiAnalyzer struct { Mode kuromojitokenizationmode.KuromojiTokenizationMode `json:"mode"` Type string `json:"type,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/kuromojiiterationmarkcharfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/kuromojiiterationmarkcharfilter.go index 3ae605ab3..5c891f1c6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/kuromojiiterationmarkcharfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/kuromojiiterationmarkcharfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // KuromojiIterationMarkCharFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/kuromoji-plugin.ts#L31-L35 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/kuromoji-plugin.ts#L31-L35 type KuromojiIterationMarkCharFilter struct { NormalizeKana bool `json:"normalize_kana"` NormalizeKanji bool `json:"normalize_kanji"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/kuromojipartofspeechtokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/kuromojipartofspeechtokenfilter.go index aa4f45585..d615bf1ca 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/kuromojipartofspeechtokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/kuromojipartofspeechtokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // KuromojiPartOfSpeechTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/kuromoji-plugin.ts#L37-L40 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/kuromoji-plugin.ts#L37-L40 type KuromojiPartOfSpeechTokenFilter struct { Stoptags []string `json:"stoptags"` Type string `json:"type,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/kuromojireadingformtokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/kuromojireadingformtokenfilter.go index a11d21a2f..d03f60f4c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/kuromojireadingformtokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/kuromojireadingformtokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // KuromojiReadingFormTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/kuromoji-plugin.ts#L42-L45 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/kuromoji-plugin.ts#L42-L45 type KuromojiReadingFormTokenFilter struct { Type string `json:"type,omitempty"` UseRomaji bool `json:"use_romaji"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/kuromojistemmertokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/kuromojistemmertokenfilter.go index bf07a52e5..650420c29 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/kuromojistemmertokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/kuromojistemmertokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // KuromojiStemmerTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/kuromoji-plugin.ts#L47-L50 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/kuromoji-plugin.ts#L47-L50 type KuromojiStemmerTokenFilter struct { MinimumLength int `json:"minimum_length"` Type string `json:"type,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/kuromojitokenizer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/kuromojitokenizer.go index 2ebe41353..22dfa381e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/kuromojitokenizer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/kuromojitokenizer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // KuromojiTokenizer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/kuromoji-plugin.ts#L58-L67 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/kuromoji-plugin.ts#L58-L67 type KuromojiTokenizer struct { DiscardCompoundToken *bool `json:"discard_compound_token,omitempty"` DiscardPunctuation *bool `json:"discard_punctuation,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/languageanalyzer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/languageanalyzer.go index 9059d6d75..c2dbc63c3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/languageanalyzer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/languageanalyzer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // LanguageAnalyzer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/analyzers.ts#L52-L59 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/analyzers.ts#L52-L59 type LanguageAnalyzer struct { Language language.Language `json:"language"` StemExclusion []string `json:"stem_exclusion"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/languagecontext.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/languagecontext.go index 1df20c91f..00e43dc29 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/languagecontext.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/languagecontext.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,7 +26,7 @@ import ( // LanguageContext type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/get_script_languages/types.ts#L22-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/get_script_languages/types.ts#L22-L25 type LanguageContext struct { Contexts []string `json:"contexts"` Language scriptlanguage.ScriptLanguage `json:"language"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/laplacesmoothingmodel.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/laplacesmoothingmodel.go index 7648d65ab..bd85cf3c8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/laplacesmoothingmodel.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/laplacesmoothingmodel.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // LaplaceSmoothingModel type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/suggester.ts#L427-L432 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/suggester.ts#L427-L432 type LaplaceSmoothingModel struct { // Alpha A constant that is added to all counts to balance weights. Alpha Float64 `json:"alpha"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/latest.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/latest.go index 770493ce6..951f1af69 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/latest.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/latest.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // Latest type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/transform/_types/Transform.ts#L47-L52 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/transform/_types/Transform.ts#L47-L52 type Latest struct { // Sort Specifies the date field that is used to identify the latest documents. Sort string `json:"sort"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/latlongeolocation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/latlongeolocation.go index a82b21723..36750566f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/latlongeolocation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/latlongeolocation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // LatLonGeoLocation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Geo.ts#L129-L138 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Geo.ts#L129-L138 type LatLonGeoLocation struct { // Lat Latitude Lat Float64 `json:"lat"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lengthtokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lengthtokenfilter.go index a519e4ed7..5a127c9ae 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lengthtokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lengthtokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // LengthTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L243-L247 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L243-L247 type LengthTokenFilter struct { Max *int `json:"max,omitempty"` Min *int `json:"min,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lettertokenizer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lettertokenizer.go index 5bc1b8600..cc9a0c4dc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lettertokenizer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lettertokenizer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // LetterTokenizer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/tokenizers.ts#L67-L69 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/tokenizers.ts#L67-L69 type LetterTokenizer struct { Type string `json:"type,omitempty"` Version *string `json:"version,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/license.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/license.go index cb2afad50..90e5643fb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/license.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/license.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // License type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/license/_types/License.ts#L42-L53 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/license/_types/License.ts#L42-L53 type License struct { ExpiryDateInMillis int64 `json:"expiry_date_in_millis"` IssueDateInMillis int64 `json:"issue_date_in_millis"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/licenseinformation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/licenseinformation.go index 3c154159c..ce5699afc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/licenseinformation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/licenseinformation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -33,7 +33,7 @@ import ( // LicenseInformation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/license/get/types.ts#L25-L38 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/license/get/types.ts#L25-L38 type LicenseInformation struct { ExpiryDate DateTime `json:"expiry_date,omitempty"` ExpiryDateInMillis *int64 `json:"expiry_date_in_millis,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lifecycle.go index df0500390..276cd3e29 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lifecycle.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // Lifecycle type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ilm/get_lifecycle/types.ts#L24-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ilm/get_lifecycle/types.ts#L24-L28 type Lifecycle struct { ModifiedDate DateTime `json:"modified_date"` Policy IlmPolicy `json:"policy"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lifecycleexplain.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lifecycleexplain.go index a196fc299..171c7b3db 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lifecycleexplain.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lifecycleexplain.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // LifecycleExplainManaged // LifecycleExplainUnmanaged // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ilm/explain_lifecycle/types.ts#L59-L62 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ilm/explain_lifecycle/types.ts#L59-L62 type LifecycleExplain interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lifecycleexplainmanaged.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lifecycleexplainmanaged.go index a14558c52..fe26f4703 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lifecycleexplainmanaged.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lifecycleexplainmanaged.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // LifecycleExplainManaged type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ilm/explain_lifecycle/types.ts#L26-L52 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ilm/explain_lifecycle/types.ts#L26-L52 type LifecycleExplainManaged struct { Action *string `json:"action,omitempty"` ActionTime DateTime `json:"action_time,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lifecycleexplainphaseexecution.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lifecycleexplainphaseexecution.go index 6fdbec92e..26fae9fee 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lifecycleexplainphaseexecution.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lifecycleexplainphaseexecution.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // LifecycleExplainPhaseExecution type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ilm/explain_lifecycle/types.ts#L64-L68 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ilm/explain_lifecycle/types.ts#L64-L68 type LifecycleExplainPhaseExecution struct { ModifiedDateInMillis int64 `json:"modified_date_in_millis"` Policy string `json:"policy"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lifecycleexplainunmanaged.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lifecycleexplainunmanaged.go index 1a2efcd0f..9f3bcb78b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lifecycleexplainunmanaged.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lifecycleexplainunmanaged.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // LifecycleExplainUnmanaged type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ilm/explain_lifecycle/types.ts#L54-L57 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ilm/explain_lifecycle/types.ts#L54-L57 type LifecycleExplainUnmanaged struct { Index string `json:"index"` Managed bool `json:"managed,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/like.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/like.go index 9b33cdbfe..bfabc22f2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/like.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/like.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // string // LikeDocument // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/specialized.ts#L186-L191 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/specialized.ts#L186-L191 type Like interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/likedocument.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/likedocument.go index a016f8cdd..1762a96e1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/likedocument.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/likedocument.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // LikeDocument type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/specialized.ts#L165-L184 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/specialized.ts#L165-L184 type LikeDocument struct { // Doc A document not present in the index. Doc json.RawMessage `json:"doc,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/limits.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/limits.go index b44da4bea..39afe6f29 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/limits.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/limits.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Limits type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/info/types.ts#L34-L38 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/info/types.ts#L34-L38 type Limits struct { EffectiveMaxModelMemoryLimit string `json:"effective_max_model_memory_limit"` MaxModelMemoryLimit *string `json:"max_model_memory_limit,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/limittokencounttokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/limittokencounttokenfilter.go index 97e4d4519..0fc0b2731 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/limittokencounttokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/limittokencounttokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // LimitTokenCountTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L249-L253 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L249-L253 type LimitTokenCountTokenFilter struct { ConsumeAllTokens *bool `json:"consume_all_tokens,omitempty"` MaxTokenCount Stringifiedinteger `json:"max_token_count,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/linearinterpolationsmoothingmodel.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/linearinterpolationsmoothingmodel.go index d4eb44c50..0277ef467 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/linearinterpolationsmoothingmodel.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/linearinterpolationsmoothingmodel.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // LinearInterpolationSmoothingModel type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/suggester.ts#L434-L438 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/suggester.ts#L434-L438 type LinearInterpolationSmoothingModel struct { BigramLambda Float64 `json:"bigram_lambda"` TrigramLambda Float64 `json:"trigram_lambda"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/linearmovingaverageaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/linearmovingaverageaggregation.go index b13946f06..34d52c65e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/linearmovingaverageaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/linearmovingaverageaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // LinearMovingAverageAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L242-L245 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L242-L245 type LinearMovingAverageAggregation struct { // BucketsPath Path to the buckets that contain one set of values to correlate. BucketsPath BucketsPath `json:"buckets_path,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/loggingaction.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/loggingaction.go index bd805f866..098f1577f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/loggingaction.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/loggingaction.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // LoggingAction type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Actions.ts#L281-L285 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Actions.ts#L281-L285 type LoggingAction struct { Category *string `json:"category,omitempty"` Level *string `json:"level,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/loggingresult.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/loggingresult.go index a040597c9..e436fdd2f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/loggingresult.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/loggingresult.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // LoggingResult type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Actions.ts#L287-L289 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Actions.ts#L287-L289 type LoggingResult struct { LoggedText string `json:"logged_text"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/logstashpipeline.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/logstashpipeline.go index 7abc9be8a..c4bc8410b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/logstashpipeline.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/logstashpipeline.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // LogstashPipeline type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/logstash/_types/Pipeline.ts#L60-L92 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/logstash/_types/Pipeline.ts#L60-L92 type LogstashPipeline struct { // Description Description of the pipeline. // This description is not used by Elasticsearch or Logstash. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/longnumberproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/longnumberproperty.go index 542db08bf..f62d4cc00 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/longnumberproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/longnumberproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -34,7 +34,7 @@ import ( // LongNumberProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/core.ts#L154-L157 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/core.ts#L154-L157 type LongNumberProperty struct { Boost *Float64 `json:"boost,omitempty"` Coerce *bool `json:"coerce,omitempty"` @@ -829,9 +829,40 @@ func (s *LongNumberProperty) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } case "similarity": var tmp json.RawMessage diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/longrangeproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/longrangeproperty.go index 8f50eb2dd..3ef6ffb1b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/longrangeproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/longrangeproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // LongRangeProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/range.ts#L50-L52 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/range.ts#L50-L52 type LongRangeProperty struct { Boost *Float64 `json:"boost,omitempty"` Coerce *bool `json:"coerce,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/longraretermsaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/longraretermsaggregate.go index 0881e0dea..8abdffd90 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/longraretermsaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/longraretermsaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // LongRareTermsAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L431-L436 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L431-L436 type LongRareTermsAggregate struct { Buckets BucketsLongRareTermsBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/longraretermsbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/longraretermsbucket.go index aac8ba27e..5f8d72b5a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/longraretermsbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/longraretermsbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // LongRareTermsBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L438-L441 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L438-L441 type LongRareTermsBucket struct { Aggregations map[string]Aggregate `json:"-"` DocCount int64 `json:"doc_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/longtermsaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/longtermsaggregate.go index 8c69500e7..0d515a813 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/longtermsaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/longtermsaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // LongTermsAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L399-L404 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L399-L404 type LongTermsAggregate struct { Buckets BucketsLongTermsBucket `json:"buckets"` DocCountErrorUpperBound *int64 `json:"doc_count_error_upper_bound,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/longtermsbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/longtermsbucket.go index 9dc66e18e..9b5bc2314 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/longtermsbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/longtermsbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // LongTermsBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L406-L409 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L406-L409 type LongTermsBucket struct { Aggregations map[string]Aggregate `json:"-"` DocCount int64 `json:"doc_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lowercasenormalizer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lowercasenormalizer.go index 87d26b9a0..e24682089 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lowercasenormalizer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lowercasenormalizer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,7 +26,7 @@ import ( // LowercaseNormalizer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/normalizers.ts#L26-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/normalizers.ts#L26-L28 type LowercaseNormalizer struct { Type string `json:"type,omitempty"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lowercaseprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lowercaseprocessor.go index 47e32f08a..cfb179d4e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lowercaseprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lowercaseprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // LowercaseProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L899-L915 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L899-L915 type LowercaseProcessor struct { // Description Description of the processor. // Useful for describing the purpose of the processor or its configuration. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lowercasetokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lowercasetokenfilter.go index 45c8111f4..bca702242 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lowercasetokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lowercasetokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // LowercaseTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L255-L258 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L255-L258 type LowercaseTokenFilter struct { Language *string `json:"language,omitempty"` Type string `json:"type,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lowercasetokenizer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lowercasetokenizer.go index 1539407f1..d2c987315 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lowercasetokenizer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/lowercasetokenizer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // LowercaseTokenizer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/tokenizers.ts#L71-L73 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/tokenizers.ts#L71-L73 type LowercaseTokenizer struct { Type string `json:"type,omitempty"` Version *string `json:"version,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/machinelearning.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/machinelearning.go index 672ffeb1f..263270c8c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/machinelearning.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/machinelearning.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MachineLearning type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L372-L379 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L372-L379 type MachineLearning struct { Available bool `json:"available"` DataFrameAnalyticsJobs MlDataFrameAnalyticsJobs `json:"data_frame_analytics_jobs"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/managedby.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/managedby.go new file mode 100644 index 000000000..81548d72f --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/managedby.go @@ -0,0 +1,26 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated from the elasticsearch-specification DO NOT EDIT. +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c + +package types + +// ManagedBy holds the union for the following types: +// +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L80-L83 +type ManagedBy interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/manageuserprivileges.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/manageuserprivileges.go index 693603902..f142c085c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/manageuserprivileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/manageuserprivileges.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // ManageUserPrivileges type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/_types/Privileges.ts#L197-L199 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/_types/Privileges.ts#L197-L199 type ManageUserPrivileges struct { Applications []string `json:"applications"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mapboxvectortiles.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mapboxvectortiles.go index 9c3c5bd19..4179a9cbd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mapboxvectortiles.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mapboxvectortiles.go @@ -16,11 +16,11 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // MapboxVectorTiles type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Binary.ts#L21-L21 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Binary.ts#L21-L21 type MapboxVectorTiles []byte diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappingcharfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappingcharfilter.go index 5531f1d15..bc96e1de5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappingcharfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappingcharfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MappingCharFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/char_filters.ts#L47-L51 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/char_filters.ts#L47-L51 type MappingCharFilter struct { Mappings []string `json:"mappings,omitempty"` MappingsPath *string `json:"mappings_path,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappinglimitsettings.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappinglimitsettings.go index 13bb4d981..7d3240784 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappinglimitsettings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappinglimitsettings.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MappingLimitSettings type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L402-L415 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L402-L415 type MappingLimitSettings struct { Coerce *bool `json:"coerce,omitempty"` Depth *MappingLimitSettingsDepth `json:"depth,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappinglimitsettingsdepth.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappinglimitsettingsdepth.go index 80b944afa..2fa9cfae3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappinglimitsettingsdepth.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappinglimitsettingsdepth.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MappingLimitSettingsDepth type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L427-L434 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L427-L434 type MappingLimitSettingsDepth struct { // Limit The maximum depth for a field, which is measured as the number of inner // objects. For instance, if all fields are defined diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappinglimitsettingsdimensionfields.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappinglimitsettingsdimensionfields.go index cab90d691..1ae467f88 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappinglimitsettingsdimensionfields.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappinglimitsettingsdimensionfields.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,11 +30,11 @@ import ( // MappingLimitSettingsDimensionFields type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L464-L470 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L464-L470 type MappingLimitSettingsDimensionFields struct { // Limit [preview] This functionality is in technical preview and may be changed or - // removed in a future release. Elastic will - // apply best effort to fix any issues, but features in technical preview are + // removed in a future release. + // Elastic will work to fix any issues, but features in technical preview are // not subject to the support SLA of official GA features. Limit *int `json:"limit,omitempty"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappinglimitsettingsfieldnamelength.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappinglimitsettingsfieldnamelength.go index 1295467be..8e66c631c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappinglimitsettingsfieldnamelength.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappinglimitsettingsfieldnamelength.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MappingLimitSettingsFieldNameLength type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L455-L462 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L455-L462 type MappingLimitSettingsFieldNameLength struct { // Limit Setting for the maximum length of a field name. This setting isn’t really // something that addresses mappings explosion but diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappinglimitsettingsnestedfields.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappinglimitsettingsnestedfields.go index 91a339d25..e71111437 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappinglimitsettingsnestedfields.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappinglimitsettingsnestedfields.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MappingLimitSettingsNestedFields type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L436-L444 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L436-L444 type MappingLimitSettingsNestedFields struct { // Limit The maximum number of distinct nested mappings in an index. The nested type // should only be used in special cases, when diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappinglimitsettingsnestedobjects.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappinglimitsettingsnestedobjects.go index 28cacefb7..739e23578 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappinglimitsettingsnestedobjects.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappinglimitsettingsnestedobjects.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MappingLimitSettingsNestedObjects type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L446-L453 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L446-L453 type MappingLimitSettingsNestedObjects struct { // Limit The maximum number of nested JSON objects that a single document can contain // across all nested types. This limit helps diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappinglimitsettingstotalfields.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappinglimitsettingstotalfields.go index d00cf9776..63b23d6f5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappinglimitsettingstotalfields.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappinglimitsettingstotalfields.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MappingLimitSettingsTotalFields type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L417-L425 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L417-L425 type MappingLimitSettingsTotalFields struct { // Limit The maximum number of fields in an index. Field and object mappings, as well // as field aliases count towards this limit. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappingstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappingstats.go index 627cda11b..da381c458 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappingstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mappingstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MappingStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/stats/types.ts#L186-L190 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/stats/types.ts#L186-L190 type MappingStats struct { TotalCount int64 `json:"total_count"` TotalEstimatedOverhead ByteSize `json:"total_estimated_overhead,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/masterisstableindicator.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/masterisstableindicator.go index 5de76c8fb..f73e5e479 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/masterisstableindicator.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/masterisstableindicator.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // MasterIsStableIndicator type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/health_report/types.ts#L79-L83 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/health_report/types.ts#L79-L83 type MasterIsStableIndicator struct { Details *MasterIsStableIndicatorDetails `json:"details,omitempty"` Diagnosis []Diagnosis `json:"diagnosis,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/masterisstableindicatorclusterformationnode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/masterisstableindicatorclusterformationnode.go index dd5fda882..f7c676e2b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/masterisstableindicatorclusterformationnode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/masterisstableindicatorclusterformationnode.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MasterIsStableIndicatorClusterFormationNode type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/health_report/types.ts#L98-L102 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/health_report/types.ts#L98-L102 type MasterIsStableIndicatorClusterFormationNode struct { ClusterFormationMessage string `json:"cluster_formation_message"` Name *string `json:"name,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/masterisstableindicatordetails.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/masterisstableindicatordetails.go index 848fa374f..a78f4d68a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/masterisstableindicatordetails.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/masterisstableindicatordetails.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // MasterIsStableIndicatorDetails type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/health_report/types.ts#L84-L89 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/health_report/types.ts#L84-L89 type MasterIsStableIndicatorDetails struct { ClusterFormation []MasterIsStableIndicatorClusterFormationNode `json:"cluster_formation,omitempty"` CurrentMaster IndicatorNode `json:"current_master"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/masterisstableindicatorexceptionfetchinghistory.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/masterisstableindicatorexceptionfetchinghistory.go index 68952387b..748698f22 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/masterisstableindicatorexceptionfetchinghistory.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/masterisstableindicatorexceptionfetchinghistory.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MasterIsStableIndicatorExceptionFetchingHistory type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/health_report/types.ts#L94-L97 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/health_report/types.ts#L94-L97 type MasterIsStableIndicatorExceptionFetchingHistory struct { Message string `json:"message"` StackTrace string `json:"stack_trace"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/masterrecord.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/masterrecord.go index 7dc339e6a..04c02fb57 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/masterrecord.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/masterrecord.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MasterRecord type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/master/types.ts#L20-L39 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/master/types.ts#L20-L39 type MasterRecord struct { // Host host name Host *string `json:"host,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matchallquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matchallquery.go index 02c96c5fb..4c4c48c17 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matchallquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matchallquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MatchAllQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/MatchAllQuery.ts#L22-L22 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/MatchAllQuery.ts#L22-L22 type MatchAllQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matchboolprefixquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matchboolprefixquery.go index ad5c0dec4..480083629 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matchboolprefixquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matchboolprefixquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // MatchBoolPrefixQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/fulltext.ts#L349-L403 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/fulltext.ts#L349-L403 type MatchBoolPrefixQuery struct { // Analyzer Analyzer used to convert the text in the query value into tokens. Analyzer *string `json:"analyzer,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matchnonequery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matchnonequery.go index 7ed1a61a9..99ce0b959 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matchnonequery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matchnonequery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MatchNoneQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/MatchNoneQuery.ts#L22-L22 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/MatchNoneQuery.ts#L22-L22 type MatchNoneQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matchonlytextproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matchonlytextproperty.go index 4e6e84009..476694fdb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matchonlytextproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matchonlytextproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // MatchOnlyTextProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/core.ts#L215-L240 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/core.ts#L215-L240 type MatchOnlyTextProperty struct { // CopyTo Allows you to copy the values of multiple fields into a group // field, which can then be queried as a single field. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matchphraseprefixquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matchphraseprefixquery.go index 9bdf2e12f..0e293a27e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matchphraseprefixquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matchphraseprefixquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // MatchPhrasePrefixQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/fulltext.ts#L428-L454 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/fulltext.ts#L428-L454 type MatchPhrasePrefixQuery struct { // Analyzer Analyzer used to convert text in the query value into tokens. Analyzer *string `json:"analyzer,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matchphrasequery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matchphrasequery.go index 3c7aac798..8edf58b1e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matchphrasequery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matchphrasequery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // MatchPhraseQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/fulltext.ts#L405-L426 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/fulltext.ts#L405-L426 type MatchPhraseQuery struct { // Analyzer Analyzer used to convert the text in the query value into tokens. Analyzer *string `json:"analyzer,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matchquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matchquery.go index f69923f6f..219f8bf28 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matchquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matchquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -33,7 +33,7 @@ import ( // MatchQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/fulltext.ts#L282-L347 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/fulltext.ts#L282-L347 type MatchQuery struct { // Analyzer Analyzer used to convert the text in the query value into tokens. Analyzer *string `json:"analyzer,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matrixaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matrixaggregation.go index 1763a9816..593b97983 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matrixaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matrixaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MatrixAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/matrix.ts#L26-L36 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/matrix.ts#L26-L36 type MatrixAggregation struct { // Fields An array of fields for computing the statistics. Fields []string `json:"fields,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matrixstatsaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matrixstatsaggregate.go index 32534249e..0f4f909cc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matrixstatsaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matrixstatsaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MatrixStatsAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L757-L761 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L757-L761 type MatrixStatsAggregate struct { DocCount int64 `json:"doc_count"` Fields []MatrixStatsFields `json:"fields,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matrixstatsaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matrixstatsaggregation.go index b76acdcea..65243c568 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matrixstatsaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matrixstatsaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // MatrixStatsAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/matrix.ts#L38-L44 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/matrix.ts#L38-L44 type MatrixStatsAggregation struct { // Fields An array of fields for computing the statistics. Fields []string `json:"fields,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matrixstatsfields.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matrixstatsfields.go index 4a4bccfe5..0c7a3cd14 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matrixstatsfields.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/matrixstatsfields.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MatrixStatsFields type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L763-L772 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L763-L772 type MatrixStatsFields struct { Correlation map[string]Float64 `json:"correlation"` Count int64 `json:"count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/maxaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/maxaggregate.go index 90fed6906..bf341d21f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/maxaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/maxaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MaxAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L200-L201 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L200-L201 type MaxAggregate struct { Meta Metadata `json:"meta,omitempty"` // Value The metric value. A missing value generally means that there was no data to diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/maxaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/maxaggregation.go index 58c0e2621..9fa3f7595 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/maxaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/maxaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MaxAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L162-L162 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L162-L162 type MaxAggregation struct { // Field The field on which to run the aggregation. Field *string `json:"field,omitempty"` @@ -79,9 +79,40 @@ func (s *MaxAggregation) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } } } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/maxbucketaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/maxbucketaggregation.go index 43118ffbe..4c12dab6c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/maxbucketaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/maxbucketaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // MaxBucketAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L224-L224 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L224-L224 type MaxBucketAggregation struct { // BucketsPath Path to the buckets that contain one set of values to correlate. BucketsPath BucketsPath `json:"buckets_path,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/medianabsolutedeviationaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/medianabsolutedeviationaggregate.go index 19c94e7c4..fc5468271 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/medianabsolutedeviationaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/medianabsolutedeviationaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MedianAbsoluteDeviationAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L194-L195 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L194-L195 type MedianAbsoluteDeviationAggregate struct { Meta Metadata `json:"meta,omitempty"` // Value The metric value. A missing value generally means that there was no data to diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/medianabsolutedeviationaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/medianabsolutedeviationaggregation.go index 91149eebd..34e4eb4a5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/medianabsolutedeviationaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/medianabsolutedeviationaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MedianAbsoluteDeviationAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L164-L170 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L164-L170 type MedianAbsoluteDeviationAggregation struct { // Compression Limits the maximum number of nodes used by the underlying TDigest algorithm // to `20 * compression`, enabling control of memory usage and approximation @@ -99,9 +99,40 @@ func (s *MedianAbsoluteDeviationAggregation) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } } } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/memmlstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/memmlstats.go index 59baac684..001fa5cce 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/memmlstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/memmlstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MemMlStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/get_memory_stats/types.ts#L90-L111 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/get_memory_stats/types.ts#L90-L111 type MemMlStats struct { // AnomalyDetectors Amount of native memory set aside for anomaly detection jobs. AnomalyDetectors ByteSize `json:"anomaly_detectors,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/memory.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/memory.go index f33468616..1db85facd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/memory.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/memory.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // Memory type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/get_memory_stats/types.ts#L25-L48 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/get_memory_stats/types.ts#L25-L48 type Memory struct { Attributes map[string]string `json:"attributes"` EphemeralId string `json:"ephemeral_id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/memorystats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/memorystats.go index 59a786e87..2dd028359 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/memorystats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/memorystats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MemoryStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L596-L620 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L596-L620 type MemoryStats struct { // AdjustedTotalInBytes If the amount of physical memory has been overridden using the // `es`.`total_memory_bytes` system property then this reports the overridden diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/memstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/memstats.go index 554d3c2ce..32adf0b6d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/memstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/memstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MemStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/get_memory_stats/types.ts#L65-L88 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/get_memory_stats/types.ts#L65-L88 type MemStats struct { // AdjustedTotal If the amount of physical memory has been overridden using the // es.total_memory_bytes system property diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/merge.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/merge.go index f37239fd6..da32ddc1b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/merge.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/merge.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // Merge type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L323-L325 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L323-L325 type Merge struct { Scheduler *MergeScheduler `json:"scheduler,omitempty"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mergescheduler.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mergescheduler.go index 612abf9a2..4b18fa3ae 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mergescheduler.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mergescheduler.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // MergeScheduler type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L327-L330 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L327-L330 type MergeScheduler struct { MaxMergeCount Stringifiedinteger `json:"max_merge_count,omitempty"` MaxThreadCount Stringifiedinteger `json:"max_thread_count,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mergesstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mergesstats.go index 4b507899c..c3f52dce3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mergesstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mergesstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MergesStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Stats.ts#L161-L178 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Stats.ts#L161-L178 type MergesStats struct { Current int64 `json:"current"` CurrentDocs int64 `json:"current_docs"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/metadata.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/metadata.go index 26db4f57f..e92af6de5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/metadata.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/metadata.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,5 +26,5 @@ import ( // Metadata type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L93-L93 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L104-L104 type Metadata map[string]json.RawMessage diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/metrics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/metrics.go index 7e84b28f5..73bda86b5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/metrics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/metrics.go @@ -16,11 +16,11 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // Metrics type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L70-L70 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L76-L76 type Metrics []string diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mgetoperation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mgetoperation.go index 08042763f..aea0e9c31 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mgetoperation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mgetoperation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // MgetOperation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/mget/types.ts#L32-L55 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/mget/types.ts#L32-L55 type MgetOperation struct { // Id_ The unique document ID. Id_ string `json:"_id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mgetresponseitem.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mgetresponseitem.go index 69289ae1d..6c50afece 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mgetresponseitem.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mgetresponseitem.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // GetResult // MultiGetError // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/mget/types.ts#L57-L60 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/mget/types.ts#L57-L60 type MgetResponseItem interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/migrationfeatureindexinfo.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/migrationfeatureindexinfo.go index 9c107b8e9..15350ddf6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/migrationfeatureindexinfo.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/migrationfeatureindexinfo.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // MigrationFeatureIndexInfo type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/migration/get_feature_upgrade_status/GetFeatureUpgradeStatusResponse.ts#L44-L48 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/migration/get_feature_upgrade_status/GetFeatureUpgradeStatusResponse.ts#L44-L48 type MigrationFeatureIndexInfo struct { FailureCause *ErrorCause `json:"failure_cause,omitempty"` Index string `json:"index"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/minaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/minaggregate.go index 44038d368..d095d12b3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/minaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/minaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MinAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L197-L198 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L197-L198 type MinAggregate struct { Meta Metadata `json:"meta,omitempty"` // Value The metric value. A missing value generally means that there was no data to diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/minaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/minaggregation.go index a27ab72b4..085584019 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/minaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/minaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MinAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L172-L172 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L172-L172 type MinAggregation struct { // Field The field on which to run the aggregation. Field *string `json:"field,omitempty"` @@ -79,9 +79,40 @@ func (s *MinAggregation) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } } } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/minbucketaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/minbucketaggregation.go index 5861d3fa0..0a42a8fc6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/minbucketaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/minbucketaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // MinBucketAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L226-L226 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L226-L226 type MinBucketAggregation struct { // BucketsPath Path to the buckets that contain one set of values to correlate. BucketsPath BucketsPath `json:"buckets_path,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/minimallicenseinformation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/minimallicenseinformation.go index 1aa2f362e..a59162b49 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/minimallicenseinformation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/minimallicenseinformation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -33,7 +33,7 @@ import ( // MinimalLicenseInformation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/info/types.ts#L34-L40 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/info/types.ts#L34-L40 type MinimalLicenseInformation struct { ExpiryDateInMillis int64 `json:"expiry_date_in_millis"` Mode licensetype.LicenseType `json:"mode"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/minimumshouldmatch.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/minimumshouldmatch.go index 44a121103..3831b1625 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/minimumshouldmatch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/minimumshouldmatch.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // int // string // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L157-L161 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L168-L172 type MinimumShouldMatch interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/missing.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/missing.go index 444c2efc7..1143499cd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/missing.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/missing.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -27,5 +27,5 @@ package types // Float64 // bool // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/AggregationContainer.ts#L517-L517 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/AggregationContainer.ts#L517-L517 type Missing interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/missingaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/missingaggregate.go index d225b561c..621c44760 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/missingaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/missingaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // MissingAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L483-L484 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L483-L484 type MissingAggregate struct { Aggregations map[string]Aggregate `json:"-"` DocCount int64 `json:"doc_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/missingaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/missingaggregation.go index a8d490ee1..2036e5f0f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/missingaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/missingaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MissingAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L574-L580 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L574-L580 type MissingAggregation struct { // Field The name of the field. Field *string `json:"field,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlcounter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlcounter.go index 4748023c1..89e07afed 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlcounter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlcounter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MlCounter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L255-L257 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L255-L257 type MlCounter struct { Count int64 `json:"count"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mldatafeed.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mldatafeed.go index 495e1f8de..49ad8112e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mldatafeed.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mldatafeed.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MLDatafeed type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Datafeed.ts#L37-L58 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Datafeed.ts#L37-L58 type MLDatafeed struct { Aggregations map[string]Aggregations `json:"aggregations,omitempty"` // Authorization The security privileges that the datafeed uses to run its queries. If Elastic diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mldataframeanalyticsjobs.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mldataframeanalyticsjobs.go index ce9025c27..4de8b0808 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mldataframeanalyticsjobs.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mldataframeanalyticsjobs.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // MlDataFrameAnalyticsJobs type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L177-L182 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L177-L182 type MlDataFrameAnalyticsJobs struct { All_ MlDataFrameAnalyticsJobsCount `json:"_all"` AnalysisCounts *MlDataFrameAnalyticsJobsAnalysis `json:"analysis_counts,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mldataframeanalyticsjobsanalysis.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mldataframeanalyticsjobsanalysis.go index e244c46a2..d3ac6cf0d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mldataframeanalyticsjobsanalysis.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mldataframeanalyticsjobsanalysis.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MlDataFrameAnalyticsJobsAnalysis type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L184-L188 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L184-L188 type MlDataFrameAnalyticsJobsAnalysis struct { Classification *int `json:"classification,omitempty"` OutlierDetection *int `json:"outlier_detection,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mldataframeanalyticsjobscount.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mldataframeanalyticsjobscount.go index 8e83ca363..5dc780427 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mldataframeanalyticsjobscount.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mldataframeanalyticsjobscount.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MlDataFrameAnalyticsJobsCount type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L194-L196 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L194-L196 type MlDataFrameAnalyticsJobsCount struct { Count int64 `json:"count"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mldataframeanalyticsjobsmemory.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mldataframeanalyticsjobsmemory.go index fcb26fd86..05c6183e1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mldataframeanalyticsjobsmemory.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mldataframeanalyticsjobsmemory.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // MlDataFrameAnalyticsJobsMemory type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L190-L192 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L190-L192 type MlDataFrameAnalyticsJobsMemory struct { PeakUsageBytes JobStatistics `json:"peak_usage_bytes"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlfilter.go index ca9f3d1a1..dd55a42a6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MLFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Filter.ts#L22-L29 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Filter.ts#L22-L29 type MLFilter struct { // Description A description of the filter. Description *string `json:"description,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlinference.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlinference.go index 45657542d..113dc8340 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlinference.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlinference.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // MlInference type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L198-L206 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L198-L206 type MlInference struct { Deployments *MlInferenceDeployments `json:"deployments,omitempty"` IngestProcessors map[string]MlInferenceIngestProcessor `json:"ingest_processors"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlinferencedeployments.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlinferencedeployments.go index 7fe6dd478..516c6aa4a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlinferencedeployments.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlinferencedeployments.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MlInferenceDeployments type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L227-L232 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L227-L232 type MlInferenceDeployments struct { Count int `json:"count"` InferenceCounts JobStatistics `json:"inference_counts"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlinferencedeploymentstimems.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlinferencedeploymentstimems.go index c2f879373..ef76c9ea7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlinferencedeploymentstimems.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlinferencedeploymentstimems.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MlInferenceDeploymentsTimeMs type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L234-L236 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L234-L236 type MlInferenceDeploymentsTimeMs struct { Avg Float64 `json:"avg"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlinferenceingestprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlinferenceingestprocessor.go index 5dc596ac9..bee035094 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlinferenceingestprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlinferenceingestprocessor.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // MlInferenceIngestProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L208-L213 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L208-L213 type MlInferenceIngestProcessor struct { NumDocsProcessed MlInferenceIngestProcessorCount `json:"num_docs_processed"` NumFailures MlInferenceIngestProcessorCount `json:"num_failures"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlinferenceingestprocessorcount.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlinferenceingestprocessorcount.go index 1da849904..8d47c4d9b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlinferenceingestprocessorcount.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlinferenceingestprocessorcount.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MlInferenceIngestProcessorCount type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L238-L242 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L238-L242 type MlInferenceIngestProcessorCount struct { Max int64 `json:"max"` Min int64 `json:"min"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlinferencetrainedmodels.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlinferencetrainedmodels.go index f00aefa96..652b7a7fe 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlinferencetrainedmodels.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlinferencetrainedmodels.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // MlInferenceTrainedModels type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L215-L225 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L215-L225 type MlInferenceTrainedModels struct { All_ MlCounter `json:"_all"` Count *MlInferenceTrainedModelsCount `json:"count,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlinferencetrainedmodelscount.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlinferencetrainedmodelscount.go index a8208d779..d953c2dea 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlinferencetrainedmodelscount.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mlinferencetrainedmodelscount.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MlInferenceTrainedModelsCount type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L244-L253 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L244-L253 type MlInferenceTrainedModelsCount struct { Classification *int64 `json:"classification,omitempty"` Ner *int64 `json:"ner,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mljobforecasts.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mljobforecasts.go index 79bf844eb..54da796a3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mljobforecasts.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mljobforecasts.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MlJobForecasts type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L172-L175 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L172-L175 type MlJobForecasts struct { ForecastedJobs int64 `json:"forecasted_jobs"` Total int64 `json:"total"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/modelconfig.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/modelconfig.go new file mode 100644 index 000000000..9b5f1b04f --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/modelconfig.go @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated from the elasticsearch-specification DO NOT EDIT. +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c + +package types + +import ( + "bytes" + "encoding/json" + "errors" + "io" + "strconv" +) + +// ModelConfig type. +// +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/inference/_types/Services.ts#L23-L39 +type ModelConfig struct { + // Service The service type + Service string `json:"service"` + // ServiceSettings Settings specific to the service + ServiceSettings json.RawMessage `json:"service_settings"` + // TaskSettings Task settings specific to the service and model + TaskSettings json.RawMessage `json:"task_settings"` +} + +func (s *ModelConfig) UnmarshalJSON(data []byte) error { + + dec := json.NewDecoder(bytes.NewReader(data)) + + for { + t, err := dec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "service": + var tmp json.RawMessage + if err := dec.Decode(&tmp); err != nil { + return err + } + o := string(tmp[:]) + o, err = strconv.Unquote(o) + if err != nil { + o = string(tmp[:]) + } + s.Service = o + + case "service_settings": + if err := dec.Decode(&s.ServiceSettings); err != nil { + return err + } + + case "task_settings": + if err := dec.Decode(&s.TaskSettings); err != nil { + return err + } + + } + } + return nil +} + +// NewModelConfig returns a ModelConfig. +func NewModelConfig() *ModelConfig { + r := &ModelConfig{} + + return r +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/modelconfigcontainer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/modelconfigcontainer.go new file mode 100644 index 000000000..5841f1b3f --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/modelconfigcontainer.go @@ -0,0 +1,113 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated from the elasticsearch-specification DO NOT EDIT. +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c + +package types + +import ( + "bytes" + "encoding/json" + "errors" + "io" + "strconv" + + "github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/tasktype" +) + +// ModelConfigContainer type. +// +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/inference/_types/Services.ts#L41-L53 +type ModelConfigContainer struct { + // ModelId The model Id + ModelId string `json:"model_id"` + // Service The service type + Service string `json:"service"` + // ServiceSettings Settings specific to the service + ServiceSettings json.RawMessage `json:"service_settings"` + // TaskSettings Task settings specific to the service and model + TaskSettings json.RawMessage `json:"task_settings"` + // TaskType The model's task type + TaskType tasktype.TaskType `json:"task_type"` +} + +func (s *ModelConfigContainer) UnmarshalJSON(data []byte) error { + + dec := json.NewDecoder(bytes.NewReader(data)) + + for { + t, err := dec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "model_id": + var tmp json.RawMessage + if err := dec.Decode(&tmp); err != nil { + return err + } + o := string(tmp[:]) + o, err = strconv.Unquote(o) + if err != nil { + o = string(tmp[:]) + } + s.ModelId = o + + case "service": + var tmp json.RawMessage + if err := dec.Decode(&tmp); err != nil { + return err + } + o := string(tmp[:]) + o, err = strconv.Unquote(o) + if err != nil { + o = string(tmp[:]) + } + s.Service = o + + case "service_settings": + if err := dec.Decode(&s.ServiceSettings); err != nil { + return err + } + + case "task_settings": + if err := dec.Decode(&s.TaskSettings); err != nil { + return err + } + + case "task_type": + if err := dec.Decode(&s.TaskType); err != nil { + return err + } + + } + } + return nil +} + +// NewModelConfigContainer returns a ModelConfigContainer. +func NewModelConfigContainer() *ModelConfigContainer { + r := &ModelConfigContainer{} + + return r +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/modelplotconfig.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/modelplotconfig.go index 649c7e80d..ada0b9289 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/modelplotconfig.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/modelplotconfig.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ModelPlotConfig type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/ModelPlot.ts#L23-L42 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/ModelPlot.ts#L23-L42 type ModelPlotConfig struct { // AnnotationsEnabled If true, enables calculation and storage of the model change annotations for // each entity that is being analyzed. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/modelsizestats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/modelsizestats.go index 6ed296dcb..c67729027 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/modelsizestats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/modelsizestats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -33,7 +33,7 @@ import ( // ModelSizeStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Model.ts#L59-L81 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Model.ts#L59-L81 type ModelSizeStats struct { AssignmentMemoryBasis *string `json:"assignment_memory_basis,omitempty"` BucketAllocationFailuresCount int64 `json:"bucket_allocation_failures_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/modelsnapshot.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/modelsnapshot.go index 44cb7b27d..3b4d1ca14 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/modelsnapshot.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/modelsnapshot.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ModelSnapshot type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Model.ts#L25-L46 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Model.ts#L25-L46 type ModelSnapshot struct { // Description An optional description of the job. Description *string `json:"description,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/modelsnapshotupgrade.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/modelsnapshotupgrade.go index 54978beb2..64a0b79db 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/modelsnapshotupgrade.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/modelsnapshotupgrade.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // ModelSnapshotUpgrade type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Model.ts#L48-L57 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Model.ts#L48-L57 type ModelSnapshotUpgrade struct { AssignmentExplanation string `json:"assignment_explanation"` JobId string `json:"job_id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/monitoring.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/monitoring.go index e4d6ad9c4..dbc84865c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/monitoring.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/monitoring.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Monitoring type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L381-L384 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L381-L384 type Monitoring struct { Available bool `json:"available"` CollectionEnabled bool `json:"collection_enabled"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/morelikethisquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/morelikethisquery.go index 10434db6b..15f6e78cb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/morelikethisquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/morelikethisquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // MoreLikeThisQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/specialized.ts#L78-L163 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/specialized.ts#L78-L163 type MoreLikeThisQuery struct { // Analyzer The analyzer that is used to analyze the free form text. // Defaults to the analyzer associated with the first field in fields. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mountedsnapshot.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mountedsnapshot.go index f62d29445..77107992b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mountedsnapshot.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mountedsnapshot.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // MountedSnapshot type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/searchable_snapshots/mount/types.ts#L23-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/searchable_snapshots/mount/types.ts#L23-L27 type MountedSnapshot struct { Indices []string `json:"indices"` Shards ShardStatistics `json:"shards"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/movingaverageaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/movingaverageaggregation.go index 16912bc01..0e2936fc4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/movingaverageaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/movingaverageaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -28,5 +28,5 @@ package types // HoltMovingAverageAggregation // HoltWintersMovingAverageAggregation // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L228-L234 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L228-L234 type MovingAverageAggregation interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/movingfunctionaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/movingfunctionaggregation.go index 06dd22cbf..06c140aed 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/movingfunctionaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/movingfunctionaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // MovingFunctionAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L290-L305 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L290-L305 type MovingFunctionAggregation struct { // BucketsPath Path to the buckets that contain one set of values to correlate. BucketsPath BucketsPath `json:"buckets_path,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/movingpercentilesaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/movingpercentilesaggregation.go index 1d1fdd06d..72fd0a59c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/movingpercentilesaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/movingpercentilesaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // MovingPercentilesAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L307-L319 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L307-L319 type MovingPercentilesAggregation struct { // BucketsPath Path to the buckets that contain one set of values to correlate. BucketsPath BucketsPath `json:"buckets_path,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/msearchrequestitem.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/msearchrequestitem.go index 7b9e7d4d6..c0e18ae8e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/msearchrequestitem.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/msearchrequestitem.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // MultisearchHeader // MultisearchBody // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/msearch/types.ts#L48-L51 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/msearch/types.ts#L48-L51 type MsearchRequestItem interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/msearchresponseitem.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/msearchresponseitem.go index 98466f4c0..b7cffbeed 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/msearchresponseitem.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/msearchresponseitem.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // MultiSearchItem // ErrorResponseBase // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/msearch/types.ts#L209-L212 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/msearch/types.ts#L209-L212 type MsearchResponseItem interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mtermvectorsoperation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mtermvectorsoperation.go index 2ef8d0ec5..93c6ba482 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mtermvectorsoperation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mtermvectorsoperation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // MTermVectorsOperation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/mtermvectors/types.ts#L35-L94 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/mtermvectors/types.ts#L35-L94 type MTermVectorsOperation struct { // Doc An artificial document (a document not present in the index) for which you // want to retrieve term vectors. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebaseadjacencymatrixbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebaseadjacencymatrixbucket.go index bf4702442..5caa72c7c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebaseadjacencymatrixbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebaseadjacencymatrixbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // MultiBucketAggregateBaseAdjacencyMatrixBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L327-L329 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L327-L329 type MultiBucketAggregateBaseAdjacencyMatrixBucket struct { Buckets BucketsAdjacencyMatrixBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasecompositebucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasecompositebucket.go index a2d4bc2bf..f481c166f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasecompositebucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasecompositebucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // MultiBucketAggregateBaseCompositeBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L327-L329 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L327-L329 type MultiBucketAggregateBaseCompositeBucket struct { Buckets BucketsCompositeBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasedatehistogrambucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasedatehistogrambucket.go index b90d23d72..a905324ab 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasedatehistogrambucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasedatehistogrambucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // MultiBucketAggregateBaseDateHistogramBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L327-L329 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L327-L329 type MultiBucketAggregateBaseDateHistogramBucket struct { Buckets BucketsDateHistogramBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasedoubletermsbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasedoubletermsbucket.go index e3d2e6164..c36f8b4ec 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasedoubletermsbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasedoubletermsbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // MultiBucketAggregateBaseDoubleTermsBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L327-L329 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L327-L329 type MultiBucketAggregateBaseDoubleTermsBucket struct { Buckets BucketsDoubleTermsBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasefiltersbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasefiltersbucket.go index df74e4b2f..83bb23dfb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasefiltersbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasefiltersbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // MultiBucketAggregateBaseFiltersBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L327-L329 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L327-L329 type MultiBucketAggregateBaseFiltersBucket struct { Buckets BucketsFiltersBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasefrequentitemsetsbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasefrequentitemsetsbucket.go index 4ef14a106..0ee719803 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasefrequentitemsetsbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasefrequentitemsetsbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // MultiBucketAggregateBaseFrequentItemSetsBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L327-L329 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L327-L329 type MultiBucketAggregateBaseFrequentItemSetsBucket struct { Buckets BucketsFrequentItemSetsBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasegeohashgridbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasegeohashgridbucket.go index ea3486c72..e30b44aee 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasegeohashgridbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasegeohashgridbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // MultiBucketAggregateBaseGeoHashGridBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L327-L329 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L327-L329 type MultiBucketAggregateBaseGeoHashGridBucket struct { Buckets BucketsGeoHashGridBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasegeohexgridbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasegeohexgridbucket.go index 985087c6c..4ad19d207 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasegeohexgridbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasegeohexgridbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // MultiBucketAggregateBaseGeoHexGridBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L327-L329 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L327-L329 type MultiBucketAggregateBaseGeoHexGridBucket struct { Buckets BucketsGeoHexGridBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasegeotilegridbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasegeotilegridbucket.go index 24d95ce03..81b78f46a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasegeotilegridbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasegeotilegridbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // MultiBucketAggregateBaseGeoTileGridBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L327-L329 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L327-L329 type MultiBucketAggregateBaseGeoTileGridBucket struct { Buckets BucketsGeoTileGridBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasehistogrambucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasehistogrambucket.go index 684e4e34b..8bf0387b3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasehistogrambucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasehistogrambucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // MultiBucketAggregateBaseHistogramBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L327-L329 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L327-L329 type MultiBucketAggregateBaseHistogramBucket struct { Buckets BucketsHistogramBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebaseipprefixbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebaseipprefixbucket.go index f838afef6..5c437d730 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebaseipprefixbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebaseipprefixbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // MultiBucketAggregateBaseIpPrefixBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L327-L329 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L327-L329 type MultiBucketAggregateBaseIpPrefixBucket struct { Buckets BucketsIpPrefixBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebaseiprangebucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebaseiprangebucket.go index 4e3e18b7d..b2a95614f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebaseiprangebucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebaseiprangebucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // MultiBucketAggregateBaseIpRangeBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L327-L329 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L327-L329 type MultiBucketAggregateBaseIpRangeBucket struct { Buckets BucketsIpRangeBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebaselongraretermsbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebaselongraretermsbucket.go index b552dcc16..fd0622c49 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebaselongraretermsbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebaselongraretermsbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // MultiBucketAggregateBaseLongRareTermsBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L327-L329 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L327-L329 type MultiBucketAggregateBaseLongRareTermsBucket struct { Buckets BucketsLongRareTermsBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebaselongtermsbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebaselongtermsbucket.go index 0afc44180..4b03c2711 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebaselongtermsbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebaselongtermsbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // MultiBucketAggregateBaseLongTermsBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L327-L329 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L327-L329 type MultiBucketAggregateBaseLongTermsBucket struct { Buckets BucketsLongTermsBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasemultitermsbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasemultitermsbucket.go index b9a8adecb..de5a7739b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasemultitermsbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasemultitermsbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // MultiBucketAggregateBaseMultiTermsBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L327-L329 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L327-L329 type MultiBucketAggregateBaseMultiTermsBucket struct { Buckets BucketsMultiTermsBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebaserangebucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebaserangebucket.go index 414a09cc8..cff0b56e7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebaserangebucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebaserangebucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // MultiBucketAggregateBaseRangeBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L327-L329 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L327-L329 type MultiBucketAggregateBaseRangeBucket struct { Buckets BucketsRangeBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasesignificantlongtermsbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasesignificantlongtermsbucket.go index 5d5229c4b..ac56ec1bd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasesignificantlongtermsbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasesignificantlongtermsbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // MultiBucketAggregateBaseSignificantLongTermsBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L327-L329 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L327-L329 type MultiBucketAggregateBaseSignificantLongTermsBucket struct { Buckets BucketsSignificantLongTermsBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasesignificantstringtermsbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasesignificantstringtermsbucket.go index 68433dc87..afae2e8ea 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasesignificantstringtermsbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasesignificantstringtermsbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // MultiBucketAggregateBaseSignificantStringTermsBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L327-L329 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L327-L329 type MultiBucketAggregateBaseSignificantStringTermsBucket struct { Buckets BucketsSignificantStringTermsBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasestringraretermsbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasestringraretermsbucket.go index c69169a03..b0307ce96 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasestringraretermsbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasestringraretermsbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // MultiBucketAggregateBaseStringRareTermsBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L327-L329 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L327-L329 type MultiBucketAggregateBaseStringRareTermsBucket struct { Buckets BucketsStringRareTermsBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasestringtermsbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasestringtermsbucket.go index f0eaf597a..3bcc7ef74 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasestringtermsbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasestringtermsbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // MultiBucketAggregateBaseStringTermsBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L327-L329 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L327-L329 type MultiBucketAggregateBaseStringTermsBucket struct { Buckets BucketsStringTermsBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasevariablewidthhistogrambucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasevariablewidthhistogrambucket.go index ba601e993..be8874cee 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasevariablewidthhistogrambucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasevariablewidthhistogrambucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // MultiBucketAggregateBaseVariableWidthHistogramBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L327-L329 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L327-L329 type MultiBucketAggregateBaseVariableWidthHistogramBucket struct { Buckets BucketsVariableWidthHistogramBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasevoid.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasevoid.go index 2f9a03882..3d092611f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasevoid.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multibucketaggregatebasevoid.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // MultiBucketAggregateBaseVoid type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L327-L329 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L327-L329 type MultiBucketAggregateBaseVoid struct { Buckets BucketsVoid `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multigeterror.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multigeterror.go index 0290e19e5..c0c9b37a0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multigeterror.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multigeterror.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // MultiGetError type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/mget/types.ts#L62-L66 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/mget/types.ts#L62-L66 type MultiGetError struct { Error ErrorCause `json:"error"` Id_ string `json:"_id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multimatchquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multimatchquery.go index 3f8de8f44..ecb69d928 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multimatchquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multimatchquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -34,7 +34,7 @@ import ( // MultiMatchQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/fulltext.ts#L456-L539 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/fulltext.ts#L456-L539 type MultiMatchQuery struct { // Analyzer Analyzer used to convert the text in the query value into tokens. Analyzer *string `json:"analyzer,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multiplexertokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multiplexertokenfilter.go index 3ebe54d9e..0f144225c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multiplexertokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multiplexertokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // MultiplexerTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L260-L264 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L260-L264 type MultiplexerTokenFilter struct { Filters []string `json:"filters"` PreserveOriginal Stringifiedboolean `json:"preserve_original,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multisearchbody.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multisearchbody.go index bea299ccc..02a3c924d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multisearchbody.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multisearchbody.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MultisearchBody type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/msearch/types.ts#L71-L202 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/msearch/types.ts#L71-L202 type MultisearchBody struct { Aggregations map[string]Aggregations `json:"aggregations,omitempty"` Collapse *FieldCollapse `json:"collapse,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multisearchheader.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multisearchheader.go index 4e1e4ce8f..3a1aedc3c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multisearchheader.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multisearchheader.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -33,7 +33,7 @@ import ( // MultisearchHeader type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/msearch/types.ts#L53-L68 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/msearch/types.ts#L53-L68 type MultisearchHeader struct { AllowNoIndices *bool `json:"allow_no_indices,omitempty"` AllowPartialSearchResults *bool `json:"allow_partial_search_results,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multisearchitem.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multisearchitem.go index bc9daded9..ef1dfd529 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multisearchitem.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multisearchitem.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // MultiSearchItem type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/msearch/types.ts#L214-L217 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/msearch/types.ts#L214-L217 type MultiSearchItem struct { Aggregations map[string]Aggregate `json:"aggregations,omitempty"` Clusters_ *ClusterStatistics `json:"_clusters,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multisearchresult.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multisearchresult.go index eff71638a..1646e9c47 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multisearchresult.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multisearchresult.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MultiSearchResult type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/msearch/types.ts#L204-L207 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/msearch/types.ts#L204-L207 type MultiSearchResult struct { Responses []MsearchResponseItem `json:"responses"` Took int64 `json:"took"` @@ -52,9 +52,45 @@ func (s *MultiSearchResult) UnmarshalJSON(data []byte) error { switch t { case "responses": - if err := dec.Decode(&s.Responses); err != nil { + messageArray := []json.RawMessage{} + if err := dec.Decode(&messageArray); err != nil { return err } + responses: + for _, message := range messageArray { + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "aggregations", "_clusters", "fields", "hits", "max_score", "num_reduce_phases", "pit_id", "profile", "_scroll_id", "_shards", "suggest", "terminated_early", "timed_out", "took": + o := NewMultiSearchItem() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Responses = append(s.Responses, o) + continue responses + + case "error": + o := NewErrorResponseBase() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Responses = append(s.Responses, o) + continue responses + + } + } + } case "took": var tmp interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multitermlookup.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multitermlookup.go index dc92cfb1e..17ba7665c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multitermlookup.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multitermlookup.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // MultiTermLookup type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L624-L634 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L624-L634 type MultiTermLookup struct { // Field A fields from which to retrieve terms. Field string `json:"field"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multitermsaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multitermsaggregate.go index bcf6bb87f..156d56ebb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multitermsaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multitermsaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MultiTermsAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L461-L463 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L461-L463 type MultiTermsAggregate struct { Buckets BucketsMultiTermsBucket `json:"buckets"` DocCountErrorUpperBound *int64 `json:"doc_count_error_upper_bound,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multitermsaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multitermsaggregation.go index fe17209ca..e276b4345 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multitermsaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multitermsaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -33,7 +33,7 @@ import ( // MultiTermsAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L582-L622 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L582-L622 type MultiTermsAggregation struct { // CollectMode Specifies the strategy for data collection. CollectMode *termsaggregationcollectmode.TermsAggregationCollectMode `json:"collect_mode,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multitermsbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multitermsbucket.go index 35944de20..96df59b4b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multitermsbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/multitermsbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // MultiTermsBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L465-L469 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L465-L469 type MultiTermsBucket struct { Aggregations map[string]Aggregate `json:"-"` DocCount int64 `json:"doc_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/murmur3hashproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/murmur3hashproperty.go index 5398e4314..4afd3ef0c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/murmur3hashproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/murmur3hashproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // Murmur3HashProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/specialized.ts#L75-L77 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/specialized.ts#L75-L77 type Murmur3HashProperty struct { CopyTo []string `json:"copy_to,omitempty"` DocValues *bool `json:"doc_values,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mutualinformationheuristic.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mutualinformationheuristic.go index cde4c1565..2351903c0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mutualinformationheuristic.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/mutualinformationheuristic.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // MutualInformationHeuristic type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L753-L762 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L753-L762 type MutualInformationHeuristic struct { // BackgroundIsSuperset Set to `false` if you defined a custom background filter that represents a // different set of documents that you want to compare to. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/names.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/names.go index 79c3dfff4..9d8ffe28a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/names.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/names.go @@ -16,11 +16,11 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // Names type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L75-L75 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L86-L86 type Names []string diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nativecode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nativecode.go index d862d918b..efa86cdee 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nativecode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nativecode.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NativeCode type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/info/types.ts#L29-L32 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/info/types.ts#L29-L32 type NativeCode struct { BuildHash string `json:"build_hash"` Version string `json:"version"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nativecodeinformation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nativecodeinformation.go index e3b443a94..c59d5bc45 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nativecodeinformation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nativecodeinformation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NativeCodeInformation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/info/types.ts#L29-L32 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/info/types.ts#L29-L32 type NativeCodeInformation struct { BuildHash string `json:"build_hash"` Version string `json:"version"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nerinferenceoptions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nerinferenceoptions.go index 6926218e2..75e2fd639 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nerinferenceoptions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nerinferenceoptions.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NerInferenceOptions type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/inference.ts#L255-L264 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/inference.ts#L255-L264 type NerInferenceOptions struct { // ClassificationLabels The token classification labels. Must be IOB formatted tags ClassificationLabels []string `json:"classification_labels,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nerinferenceupdateoptions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nerinferenceupdateoptions.go index d7448512c..918dc9b34 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nerinferenceupdateoptions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nerinferenceupdateoptions.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NerInferenceUpdateOptions type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/inference.ts#L404-L409 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/inference.ts#L404-L409 type NerInferenceUpdateOptions struct { // ResultsField The field that is added to incoming documents to contain the inference // prediction. Defaults to predicted_value. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nestedaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nestedaggregate.go index 099e8465b..5c437f757 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nestedaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nestedaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // NestedAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L486-L487 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L486-L487 type NestedAggregate struct { Aggregations map[string]Aggregate `json:"-"` DocCount int64 `json:"doc_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nestedaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nestedaggregation.go index 629d4cbe3..d34642c6f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nestedaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nestedaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NestedAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L636-L641 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L636-L641 type NestedAggregation struct { Meta Metadata `json:"meta,omitempty"` Name *string `json:"name,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nestedidentity.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nestedidentity.go index e0774c7b1..e419ab16b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nestedidentity.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nestedidentity.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NestedIdentity type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/hits.ts#L88-L92 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/hits.ts#L88-L92 type NestedIdentity struct { Field string `json:"field"` Nested_ *NestedIdentity `json:"_nested,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nestedproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nestedproperty.go index ca30b8bbb..774f81655 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nestedproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nestedproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // NestedProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/complex.ts#L39-L44 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/complex.ts#L39-L44 type NestedProperty struct { CopyTo []string `json:"copy_to,omitempty"` Dynamic *dynamicmapping.DynamicMapping `json:"dynamic,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nestedquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nestedquery.go index 00a264540..b6fd5dda4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nestedquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nestedquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // NestedQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/joining.ts#L106-L130 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/joining.ts#L106-L130 type NestedQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nestedsortvalue.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nestedsortvalue.go index 2d843162f..84050e440 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nestedsortvalue.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nestedsortvalue.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NestedSortValue type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/sort.ts#L30-L35 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/sort.ts#L30-L35 type NestedSortValue struct { Filter *Query `json:"filter,omitempty"` MaxChildren *int `json:"max_children,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nevercondition.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nevercondition.go index 176345f23..708b8f236 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nevercondition.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nevercondition.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // NeverCondition type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Conditions.ts#L69-L69 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Conditions.ts#L69-L69 type NeverCondition struct { } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ngramtokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ngramtokenfilter.go index 7cfda913d..a49724d36 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ngramtokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ngramtokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NGramTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L266-L271 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L266-L271 type NGramTokenFilter struct { MaxGram *int `json:"max_gram,omitempty"` MinGram *int `json:"min_gram,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ngramtokenizer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ngramtokenizer.go index 51fc89c8c..de58258c5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ngramtokenizer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ngramtokenizer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // NGramTokenizer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/tokenizers.ts#L39-L45 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/tokenizers.ts#L39-L45 type NGramTokenizer struct { CustomTokenChars *string `json:"custom_token_chars,omitempty"` MaxGram int `json:"max_gram"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nlpberttokenizationconfig.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nlpberttokenizationconfig.go index 206b9f901..4d472b811 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nlpberttokenizationconfig.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nlpberttokenizationconfig.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // NlpBertTokenizationConfig type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/inference.ts#L131-L158 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/inference.ts#L131-L158 type NlpBertTokenizationConfig struct { // DoLowerCase Should the tokenizer lower case the text DoLowerCase *bool `json:"do_lower_case,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nlprobertatokenizationconfig.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nlprobertatokenizationconfig.go index c70795c82..7cfd897bc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nlprobertatokenizationconfig.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nlprobertatokenizationconfig.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // NlpRobertaTokenizationConfig type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/inference.ts#L160-L187 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/inference.ts#L160-L187 type NlpRobertaTokenizationConfig struct { // AddPrefixSpace Should the tokenizer prefix input with a space character AddPrefixSpace *bool `json:"add_prefix_space,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nlptokenizationupdateoptions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nlptokenizationupdateoptions.go index 9656e655a..552f25cdb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nlptokenizationupdateoptions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nlptokenizationupdateoptions.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // NlpTokenizationUpdateOptions type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/inference.ts#L356-L361 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/inference.ts#L356-L361 type NlpTokenizationUpdateOptions struct { // Span Span options to apply Span *int `json:"span,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/node.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/node.go index 6eca85b06..b66b50817 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/node.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/node.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // Node type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/searchable_snapshots/cache_stats/Response.ts#L30-L32 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/searchable_snapshots/cache_stats/Response.ts#L30-L32 type Node struct { SharedCache Shared `json:"shared_cache"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeallocationexplanation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeallocationexplanation.go index cd29e2ef8..1805f1129 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeallocationexplanation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeallocationexplanation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // NodeAllocationExplanation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/allocation_explain/types.ts#L97-L106 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/allocation_explain/types.ts#L97-L106 type NodeAllocationExplanation struct { Deciders []AllocationDecision `json:"deciders"` NodeAttributes map[string]string `json:"node_attributes"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeattributes.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeattributes.go index c89dbb611..e2ed52514 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeattributes.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeattributes.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // NodeAttributes type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Node.ts#L41-L58 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Node.ts#L41-L58 type NodeAttributes struct { // Attributes Lists node attributes. Attributes map[string]string `json:"attributes"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeattributesrecord.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeattributesrecord.go index 0ec76feed..2fb5df63f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeattributesrecord.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeattributesrecord.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeAttributesRecord type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/nodeattrs/types.ts#L20-L55 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/nodeattrs/types.ts#L20-L55 type NodeAttributesRecord struct { // Attr The attribute name. Attr *string `json:"attr,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodebufferpool.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodebufferpool.go index 47c30ea25..f12070884 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodebufferpool.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodebufferpool.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeBufferPool type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L788-L809 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L788-L809 type NodeBufferPool struct { // Count Number of buffer pools. Count *int64 `json:"count,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodediskusage.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodediskusage.go index d3eb6387d..ea036d204 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodediskusage.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodediskusage.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // NodeDiskUsage type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/allocation_explain/types.ts#L56-L60 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/allocation_explain/types.ts#L56-L60 type NodeDiskUsage struct { LeastAvailable DiskUsage `json:"least_available"` MostAvailable DiskUsage `json:"most_available"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeids.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeids.go index 9faec40e9..19209f997 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeids.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeids.go @@ -16,11 +16,11 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // NodeIds type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L58-L58 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L64-L64 type NodeIds []string diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfo.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfo.go index b849a677c..a417c6b34 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfo.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfo.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // NodeInfo type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L30-L66 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L30-L66 type NodeInfo struct { Aggregations map[string]NodeInfoAggregation `json:"aggregations,omitempty"` Attributes map[string]string `json:"attributes"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoaction.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoaction.go index d5563e977..a65d41752 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoaction.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoaction.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeInfoAction type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L176-L178 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L176-L178 type NodeInfoAction struct { DestructiveRequiresName string `json:"destructive_requires_name"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoaggregation.go index 63ff2cbcf..7b77de8a4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoaggregation.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // NodeInfoAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L227-L229 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L227-L229 type NodeInfoAggregation struct { Types []string `json:"types"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfobootstrap.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfobootstrap.go index 0b3a8284b..a3c4f33c3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfobootstrap.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfobootstrap.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeInfoBootstrap type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L196-L198 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L196-L198 type NodeInfoBootstrap struct { MemoryLock string `json:"memory_lock"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoclient.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoclient.go index 14b8bf703..20bdc8a97 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoclient.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoclient.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeInfoClient type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L180-L182 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L180-L182 type NodeInfoClient struct { Type string `json:"type"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfodiscover.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfodiscover.go index d6aeb06f6..dbf13685e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfodiscover.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfodiscover.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeInfoDiscover type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L172-L174 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L172-L174 type NodeInfoDiscover struct { SeedHosts string `json:"seed_hosts"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfohttp.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfohttp.go index d373746d3..9829391c2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfohttp.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfohttp.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeInfoHttp type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L298-L303 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L298-L303 type NodeInfoHttp struct { BoundAddress []string `json:"bound_address"` MaxContentLength ByteSize `json:"max_content_length,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoingest.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoingest.go index 83d3b0d61..80003461c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoingest.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoingest.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // NodeInfoIngest type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L219-L221 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L219-L221 type NodeInfoIngest struct { Processors []NodeInfoIngestProcessor `json:"processors"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoingestdownloader.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoingestdownloader.go index 265c123b1..10a918ae2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoingestdownloader.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoingestdownloader.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeInfoIngestDownloader type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L127-L129 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L127-L129 type NodeInfoIngestDownloader struct { Enabled string `json:"enabled"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoingestinfo.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoingestinfo.go index 97526c575..c899ea4a2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoingestinfo.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoingestinfo.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // NodeInfoIngestInfo type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L123-L125 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L123-L125 type NodeInfoIngestInfo struct { Downloader NodeInfoIngestDownloader `json:"downloader"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoingestprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoingestprocessor.go index 61e3768bc..22f7db20d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoingestprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoingestprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeInfoIngestProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L223-L225 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L223-L225 type NodeInfoIngestProcessor struct { Type string `json:"type"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfojvmmemory.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfojvmmemory.go index 918f4883b..8a024e090 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfojvmmemory.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfojvmmemory.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeInfoJvmMemory type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L305-L316 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L305-L316 type NodeInfoJvmMemory struct { DirectMax ByteSize `json:"direct_max,omitempty"` DirectMaxInBytes int64 `json:"direct_max_in_bytes"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfomemory.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfomemory.go index 0bd640122..6221bd86a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfomemory.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfomemory.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeInfoMemory type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L318-L321 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L318-L321 type NodeInfoMemory struct { Total string `json:"total"` TotalInBytes int64 `json:"total_in_bytes"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfonetwork.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfonetwork.go index 756838cf8..cbf842469 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfonetwork.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfonetwork.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeInfoNetwork type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L323-L326 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L323-L326 type NodeInfoNetwork struct { PrimaryInterface NodeInfoNetworkInterface `json:"primary_interface"` RefreshInterval int `json:"refresh_interval"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfonetworkinterface.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfonetworkinterface.go index 037fa727c..572b5840e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfonetworkinterface.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfonetworkinterface.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeInfoNetworkInterface type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L328-L332 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L328-L332 type NodeInfoNetworkInterface struct { Address string `json:"address"` MacAddress string `json:"mac_address"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfooscpu.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfooscpu.go index e268e2ef6..86daa7524 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfooscpu.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfooscpu.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeInfoOSCPU type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L334-L343 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L334-L343 type NodeInfoOSCPU struct { CacheSize string `json:"cache_size"` CacheSizeInBytes int `json:"cache_size_in_bytes"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfopath.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfopath.go index 331e156c0..8d62b7e18 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfopath.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfopath.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeInfoPath type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L157-L162 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L157-L162 type NodeInfoPath struct { Data []string `json:"data,omitempty"` Home string `json:"home"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinforepositories.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinforepositories.go index bd3d2a89e..7b7370d82 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinforepositories.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinforepositories.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // NodeInfoRepositories type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L164-L166 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L164-L166 type NodeInfoRepositories struct { Url NodeInfoRepositoriesUrl `json:"url"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinforepositoriesurl.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinforepositoriesurl.go index a3c3924cf..ed0f55345 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinforepositoriesurl.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinforepositoriesurl.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeInfoRepositoriesUrl type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L168-L170 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L168-L170 type NodeInfoRepositoriesUrl struct { AllowedUrls string `json:"allowed_urls"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoscript.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoscript.go index 21fb4dead..8e8db1cf1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoscript.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoscript.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeInfoScript type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L276-L279 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L276-L279 type NodeInfoScript struct { AllowedTypes string `json:"allowed_types"` DisableMaxCompilationsRate string `json:"disable_max_compilations_rate"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosearch.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosearch.go index e52017585..3678c352b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosearch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosearch.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // NodeInfoSearch type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L281-L283 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L281-L283 type NodeInfoSearch struct { Remote NodeInfoSearchRemote `json:"remote"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosearchremote.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosearchremote.go index 9ea0ca55a..8f8cefea8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosearchremote.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosearchremote.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeInfoSearchRemote type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L285-L287 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L285-L287 type NodeInfoSearchRemote struct { Connect string `json:"connect"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettings.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettings.go index 0b526e373..9b38f3288 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettings.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // NodeInfoSettings type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L68-L84 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L68-L84 type NodeInfoSettings struct { Action *NodeInfoAction `json:"action,omitempty"` Bootstrap *NodeInfoBootstrap `json:"bootstrap,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingscluster.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingscluster.go index 616adde04..c2e2d7770 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingscluster.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingscluster.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeInfoSettingsCluster type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L131-L141 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L131-L141 type NodeInfoSettingsCluster struct { DeprecationIndexing *DeprecationIndexing `json:"deprecation_indexing,omitempty"` Election NodeInfoSettingsClusterElection `json:"election"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingsclusterelection.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingsclusterelection.go index f9fdcd00f..bb7958ff8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingsclusterelection.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingsclusterelection.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // NodeInfoSettingsClusterElection type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L147-L149 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L147-L149 type NodeInfoSettingsClusterElection struct { Strategy string `json:"strategy"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingshttp.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingshttp.go index afb6f08ee..c5b8e71f2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingshttp.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingshttp.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeInfoSettingsHttp type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L184-L189 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L184-L189 type NodeInfoSettingsHttp struct { Compression string `json:"compression,omitempty"` Port string `json:"port,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingshttptype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingshttptype.go index ff4d4fbb4..e48ed1861 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingshttptype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingshttptype.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeInfoSettingsHttpType type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L191-L194 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L191-L194 type NodeInfoSettingsHttpType struct { Default string `json:"default"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingsingest.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingsingest.go index 9072911d6..f255d1339 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingsingest.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingsingest.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // NodeInfoSettingsIngest type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L86-L121 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L86-L121 type NodeInfoSettingsIngest struct { Append *NodeInfoIngestInfo `json:"append,omitempty"` Attachment *NodeInfoIngestInfo `json:"attachment,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingsnetwork.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingsnetwork.go index 32a0ee9a6..ff691561d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingsnetwork.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingsnetwork.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // NodeInfoSettingsNetwork type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L215-L217 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L215-L217 type NodeInfoSettingsNetwork struct { Host string `json:"host"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingsnode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingsnode.go index 9e25e1c21..016bb1f2e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingsnode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingsnode.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeInfoSettingsNode type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L151-L155 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L151-L155 type NodeInfoSettingsNode struct { Attr map[string]json.RawMessage `json:"attr"` MaxLocalStorageNodes *string `json:"max_local_storage_nodes,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingstransport.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingstransport.go index 8aa34f8af..0a224de4b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingstransport.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingstransport.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeInfoSettingsTransport type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L200-L204 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L200-L204 type NodeInfoSettingsTransport struct { Features *NodeInfoSettingsTransportFeatures `json:"features,omitempty"` Type NodeInfoSettingsTransportType `json:"type"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingstransportfeatures.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingstransportfeatures.go index ba450c61f..df3e9863b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingstransportfeatures.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingstransportfeatures.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeInfoSettingsTransportFeatures type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L211-L213 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L211-L213 type NodeInfoSettingsTransportFeatures struct { XPack string `json:"x-pack"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingstransporttype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingstransporttype.go index c4769ce96..b01143d60 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingstransporttype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfosettingstransporttype.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeInfoSettingsTransportType type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L206-L209 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L206-L209 type NodeInfoSettingsTransportType struct { Default string `json:"default"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfotransport.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfotransport.go index 7b5e2b050..6a8a36e18 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfotransport.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfotransport.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeInfoTransport type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L345-L349 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L345-L349 type NodeInfoTransport struct { BoundAddress []string `json:"bound_address"` Profiles map[string]string `json:"profiles"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpack.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpack.go index 893ec1111..9755852e6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpack.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpack.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,7 +26,7 @@ import ( // NodeInfoXpack type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L231-L235 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L231-L235 type NodeInfoXpack struct { License *NodeInfoXpackLicense `json:"license,omitempty"` Notification map[string]json.RawMessage `json:"notification,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpacklicense.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpacklicense.go index ca804eb3c..a573c1692 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpacklicense.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpacklicense.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // NodeInfoXpackLicense type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L268-L270 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L268-L270 type NodeInfoXpackLicense struct { SelfGenerated NodeInfoXpackLicenseType `json:"self_generated"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpacklicensetype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpacklicensetype.go index 07efbd9c0..3aac9dc3e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpacklicensetype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpacklicensetype.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeInfoXpackLicenseType type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L272-L274 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L272-L274 type NodeInfoXpackLicenseType struct { Type string `json:"type"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpacksecurity.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpacksecurity.go index cecd31980..9eedb3504 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpacksecurity.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpacksecurity.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeInfoXpackSecurity type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L237-L242 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L237-L242 type NodeInfoXpackSecurity struct { Authc *NodeInfoXpackSecurityAuthc `json:"authc,omitempty"` Enabled string `json:"enabled"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpacksecurityauthc.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpacksecurityauthc.go index 44bbea631..976081aa7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpacksecurityauthc.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpacksecurityauthc.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // NodeInfoXpackSecurityAuthc type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L248-L251 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L248-L251 type NodeInfoXpackSecurityAuthc struct { Realms NodeInfoXpackSecurityAuthcRealms `json:"realms"` Token NodeInfoXpackSecurityAuthcToken `json:"token"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpacksecurityauthcrealms.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpacksecurityauthcrealms.go index 4cca71c6f..a88561762 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpacksecurityauthcrealms.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpacksecurityauthcrealms.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // NodeInfoXpackSecurityAuthcRealms type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L253-L257 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L253-L257 type NodeInfoXpackSecurityAuthcRealms struct { File map[string]NodeInfoXpackSecurityAuthcRealmsStatus `json:"file,omitempty"` Native map[string]NodeInfoXpackSecurityAuthcRealmsStatus `json:"native,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpacksecurityauthcrealmsstatus.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpacksecurityauthcrealmsstatus.go index 262bcd6cf..d273224d8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpacksecurityauthcrealmsstatus.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpacksecurityauthcrealmsstatus.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeInfoXpackSecurityAuthcRealmsStatus type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L263-L266 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L263-L266 type NodeInfoXpackSecurityAuthcRealmsStatus struct { Enabled *string `json:"enabled,omitempty"` Order string `json:"order"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpacksecurityauthctoken.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpacksecurityauthctoken.go index e5c7484c6..100c65e07 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpacksecurityauthctoken.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpacksecurityauthctoken.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeInfoXpackSecurityAuthcToken type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L259-L261 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L259-L261 type NodeInfoXpackSecurityAuthcToken struct { Enabled string `json:"enabled"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpacksecurityssl.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpacksecurityssl.go index fdec48757..8bd3eab12 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpacksecurityssl.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeinfoxpacksecurityssl.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // NodeInfoXpackSecuritySsl type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L244-L246 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L244-L246 type NodeInfoXpackSecuritySsl struct { Ssl map[string]string `json:"ssl"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodejvminfo.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodejvminfo.go index fcf956c8b..c7ce285ae 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodejvminfo.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodejvminfo.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeJvmInfo type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L351-L365 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L351-L365 type NodeJvmInfo struct { GcCollectors []string `json:"gc_collectors"` InputArguments []string `json:"input_arguments"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeoperatingsysteminfo.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeoperatingsysteminfo.go index fce96c55b..1bea6b574 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeoperatingsysteminfo.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeoperatingsysteminfo.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeOperatingSystemInfo type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L367-L384 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L367-L384 type NodeOperatingSystemInfo struct { // AllocatedProcessors The number of processors actually used to calculate thread pool size. This // number can be set with the node.processors setting of a node and defaults to diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodepackagingtype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodepackagingtype.go index 5d8f2af93..8db6a8920 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodepackagingtype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodepackagingtype.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodePackagingType type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/stats/types.ts#L526-L539 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/stats/types.ts#L526-L539 type NodePackagingType struct { // Count Number of selected nodes using the distribution flavor and file type. Count int `json:"count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeprocessinfo.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeprocessinfo.go index 460c61dbb..755b38d63 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeprocessinfo.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeprocessinfo.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeProcessInfo type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L386-L393 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L386-L393 type NodeProcessInfo struct { // Id Process identifier (PID) Id int64 `json:"id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodereloaderror.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodereloaderror.go index c64b23149..cf4b8b4cd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodereloaderror.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodereloaderror.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // NodeReloadError type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/NodeReloadResult.ts#L24-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/NodeReloadResult.ts#L24-L27 type NodeReloadError struct { Name string `json:"name"` ReloadException *ErrorCause `json:"reload_exception,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodereloadresult.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodereloadresult.go index 0d2421431..a42138dec 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodereloadresult.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodereloadresult.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // Stats // NodeReloadError // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/NodeReloadResult.ts#L29-L30 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/NodeReloadResult.ts#L29-L30 type NodeReloadResult interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodescontext.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodescontext.go index 204b5fa78..01da8b4a7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodescontext.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodescontext.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodesContext type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L997-L1002 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L997-L1002 type NodesContext struct { CacheEvictions *int64 `json:"cache_evictions,omitempty"` CompilationLimitTriggered *int64 `json:"compilation_limit_triggered,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodescredentials.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodescredentials.go index 6721fcae7..326f3df42 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodescredentials.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodescredentials.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // NodesCredentials type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/get_service_credentials/types.ts#L23-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/get_service_credentials/types.ts#L23-L28 type NodesCredentials struct { // FileTokens File-backed tokens collected from all nodes FileTokens map[string]NodesCredentialsFileToken `json:"file_tokens"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodescredentialsfiletoken.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodescredentialsfiletoken.go index 8c7cfe9c7..a4aed6984 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodescredentialsfiletoken.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodescredentialsfiletoken.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // NodesCredentialsFileToken type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/get_service_credentials/types.ts#L30-L32 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/get_service_credentials/types.ts#L30-L32 type NodesCredentialsFileToken struct { Nodes []string `json:"nodes"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeshard.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeshard.go index 098b00293..1a08bc6a5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeshard.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeshard.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // NodeShard type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Node.ts#L60-L71 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Node.ts#L60-L71 type NodeShard struct { AllocationId map[string]string `json:"allocation_id,omitempty"` Index string `json:"index"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeshutdownstatus.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeshutdownstatus.go index f11b9ff4c..0c02bb9e2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeshutdownstatus.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeshutdownstatus.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -33,7 +33,7 @@ import ( // NodeShutdownStatus type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/shutdown/get_node/ShutdownGetNodeResponse.ts#L29-L38 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/shutdown/get_node/ShutdownGetNodeResponse.ts#L29-L38 type NodeShutdownStatus struct { NodeId string `json:"node_id"` PersistentTasks PersistentTaskStatus `json:"persistent_tasks"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodesindexingpressure.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodesindexingpressure.go index c6aa5b288..187346b79 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodesindexingpressure.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodesindexingpressure.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // NodesIndexingPressure type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L116-L121 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L116-L121 type NodesIndexingPressure struct { // Memory Contains statistics for memory consumption from indexing load. Memory *NodesIndexingPressureMemory `json:"memory,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodesindexingpressurememory.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodesindexingpressurememory.go index 7948010cf..d74695936 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodesindexingpressurememory.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodesindexingpressurememory.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodesIndexingPressureMemory type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L123-L142 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L123-L142 type NodesIndexingPressureMemory struct { // Current Contains statistics for current indexing load. Current *PressureMemory `json:"current,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodesingest.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodesingest.go index dc1d62043..2b79c8cd0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodesingest.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodesingest.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // NodesIngest type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L345-L354 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L345-L354 type NodesIngest struct { // Pipelines Contains statistics about ingest pipelines for the node. Pipelines map[string]IngestTotal `json:"pipelines,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodesrecord.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodesrecord.go index 301b8ffc1..5a0d55947 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodesrecord.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodesrecord.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodesRecord type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/nodes/types.ts#L23-L542 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/nodes/types.ts#L23-L542 type NodesRecord struct { // Build The Elasticsearch build hash. Build *string `json:"build,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodestatistics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodestatistics.go index 91bafc75e..b5afc1ac3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodestatistics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodestatistics.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeStatistics type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Node.ts#L28-L39 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Node.ts#L28-L39 type NodeStatistics struct { // Failed Number of nodes that rejected the request or failed to respond. If this value // is not 0, a reason for the rejection or failure is included in the response. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodetasks.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodetasks.go index 7b24d3873..5654c18e2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodetasks.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodetasks.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // NodeTasks type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/tasks/_types/TaskListResponseBase.ts#L49-L57 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/tasks/_types/TaskListResponseBase.ts#L49-L57 type NodeTasks struct { Attributes map[string]string `json:"attributes,omitempty"` Host *string `json:"host,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodethreadpoolinfo.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodethreadpoolinfo.go index 87e60a325..bbe56b1ae 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodethreadpoolinfo.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodethreadpoolinfo.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // NodeThreadPoolInfo type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/info/types.ts#L289-L296 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/info/types.ts#L289-L296 type NodeThreadPoolInfo struct { Core *int `json:"core,omitempty"` KeepAlive Duration `json:"keep_alive,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeusage.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeusage.go index ddadd696a..2f05be540 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeusage.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/nodeusage.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // NodeUsage type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/usage/types.ts#L25-L30 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/usage/types.ts#L25-L30 type NodeUsage struct { Aggregations map[string]json.RawMessage `json:"aggregations"` RestActions map[string]int `json:"rest_actions"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/norianalyzer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/norianalyzer.go index c32f4be98..7f1f93e5f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/norianalyzer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/norianalyzer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // NoriAnalyzer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/analyzers.ts#L66-L72 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/analyzers.ts#L66-L72 type NoriAnalyzer struct { DecompoundMode *noridecompoundmode.NoriDecompoundMode `json:"decompound_mode,omitempty"` Stoptags []string `json:"stoptags,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/noripartofspeechtokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/noripartofspeechtokenfilter.go index 734a7b53b..0ae4e112d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/noripartofspeechtokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/noripartofspeechtokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // NoriPartOfSpeechTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L273-L276 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L273-L276 type NoriPartOfSpeechTokenFilter struct { Stoptags []string `json:"stoptags,omitempty"` Type string `json:"type,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/noritokenizer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/noritokenizer.go index 6fafaad0b..21512e941 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/noritokenizer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/noritokenizer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // NoriTokenizer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/tokenizers.ts#L81-L87 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/tokenizers.ts#L81-L87 type NoriTokenizer struct { DecompoundMode *noridecompoundmode.NoriDecompoundMode `json:"decompound_mode,omitempty"` DiscardPunctuation *bool `json:"discard_punctuation,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/normalizeaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/normalizeaggregation.go index 37cf6934c..bb363ab20 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/normalizeaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/normalizeaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -33,7 +33,7 @@ import ( // NormalizeAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L321-L326 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L321-L326 type NormalizeAggregation struct { // BucketsPath Path to the buckets that contain one set of values to correlate. BucketsPath BucketsPath `json:"buckets_path,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/normalizer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/normalizer.go index 5128d0bed..df6540ae1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/normalizer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/normalizer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // LowercaseNormalizer // CustomNormalizer // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/normalizers.ts#L20-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/normalizers.ts#L20-L24 type Normalizer interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/numberrangequery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/numberrangequery.go index 97f5aba14..89fa9c0f9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/numberrangequery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/numberrangequery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // NumberRangeQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/term.ts#L145-L164 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/term.ts#L145-L164 type NumberRangeQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/numericdecayfunction.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/numericdecayfunction.go index 5b5ee962c..37475b44c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/numericdecayfunction.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/numericdecayfunction.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // NumericDecayFunction type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/compound.ts#L182-L184 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/compound.ts#L182-L184 type NumericDecayFunction struct { // MultiValueMode Determines how the distance is calculated when a field used for computing the // decay contains multiple values. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/numericfielddata.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/numericfielddata.go index 63c2bc0f1..b8cae928a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/numericfielddata.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/numericfielddata.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,7 +26,7 @@ import ( // NumericFielddata type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/NumericFielddata.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/NumericFielddata.ts#L22-L24 type NumericFielddata struct { Format numericfielddataformat.NumericFielddataFormat `json:"format"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/objectproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/objectproperty.go index ccca49739..1881f880b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/objectproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/objectproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // ObjectProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/complex.ts#L46-L49 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/complex.ts#L46-L49 type ObjectProperty struct { CopyTo []string `json:"copy_to,omitempty"` Dynamic *dynamicmapping.DynamicMapping `json:"dynamic,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/onehotencodingpreprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/onehotencodingpreprocessor.go index 99ced26f9..18d453237 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/onehotencodingpreprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/onehotencodingpreprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // OneHotEncodingPreprocessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/put_trained_model/types.ts#L44-L47 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/put_trained_model/types.ts#L44-L47 type OneHotEncodingPreprocessor struct { Field string `json:"field"` HotMap map[string]string `json:"hot_map"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/operatingsystem.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/operatingsystem.go index 8a08f5f60..495a10f13 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/operatingsystem.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/operatingsystem.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // OperatingSystem type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L945-L951 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L945-L951 type OperatingSystem struct { Cgroup *Cgroup `json:"cgroup,omitempty"` Cpu *Cpu `json:"cpu,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/operatingsystemmemoryinfo.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/operatingsystemmemoryinfo.go index 5e161c70c..36264975d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/operatingsystemmemoryinfo.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/operatingsystemmemoryinfo.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // OperatingSystemMemoryInfo type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/stats/types.ts#L541-L568 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/stats/types.ts#L541-L568 type OperatingSystemMemoryInfo struct { // AdjustedTotalInBytes Total amount, in bytes, of memory across all selected nodes, but using the // value specified using the `es.total_memory_bytes` system property instead of diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/operationcontainer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/operationcontainer.go index ff2a41dcc..668ff7265 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/operationcontainer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/operationcontainer.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // OperationContainer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/bulk/types.ts#L145-L167 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/bulk/types.ts#L145-L167 type OperationContainer struct { // Create Indexes the specified document if it does not already exist. // The following line must contain the source data to be indexed. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/outlierdetectionparameters.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/outlierdetectionparameters.go index 163389e70..f6c36e48f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/outlierdetectionparameters.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/outlierdetectionparameters.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // OutlierDetectionParameters type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeAnalytics.ts#L527-L561 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeAnalytics.ts#L527-L561 type OutlierDetectionParameters struct { // ComputeFeatureInfluence Specifies whether the feature influence calculation is enabled. ComputeFeatureInfluence *bool `json:"compute_feature_influence,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/overallbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/overallbucket.go index 7b17c08b6..0e9d30325 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/overallbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/overallbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // OverallBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Bucket.ts#L130-L145 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Bucket.ts#L130-L145 type OverallBucket struct { // BucketSpan The length of the bucket in seconds. Matches the job with the longest // bucket_span value. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/overallbucketjob.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/overallbucketjob.go index 76f2720dc..7bab7c2de 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/overallbucketjob.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/overallbucketjob.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // OverallBucketJob type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Bucket.ts#L146-L149 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Bucket.ts#L146-L149 type OverallBucketJob struct { JobId string `json:"job_id"` MaxAnomalyScore Float64 `json:"max_anomaly_score"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/overlapping.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/overlapping.go index abfc1e62b..3ab0cd136 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/overlapping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/overlapping.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // Overlapping type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/simulate_template/IndicesSimulateTemplateResponse.ts#L39-L42 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/simulate_template/IndicesSimulateTemplateResponse.ts#L39-L42 type Overlapping struct { IndexPatterns []string `json:"index_patterns"` Name string `json:"name"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/page.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/page.go index 705db7295..853585494 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/page.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/page.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Page type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Page.ts#L22-L33 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Page.ts#L22-L33 type Page struct { // From Skips the specified number of items. From *int `json:"from,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pagerdutyaction.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pagerdutyaction.go index cf245fcc1..de48c5fa4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pagerdutyaction.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pagerdutyaction.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // PagerDutyAction type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Actions.ts#L54-L54 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Actions.ts#L54-L54 type PagerDutyAction struct { Account *string `json:"account,omitempty"` AttachPayload bool `json:"attach_payload"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pagerdutycontext.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pagerdutycontext.go index 039ef2100..a2db750c5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pagerdutycontext.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pagerdutycontext.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // PagerDutyContext type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Actions.ts#L61-L65 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Actions.ts#L61-L65 type PagerDutyContext struct { Href *string `json:"href,omitempty"` Src *string `json:"src,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pagerdutyevent.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pagerdutyevent.go index 1d99f1d2c..b59513cfe 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pagerdutyevent.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pagerdutyevent.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // PagerDutyEvent type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Actions.ts#L40-L52 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Actions.ts#L40-L52 type PagerDutyEvent struct { Account *string `json:"account,omitempty"` AttachPayload bool `json:"attach_payload"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pagerdutyeventproxy.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pagerdutyeventproxy.go index 93ca1ade4..8e586ccdd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pagerdutyeventproxy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pagerdutyeventproxy.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // PagerDutyEventProxy type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Actions.ts#L56-L59 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Actions.ts#L56-L59 type PagerDutyEventProxy struct { Host *string `json:"host,omitempty"` Port *int `json:"port,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pagerdutyresult.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pagerdutyresult.go index fb614b6fc..8c455ec19 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pagerdutyresult.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pagerdutyresult.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // PagerDutyResult type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Actions.ts#L78-L83 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Actions.ts#L78-L83 type PagerDutyResult struct { Event PagerDutyEvent `json:"event"` Reason *string `json:"reason,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/painlesscontextsetup.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/painlesscontextsetup.go index 3a8f4dc3b..c1ca39b35 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/painlesscontextsetup.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/painlesscontextsetup.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // PainlessContextSetup type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/scripts_painless_execute/types.ts#L25-L39 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/scripts_painless_execute/types.ts#L25-L39 type PainlessContextSetup struct { // Document Document that’s temporarily indexed in-memory and accessible from the script. Document json.RawMessage `json:"document,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/parentaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/parentaggregate.go index 80a8692d2..499f54158 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/parentaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/parentaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // ParentAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L779-L780 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L779-L780 type ParentAggregate struct { Aggregations map[string]Aggregate `json:"-"` DocCount int64 `json:"doc_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/parentaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/parentaggregation.go index 6fb44e47a..ac86048eb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/parentaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/parentaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ParentAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L643-L648 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L643-L648 type ParentAggregation struct { Meta Metadata `json:"meta,omitempty"` Name *string `json:"name,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/parentidquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/parentidquery.go index 148da9e39..e4d9a10cc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/parentidquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/parentidquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ParentIdQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/joining.ts#L132-L146 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/joining.ts#L132-L146 type ParentIdQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/parenttaskinfo.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/parenttaskinfo.go index af622c198..f49783416 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/parenttaskinfo.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/parenttaskinfo.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ParentTaskInfo type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/tasks/_types/TaskListResponseBase.ts#L45-L47 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/tasks/_types/TaskListResponseBase.ts#L45-L47 type ParentTaskInfo struct { Action string `json:"action"` Cancellable bool `json:"cancellable"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/passthroughinferenceoptions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/passthroughinferenceoptions.go index 6d6d08d5a..5587202ab 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/passthroughinferenceoptions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/passthroughinferenceoptions.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // PassThroughInferenceOptions type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/inference.ts#L224-L231 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/inference.ts#L224-L231 type PassThroughInferenceOptions struct { // ResultsField The field that is added to incoming documents to contain the inference // prediction. Defaults to predicted_value. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/passthroughinferenceupdateoptions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/passthroughinferenceupdateoptions.go index cec4054f0..c7fa028c3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/passthroughinferenceupdateoptions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/passthroughinferenceupdateoptions.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // PassThroughInferenceUpdateOptions type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/inference.ts#L385-L390 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/inference.ts#L385-L390 type PassThroughInferenceUpdateOptions struct { // ResultsField The field that is added to incoming documents to contain the inference // prediction. Defaults to predicted_value. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pathhierarchytokenizer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pathhierarchytokenizer.go index 04ffcf85e..e20e69288 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pathhierarchytokenizer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pathhierarchytokenizer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // PathHierarchyTokenizer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/tokenizers.ts#L89-L96 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/tokenizers.ts#L89-L96 type PathHierarchyTokenizer struct { BufferSize Stringifiedinteger `json:"buffer_size"` Delimiter string `json:"delimiter"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/patternanalyzer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/patternanalyzer.go index 86010f058..9e6aa961d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/patternanalyzer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/patternanalyzer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // PatternAnalyzer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/analyzers.ts#L74-L81 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/analyzers.ts#L74-L81 type PatternAnalyzer struct { Flags *string `json:"flags,omitempty"` Lowercase *bool `json:"lowercase,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/patterncapturetokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/patterncapturetokenfilter.go index 59b09f082..45df739bc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/patterncapturetokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/patterncapturetokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // PatternCaptureTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L278-L282 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L278-L282 type PatternCaptureTokenFilter struct { Patterns []string `json:"patterns"` PreserveOriginal Stringifiedboolean `json:"preserve_original,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/patternreplacecharfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/patternreplacecharfilter.go index 761fca681..4db488397 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/patternreplacecharfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/patternreplacecharfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // PatternReplaceCharFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/char_filters.ts#L53-L58 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/char_filters.ts#L53-L58 type PatternReplaceCharFilter struct { Flags *string `json:"flags,omitempty"` Pattern string `json:"pattern"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/patternreplacetokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/patternreplacetokenfilter.go index 57223fee2..9561765b6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/patternreplacetokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/patternreplacetokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // PatternReplaceTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L284-L290 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L284-L290 type PatternReplaceTokenFilter struct { All *bool `json:"all,omitempty"` Flags *string `json:"flags,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/patterntokenizer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/patterntokenizer.go index 5c9efa6a7..7ae51e5c9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/patterntokenizer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/patterntokenizer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // PatternTokenizer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/tokenizers.ts#L98-L103 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/tokenizers.ts#L98-L103 type PatternTokenizer struct { Flags *string `json:"flags,omitempty"` Group *int `json:"group,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pendingtask.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pendingtask.go index 3b880eec3..6cef35dec 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pendingtask.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pendingtask.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // PendingTask type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/pending_tasks/types.ts#L23-L47 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/pending_tasks/types.ts#L23-L47 type PendingTask struct { // Executing Indicates whether the pending tasks are currently executing or not. Executing bool `json:"executing"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pendingtasksrecord.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pendingtasksrecord.go index 9854b4abb..fba5c6c65 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pendingtasksrecord.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pendingtasksrecord.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // PendingTasksRecord type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/pending_tasks/types.ts#L20-L41 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/pending_tasks/types.ts#L20-L41 type PendingTasksRecord struct { // InsertOrder The task insertion order. InsertOrder *string `json:"insertOrder,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percentage.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percentage.go index b966a5cd3..091436b90 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percentage.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percentage.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // string // float32 // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Numeric.ts#L28-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Numeric.ts#L28-L28 type Percentage interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percentagescoreheuristic.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percentagescoreheuristic.go index eb3339a20..b4c895c64 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percentagescoreheuristic.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percentagescoreheuristic.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // PercentageScoreHeuristic type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L764-L764 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L764-L764 type PercentageScoreHeuristic struct { } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percentileranksaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percentileranksaggregation.go index eed03b3df..33865d0c2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percentileranksaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percentileranksaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // PercentileRanksAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L174-L193 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L174-L193 type PercentileRanksAggregation struct { // Field The field on which to run the aggregation. Field *string `json:"field,omitempty"` @@ -110,9 +110,40 @@ func (s *PercentileRanksAggregation) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } case "tdigest": if err := dec.Decode(&s.Tdigest); err != nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percentiles.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percentiles.go index 9ac5ba0df..e1a59817d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percentiles.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percentiles.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // KeyedPercentiles // []ArrayPercentilesItem // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L150-L151 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L150-L151 type Percentiles interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percentilesaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percentilesaggregation.go index 8c625b291..b5e498541 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percentilesaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percentilesaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // PercentilesAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L195-L214 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L195-L214 type PercentilesAggregation struct { // Field The field on which to run the aggregation. Field *string `json:"field,omitempty"` @@ -115,9 +115,40 @@ func (s *PercentilesAggregation) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } case "tdigest": if err := dec.Decode(&s.Tdigest); err != nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percentilesbucketaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percentilesbucketaggregate.go index dd0f85198..4057c91c5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percentilesbucketaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percentilesbucketaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // PercentilesBucketAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L178-L179 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L178-L179 type PercentilesBucketAggregate struct { Meta Metadata `json:"meta,omitempty"` Values Percentiles `json:"values"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percentilesbucketaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percentilesbucketaggregation.go index 0f70c82d7..332142366 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percentilesbucketaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percentilesbucketaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // PercentilesBucketAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L356-L361 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L356-L361 type PercentilesBucketAggregation struct { // BucketsPath Path to the buckets that contain one set of values to correlate. BucketsPath BucketsPath `json:"buckets_path,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percolatequery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percolatequery.go index b40f853dc..2264e0937 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percolatequery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percolatequery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // PercolateQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/specialized.ts#L193-L230 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/specialized.ts#L193-L230 type PercolateQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percolatorproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percolatorproperty.go index 622eb73c2..5559a0dc6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percolatorproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/percolatorproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // PercolatorProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/core.ts#L180-L182 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/core.ts#L180-L182 type PercolatorProperty struct { Dynamic *dynamicmapping.DynamicMapping `json:"dynamic,omitempty"` Fields map[string]Property `json:"fields,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/perpartitioncategorization.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/perpartitioncategorization.go index bec940943..dacaca046 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/perpartitioncategorization.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/perpartitioncategorization.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // PerPartitionCategorization type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Analysis.ts#L150-L159 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Analysis.ts#L150-L159 type PerPartitionCategorization struct { // Enabled To enable this setting, you must also set the `partition_field_name` property // to the same value in every detector that uses the keyword `mlcategory`. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/persistenttaskstatus.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/persistenttaskstatus.go index bb035b305..a65e3ef93 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/persistenttaskstatus.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/persistenttaskstatus.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,7 +26,7 @@ import ( // PersistentTaskStatus type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/shutdown/get_node/ShutdownGetNodeResponse.ts#L56-L58 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/shutdown/get_node/ShutdownGetNodeResponse.ts#L56-L58 type PersistentTaskStatus struct { Status shutdownstatus.ShutdownStatus `json:"status"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phase.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phase.go index ede4a85b7..d7d621beb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phase.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phase.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // Phase type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ilm/_types/Phase.ts#L25-L36 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ilm/_types/Phase.ts#L25-L36 type Phase struct { Actions json.RawMessage `json:"actions,omitempty"` Configurations *Configurations `json:"configurations,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phases.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phases.go index 1c8469215..4736f50f2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phases.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phases.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // Phases type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ilm/_types/Phase.ts#L38-L44 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ilm/_types/Phase.ts#L38-L44 type Phases struct { Cold *Phase `json:"cold,omitempty"` Delete *Phase `json:"delete,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phonetictokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phonetictokenfilter.go index ea53672bc..52498611d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phonetictokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phonetictokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -35,7 +35,7 @@ import ( // PhoneticTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/phonetic-plugin.ts#L64-L72 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/phonetic-plugin.ts#L64-L72 type PhoneticTokenFilter struct { Encoder phoneticencoder.PhoneticEncoder `json:"encoder"` Languageset []phoneticlanguage.PhoneticLanguage `json:"languageset"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phrasesuggest.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phrasesuggest.go index 00534ba7f..640ef4ebf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phrasesuggest.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phrasesuggest.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // PhraseSuggest type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/suggester.ts#L57-L62 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/suggester.ts#L57-L62 type PhraseSuggest struct { Length int `json:"length"` Offset int `json:"offset"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phrasesuggestcollate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phrasesuggestcollate.go index 7e6bce434..4fc63e3dc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phrasesuggestcollate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phrasesuggestcollate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // PhraseSuggestCollate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/suggester.ts#L330-L343 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/suggester.ts#L330-L343 type PhraseSuggestCollate struct { // Params Parameters to use if the query is templated. Params map[string]json.RawMessage `json:"params,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phrasesuggestcollatequery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phrasesuggestcollatequery.go index 19c982b76..3b2bb73f7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phrasesuggestcollatequery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phrasesuggestcollatequery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // PhraseSuggestCollateQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/suggester.ts#L345-L354 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/suggester.ts#L345-L354 type PhraseSuggestCollateQuery struct { // Id The search template ID. Id *string `json:"id,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phrasesuggester.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phrasesuggester.go index bbbac5098..a7d25f578 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phrasesuggester.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phrasesuggester.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // PhraseSuggester type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/suggester.ts#L356-L414 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/suggester.ts#L356-L414 type PhraseSuggester struct { // Analyzer The analyzer to analyze the suggest text with. // Defaults to the search analyzer of the suggest field. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phrasesuggesthighlight.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phrasesuggesthighlight.go index 35164e963..146580706 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phrasesuggesthighlight.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phrasesuggesthighlight.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // PhraseSuggestHighlight type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/suggester.ts#L416-L425 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/suggester.ts#L416-L425 type PhraseSuggestHighlight struct { // PostTag Use in conjunction with `pre_tag` to define the HTML tags to use for the // highlighted text. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phrasesuggestoption.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phrasesuggestoption.go index 9f255a049..4eb152de9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phrasesuggestoption.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/phrasesuggestoption.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // PhraseSuggestOption type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/suggester.ts#L86-L91 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/suggester.ts#L86-L91 type PhraseSuggestOption struct { CollateMatch *bool `json:"collate_match,omitempty"` Highlighted *string `json:"highlighted,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pinneddoc.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pinneddoc.go index 23553919b..31ca217c8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pinneddoc.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pinneddoc.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // PinnedDoc type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/specialized.ts#L253-L262 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/specialized.ts#L253-L262 type PinnedDoc struct { // Id_ The unique document ID. Id_ string `json:"_id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pinnedquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pinnedquery.go index a9f781f00..bb5eba9bd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pinnedquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pinnedquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // PinnedQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/specialized.ts#L232-L251 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/specialized.ts#L232-L251 type PinnedQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pipelineconfig.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pipelineconfig.go index bdb6f5a08..d9aef7eb8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pipelineconfig.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pipelineconfig.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // PipelineConfig type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Pipeline.ts#L57-L71 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Pipeline.ts#L61-L75 type PipelineConfig struct { // Description Description of the ingest pipeline. Description *string `json:"description,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pipelinemetadata.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pipelinemetadata.go index 6dfcf315f..b76b85b53 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pipelinemetadata.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pipelinemetadata.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // PipelineMetadata type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/logstash/_types/Pipeline.ts#L23-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/logstash/_types/Pipeline.ts#L23-L26 type PipelineMetadata struct { Type string `json:"type"` Version string `json:"version"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pipelineprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pipelineprocessor.go index aa7e73ebf..77124bd8a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pipelineprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pipelineprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // PipelineProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L917-L928 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L917-L928 type PipelineProcessor struct { // Description Description of the processor. // Useful for describing the purpose of the processor or its configuration. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pipelinesettings.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pipelinesettings.go index 9491439dd..feb925e08 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pipelinesettings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pipelinesettings.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // PipelineSettings type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/logstash/_types/Pipeline.ts#L28-L59 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/logstash/_types/Pipeline.ts#L28-L59 type PipelineSettings struct { // PipelineBatchDelay When creating pipeline event batches, how long in milliseconds to wait for // each event before dispatching an undersized batch to pipeline workers. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pipelinesimulation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pipelinesimulation.go index 2d11915ec..4d186627f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pipelinesimulation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pipelinesimulation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // PipelineSimulation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/simulate/types.ts#L33-L39 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/simulate/types.ts#L33-L39 type PipelineSimulation struct { Doc *DocumentSimulation `json:"doc,omitempty"` ProcessorResults []PipelineSimulation `json:"processor_results,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pipeseparatedflagssimplequerystringflag.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pipeseparatedflagssimplequerystringflag.go index 3136869cb..b69bd2b13 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pipeseparatedflagssimplequerystringflag.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pipeseparatedflagssimplequerystringflag.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // simplequerystringflag.SimpleQueryStringFlag // string // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_spec_utils/PipeSeparatedFlags.ts#L20-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_spec_utils/PipeSeparatedFlags.ts#L20-L27 type PipeSeparatedFlagsSimpleQueryStringFlag interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pivot.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pivot.go index 052745e17..4c8489451 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pivot.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pivot.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // Pivot type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/transform/_types/Transform.ts#L54-L68 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/transform/_types/Transform.ts#L54-L68 type Pivot struct { // Aggregations Defines how to aggregate the grouped data. The following aggregations are // currently supported: average, bucket diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pivotgroupbycontainer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pivotgroupbycontainer.go index de3f4ef4c..ac9173bf5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pivotgroupbycontainer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pivotgroupbycontainer.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // PivotGroupByContainer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/transform/_types/Transform.ts#L70-L78 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/transform/_types/Transform.ts#L70-L78 type PivotGroupByContainer struct { DateHistogram *DateHistogramAggregation `json:"date_histogram,omitempty"` GeotileGrid *GeoTileGridAggregation `json:"geotile_grid,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pluginsrecord.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pluginsrecord.go index 515f7b54c..f684beca6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pluginsrecord.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pluginsrecord.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // PluginsRecord type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/plugins/types.ts#L22-L52 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/plugins/types.ts#L22-L52 type PluginsRecord struct { // Component The component name. Component *string `json:"component,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pluginsstatus.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pluginsstatus.go index c7a82db4b..23755da11 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pluginsstatus.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pluginsstatus.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,7 +26,7 @@ import ( // PluginsStatus type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/shutdown/get_node/ShutdownGetNodeResponse.ts#L60-L62 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/shutdown/get_node/ShutdownGetNodeResponse.ts#L60-L62 type PluginsStatus struct { Status shutdownstatus.ShutdownStatus `json:"status"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pluginstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pluginstats.go index 921ed8155..4917c569b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pluginstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pluginstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // PluginStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Stats.ts#L180-L190 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Stats.ts#L180-L190 type PluginStats struct { Classname string `json:"classname"` Description string `json:"description"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pointintimereference.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pointintimereference.go index 2c7687d79..bd73aff12 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pointintimereference.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pointintimereference.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // PointInTimeReference type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/PointInTimeReference.ts#L23-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/PointInTimeReference.ts#L23-L26 type PointInTimeReference struct { Id string `json:"id"` KeepAlive Duration `json:"keep_alive,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pointproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pointproperty.go index fa78ec480..e6266a6a0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pointproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pointproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // PointProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/geo.ts#L62-L67 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/geo.ts#L62-L67 type PointProperty struct { CopyTo []string `json:"copy_to,omitempty"` DocValues *bool `json:"doc_values,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pool.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pool.go index 8a72087e7..3987522b8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pool.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pool.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Pool type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L878-L895 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L878-L895 type Pool struct { // MaxInBytes Maximum amount of memory, in bytes, available for use by the heap. MaxInBytes *int64 `json:"max_in_bytes,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/porterstemtokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/porterstemtokenfilter.go index c3fdf1a2e..6336b9899 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/porterstemtokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/porterstemtokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // PorterStemTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L292-L294 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L292-L294 type PorterStemTokenFilter struct { Type string `json:"type,omitempty"` Version *string `json:"version,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/postmigrationfeature.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/postmigrationfeature.go index 548340995..b548a6906 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/postmigrationfeature.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/postmigrationfeature.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // PostMigrationFeature type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/migration/post_feature_upgrade/PostFeatureUpgradeResponse.ts#L27-L29 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/migration/post_feature_upgrade/PostFeatureUpgradeResponse.ts#L27-L29 type PostMigrationFeature struct { FeatureName string `json:"feature_name"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/predicatetokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/predicatetokenfilter.go index 7ac2ba8d6..ffb344bae 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/predicatetokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/predicatetokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // PredicateTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L296-L299 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L296-L299 type PredicateTokenFilter struct { Script Script `json:"script"` Type string `json:"type,omitempty"` @@ -52,9 +52,40 @@ func (s *PredicateTokenFilter) UnmarshalJSON(data []byte) error { switch t { case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } case "type": if err := dec.Decode(&s.Type); err != nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/predictedvalue.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/predictedvalue.go index ba1d69153..2fea2e62b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/predictedvalue.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/predictedvalue.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -27,5 +27,5 @@ package types // bool // int // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/inference.ts#L457-L457 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/inference.ts#L457-L457 type PredictedValue interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/prefixquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/prefixquery.go index b1c450d18..b0c423793 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/prefixquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/prefixquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // PrefixQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/term.ts#L87-L106 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/term.ts#L87-L106 type PrefixQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/preprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/preprocessor.go index 4f2307e2d..523f1de47 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/preprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/preprocessor.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // Preprocessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/put_trained_model/types.ts#L31-L36 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/put_trained_model/types.ts#L31-L36 type Preprocessor struct { FrequencyEncoding *FrequencyEncodingPreprocessor `json:"frequency_encoding,omitempty"` OneHotEncoding *OneHotEncodingPreprocessor `json:"one_hot_encoding,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pressurememory.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pressurememory.go index a3aef4325..55b87818c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pressurememory.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/pressurememory.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // PressureMemory type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L144-L199 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L144-L199 type PressureMemory struct { // All Memory consumed by indexing requests in the coordinating, primary, or replica // stage. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/privileges.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/privileges.go index 2a303a8d8..aa8fda23e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/privileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/privileges.go @@ -16,11 +16,11 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // Privileges type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/has_privileges/types.ts#L48-L48 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/has_privileges/types.ts#L48-L48 type Privileges map[string]bool diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/privilegesactions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/privilegesactions.go index 5fd7e6811..737c721e0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/privilegesactions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/privilegesactions.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // PrivilegesActions type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/put_privileges/types.ts#L22-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/put_privileges/types.ts#L22-L27 type PrivilegesActions struct { Actions []string `json:"actions"` Application *string `json:"application,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/privilegescheck.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/privilegescheck.go index 8caad9a80..b133b9547 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/privilegescheck.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/privilegescheck.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,7 +26,7 @@ import ( // PrivilegesCheck type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/has_privileges_user_profile/types.ts#L30-L37 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/has_privileges_user_profile/types.ts#L30-L37 type PrivilegesCheck struct { Application []ApplicationPrivilegesCheck `json:"application,omitempty"` // Cluster A list of the cluster privileges that you want to check. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/process.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/process.go index 44860dd0a..d2360ca08 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/process.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/process.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Process type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L953-L975 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L953-L975 type Process struct { // Cpu Contains CPU statistics for the node. Cpu *Cpu `json:"cpu,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/processor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/processor.go index cea0151d6..9d50887b7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/processor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/processor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Processor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L384-L401 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L384-L401 type Processor struct { // Count Number of documents transformed by the processor. Count *int64 `json:"count,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/processorcontainer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/processorcontainer.go index 7374b2e12..98691ac49 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/processorcontainer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/processorcontainer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // ProcessorContainer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L28-L233 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L28-L233 type ProcessorContainer struct { // Append Appends one or more values to an existing array if the field already exists // and it is an array. @@ -309,8 +309,39 @@ func (s *ProcessorContainer) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { - return err + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { + return err + } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } } case "set": diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/profile.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/profile.go index b684df614..d413a20a2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/profile.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/profile.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // Profile type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/profile.ts#L93-L95 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/profile.ts#L93-L95 type Profile struct { Shards []ShardProfile `json:"shards"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/property.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/property.go index 47ce5cb3b..99bfdc42a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/property.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/property.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -70,5 +70,5 @@ package types // IpRangeProperty // LongRangeProperty // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/Property.ts#L94-L158 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/Property.ts#L94-L158 type Property interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/publishedclusterstates.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/publishedclusterstates.go index 34ea8a173..b7193b385 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/publishedclusterstates.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/publishedclusterstates.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // PublishedClusterStates type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L263-L276 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L263-L276 type PublishedClusterStates struct { // CompatibleDiffs Number of compatible differences between published cluster states. CompatibleDiffs *int64 `json:"compatible_diffs,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/queries.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/queries.go index 803789a19..869ba175e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/queries.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/queries.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // Queries type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L394-L396 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L394-L396 type Queries struct { Cache *CacheQueries `json:"cache,omitempty"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/query.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/query.go index 8da8bb3b9..ad9775e52 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/query.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/query.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // Query type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/abstractions.ts#L98-L391 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/abstractions.ts#L98-L391 type Query struct { // Bool matches documents matching boolean combinations of other queries. Bool *BoolQuery `json:"bool,omitempty"` @@ -235,8 +235,18 @@ func (s *Query) UnmarshalJSON(data []byte) error { } case "distance_feature": - if err := dec.Decode(&s.DistanceFeature); err != nil { - return err + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { + return err + } + o := NewGeoDistanceFeatureQuery() + err := json.Unmarshal(message, &o) + if err != nil { + o := NewDateDistanceFeatureQuery() + err := json.Unmarshal(message, &o) + if err != nil { + return err + } } case "exists": diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/querybreakdown.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/querybreakdown.go index ad92231a9..cf25abcbe 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/querybreakdown.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/querybreakdown.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // QueryBreakdown type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/profile.ts#L97-L116 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/profile.ts#L97-L116 type QueryBreakdown struct { Advance int64 `json:"advance"` AdvanceCount int64 `json:"advance_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/querycachestats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/querycachestats.go index d4316f2f7..ea5a6b3e0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/querycachestats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/querycachestats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // QueryCacheStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Stats.ts#L192-L226 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Stats.ts#L192-L226 type QueryCacheStats struct { // CacheCount Total number of entries added to the query cache across all shards assigned // to selected nodes. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/queryprofile.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/queryprofile.go index d5fa230b3..0684702b9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/queryprofile.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/queryprofile.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // QueryProfile type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/profile.ts#L118-L124 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/profile.ts#L118-L124 type QueryProfile struct { Breakdown QueryBreakdown `json:"breakdown"` Children []QueryProfile `json:"children,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/queryrule.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/queryrule.go index 60a2c25e4..e6254b111 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/queryrule.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/queryrule.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // QueryRule type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/query_ruleset/_types/QueryRuleset.ts#L37-L42 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/query_ruleset/_types/QueryRuleset.ts#L37-L42 type QueryRule struct { Actions QueryRuleActions `json:"actions"` Criteria []QueryRuleCriteria `json:"criteria"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/queryruleactions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/queryruleactions.go index 1aa2a33cf..4caf5810d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/queryruleactions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/queryruleactions.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // QueryRuleActions type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/query_ruleset/_types/QueryRuleset.ts#L67-L70 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/query_ruleset/_types/QueryRuleset.ts#L67-L70 type QueryRuleActions struct { Docs []PinnedDoc `json:"docs,omitempty"` Ids []string `json:"ids,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/queryrulecriteria.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/queryrulecriteria.go index 0425be2a3..fc2beeff5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/queryrulecriteria.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/queryrulecriteria.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // QueryRuleCriteria type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/query_ruleset/_types/QueryRuleset.ts#L48-L52 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/query_ruleset/_types/QueryRuleset.ts#L48-L52 type QueryRuleCriteria struct { Metadata string `json:"metadata"` Type queryrulecriteriatype.QueryRuleCriteriaType `json:"type"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/queryruleset.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/queryruleset.go index 67471c43e..b17892097 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/queryruleset.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/queryruleset.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // QueryRuleset type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/query_ruleset/_types/QueryRuleset.ts#L26-L35 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/query_ruleset/_types/QueryRuleset.ts#L26-L35 type QueryRuleset struct { // Rules Rules associated with the query ruleset Rules []QueryRule `json:"rules"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/queryrulesetlistitem.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/queryrulesetlistitem.go index 4a585f553..9997244e3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/queryrulesetlistitem.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/queryrulesetlistitem.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // QueryRulesetListItem type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/query_ruleset/list/types.ts#L22-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/query_ruleset/list/types.ts#L22-L31 type QueryRulesetListItem struct { // RulesCount The number of rules associated with this ruleset RulesCount int `json:"rules_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/querystringquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/querystringquery.go index ea88dab1b..ea096658e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/querystringquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/querystringquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -33,7 +33,7 @@ import ( // QueryStringQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/fulltext.ts#L580-L700 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/fulltext.ts#L580-L700 type QueryStringQuery struct { // AllowLeadingWildcard If `true`, the wildcard characters `*` and `?` are allowed as the first // character of the query string. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/queryvectorbuilder.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/queryvectorbuilder.go index a0134bc9f..5542303cc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/queryvectorbuilder.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/queryvectorbuilder.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // QueryVectorBuilder type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Knn.ts#L45-L48 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Knn.ts#L45-L48 type QueryVectorBuilder struct { TextEmbedding *TextEmbedding `json:"text_embedding,omitempty"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/querywatch.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/querywatch.go index 88a921ac8..5d3db6a8d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/querywatch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/querywatch.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // QueryWatch type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Watch.ts#L58-L64 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Watch.ts#L58-L64 type QueryWatch struct { Id_ string `json:"_id"` PrimaryTerm_ *int `json:"_primary_term,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/questionansweringinferenceoptions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/questionansweringinferenceoptions.go index 7d95d8185..6e712ff51 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/questionansweringinferenceoptions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/questionansweringinferenceoptions.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // QuestionAnsweringInferenceOptions type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/inference.ts#L282-L292 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/inference.ts#L282-L292 type QuestionAnsweringInferenceOptions struct { // MaxAnswerLength The maximum answer length to consider MaxAnswerLength *int `json:"max_answer_length,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/questionansweringinferenceupdateoptions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/questionansweringinferenceupdateoptions.go index de9004a57..0d1fbdfa5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/questionansweringinferenceupdateoptions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/questionansweringinferenceupdateoptions.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // QuestionAnsweringInferenceUpdateOptions type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/inference.ts#L420-L431 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/inference.ts#L420-L431 type QuestionAnsweringInferenceUpdateOptions struct { // MaxAnswerLength The maximum answer length to consider for extraction MaxAnswerLength *int `json:"max_answer_length,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/randomscorefunction.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/randomscorefunction.go index 933619a8b..5dac052ed 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/randomscorefunction.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/randomscorefunction.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RandomScoreFunction type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/compound.ts#L127-L130 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/compound.ts#L127-L130 type RandomScoreFunction struct { Field *string `json:"field,omitempty"` Seed string `json:"seed,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rangeaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rangeaggregate.go index 58ad748e8..5dcdbca40 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rangeaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rangeaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // RangeAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L531-L532 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L531-L532 type RangeAggregate struct { Buckets BucketsRangeBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rangeaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rangeaggregation.go index 15770b05d..5a8478330 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rangeaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rangeaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RangeAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L650-L670 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L650-L670 type RangeAggregation struct { // Field The date field whose values are use to build ranges. Field *string `json:"field,omitempty"` @@ -133,9 +133,40 @@ func (s *RangeAggregation) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } } } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rangebucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rangebucket.go index d922ce565..ab50e1f37 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rangebucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rangebucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // RangeBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L534-L541 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L534-L541 type RangeBucket struct { Aggregations map[string]Aggregate `json:"-"` DocCount int64 `json:"doc_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rangequery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rangequery.go index 4f9c16a0f..c4c5e5da4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rangequery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rangequery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // DateRangeQuery // NumberRangeQuery // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/term.ts#L166-L168 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/term.ts#L166-L168 type RangeQuery interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankcontainer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankcontainer.go index fa321bc07..26aefca27 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankcontainer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankcontainer.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // RankContainer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Rank.ts#L22-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Rank.ts#L22-L28 type RankContainer struct { // Rrf The reciprocal rank fusion parameters Rrf *RrfRank `json:"rrf,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalhit.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalhit.go index 9fe378f1f..aa2f695fb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalhit.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalhit.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RankEvalHit type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/rank_eval/types.ts#L141-L145 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/rank_eval/types.ts#L141-L145 type RankEvalHit struct { Id_ string `json:"_id"` Index_ string `json:"_index"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalhititem.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalhititem.go index d0960f60c..531a22ac9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalhititem.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalhititem.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // RankEvalHitItem type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/rank_eval/types.ts#L136-L139 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/rank_eval/types.ts#L136-L139 type RankEvalHitItem struct { Hit RankEvalHit `json:"hit"` Rating Float64 `json:"rating,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalmetric.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalmetric.go index 8f602af7d..61d704a43 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalmetric.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalmetric.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // RankEvalMetric type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/rank_eval/types.ts#L90-L96 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/rank_eval/types.ts#L90-L96 type RankEvalMetric struct { Dcg *RankEvalMetricDiscountedCumulativeGain `json:"dcg,omitempty"` ExpectedReciprocalRank *RankEvalMetricExpectedReciprocalRank `json:"expected_reciprocal_rank,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalmetricdetail.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalmetricdetail.go index e434925b3..ffbebb9ed 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalmetricdetail.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalmetricdetail.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RankEvalMetricDetail type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/rank_eval/types.ts#L125-L134 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/rank_eval/types.ts#L125-L134 type RankEvalMetricDetail struct { // Hits The hits section shows a grouping of the search results with their supplied // ratings diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalmetricdiscountedcumulativegain.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalmetricdiscountedcumulativegain.go index fdbb5c988..544f8e2f9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalmetricdiscountedcumulativegain.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalmetricdiscountedcumulativegain.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RankEvalMetricDiscountedCumulativeGain type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/rank_eval/types.ts#L66-L77 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/rank_eval/types.ts#L66-L77 type RankEvalMetricDiscountedCumulativeGain struct { // K Sets the maximum number of documents retrieved per query. This value will act // in place of the usual size parameter in the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalmetricexpectedreciprocalrank.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalmetricexpectedreciprocalrank.go index dde087a19..2ba8bbbd3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalmetricexpectedreciprocalrank.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalmetricexpectedreciprocalrank.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RankEvalMetricExpectedReciprocalRank type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/rank_eval/types.ts#L79-L88 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/rank_eval/types.ts#L79-L88 type RankEvalMetricExpectedReciprocalRank struct { // K Sets the maximum number of documents retrieved per query. This value will act // in place of the usual size parameter in the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalmetricmeanreciprocalrank.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalmetricmeanreciprocalrank.go index eee654d8b..d010ae15d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalmetricmeanreciprocalrank.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalmetricmeanreciprocalrank.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RankEvalMetricMeanReciprocalRank type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/rank_eval/types.ts#L60-L64 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/rank_eval/types.ts#L60-L64 type RankEvalMetricMeanReciprocalRank struct { // K Sets the maximum number of documents retrieved per query. This value will act // in place of the usual size parameter in the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalmetricprecision.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalmetricprecision.go index be0e7e5aa..05bf0129c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalmetricprecision.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalmetricprecision.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RankEvalMetricPrecision type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/rank_eval/types.ts#L42-L52 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/rank_eval/types.ts#L42-L52 type RankEvalMetricPrecision struct { // IgnoreUnlabeled Controls how unlabeled documents in the search results are counted. If set to // true, unlabeled documents are ignored and neither count as relevant or diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalmetricratingtreshold.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalmetricratingtreshold.go index 1ad539220..41b5ca022 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalmetricratingtreshold.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalmetricratingtreshold.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RankEvalMetricRatingTreshold type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/rank_eval/types.ts#L34-L40 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/rank_eval/types.ts#L34-L40 type RankEvalMetricRatingTreshold struct { // K Sets the maximum number of documents retrieved per query. This value will act // in place of the usual size parameter in the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalmetricrecall.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalmetricrecall.go index 3e012e78f..db512db0d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalmetricrecall.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalmetricrecall.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RankEvalMetricRecall type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/rank_eval/types.ts#L54-L58 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/rank_eval/types.ts#L54-L58 type RankEvalMetricRecall struct { // K Sets the maximum number of documents retrieved per query. This value will act // in place of the usual size parameter in the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalquery.go index 2d52cc343..01fab4e05 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RankEvalQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/rank_eval/types.ts#L111-L114 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/rank_eval/types.ts#L111-L114 type RankEvalQuery struct { Query Query `json:"query"` Size *int `json:"size,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalrequestitem.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalrequestitem.go index 941692c81..57947ae83 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalrequestitem.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankevalrequestitem.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // RankEvalRequestItem type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/rank_eval/types.ts#L98-L109 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/rank_eval/types.ts#L98-L109 type RankEvalRequestItem struct { // Id The search request’s ID, used to group result details later. Id string `json:"id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankfeaturefunction.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankfeaturefunction.go index 5c4e65427..7d8b006c9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankfeaturefunction.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankfeaturefunction.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // RankFeatureFunction type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/specialized.ts#L264-L264 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/specialized.ts#L264-L264 type RankFeatureFunction struct { } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankfeaturefunctionlinear.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankfeaturefunctionlinear.go index 44459a069..73dcaf7fc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankfeaturefunctionlinear.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankfeaturefunctionlinear.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // RankFeatureFunctionLinear type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/specialized.ts#L266-L266 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/specialized.ts#L266-L266 type RankFeatureFunctionLinear struct { } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankfeaturefunctionlogarithm.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankfeaturefunctionlogarithm.go index e961111b0..46683eaab 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankfeaturefunctionlogarithm.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankfeaturefunctionlogarithm.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RankFeatureFunctionLogarithm type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/specialized.ts#L268-L273 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/specialized.ts#L268-L273 type RankFeatureFunctionLogarithm struct { // ScalingFactor Configurable scaling factor. ScalingFactor float32 `json:"scaling_factor"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankfeaturefunctionsaturation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankfeaturefunctionsaturation.go index 00876905c..9a6a6604c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankfeaturefunctionsaturation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankfeaturefunctionsaturation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RankFeatureFunctionSaturation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/specialized.ts#L275-L280 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/specialized.ts#L275-L280 type RankFeatureFunctionSaturation struct { // Pivot Configurable pivot value so that the result will be less than 0.5. Pivot *float32 `json:"pivot,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankfeaturefunctionsigmoid.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankfeaturefunctionsigmoid.go index 4f6e80382..ccb2298e4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankfeaturefunctionsigmoid.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankfeaturefunctionsigmoid.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RankFeatureFunctionSigmoid type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/specialized.ts#L282-L291 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/specialized.ts#L282-L291 type RankFeatureFunctionSigmoid struct { // Exponent Configurable Exponent. Exponent float32 `json:"exponent"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankfeatureproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankfeatureproperty.go index d02ca1c17..5b9a2e004 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankfeatureproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankfeatureproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // RankFeatureProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/core.ts#L184-L187 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/core.ts#L184-L187 type RankFeatureProperty struct { Dynamic *dynamicmapping.DynamicMapping `json:"dynamic,omitempty"` Fields map[string]Property `json:"fields,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankfeaturequery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankfeaturequery.go index 460bb8608..528981a1a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankfeaturequery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankfeaturequery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RankFeatureQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/specialized.ts#L293-L316 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/specialized.ts#L293-L316 type RankFeatureQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankfeaturesproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankfeaturesproperty.go index 016c8cf7e..9587e40b7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankfeaturesproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rankfeaturesproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // RankFeaturesProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/core.ts#L189-L191 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/core.ts#L189-L191 type RankFeaturesProperty struct { Dynamic *dynamicmapping.DynamicMapping `json:"dynamic,omitempty"` Fields map[string]Property `json:"fields,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/raretermsaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/raretermsaggregation.go index 4829b4e7e..94b910a49 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/raretermsaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/raretermsaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RareTermsAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L687-L717 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L687-L717 type RareTermsAggregation struct { // Exclude Terms that should be excluded from the aggregation. Exclude []string `json:"exclude,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rateaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rateaggregate.go index e66ee0738..266340935 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rateaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rateaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RateAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L741-L745 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L741-L745 type RateAggregate struct { Meta Metadata `json:"meta,omitempty"` Value Float64 `json:"value"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rateaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rateaggregation.go index 521472c58..41a4d54a1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rateaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rateaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -33,7 +33,7 @@ import ( // RateAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L230-L241 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L230-L241 type RateAggregation struct { // Field The field on which to run the aggregation. Field *string `json:"field,omitempty"` @@ -92,9 +92,40 @@ func (s *RateAggregation) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } case "unit": if err := dec.Decode(&s.Unit); err != nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/readexception.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/readexception.go index e7dbed5b2..85036d71a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/readexception.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/readexception.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ReadException type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ccr/_types/FollowIndexStats.ts#L71-L75 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ccr/_types/FollowIndexStats.ts#L71-L75 type ReadException struct { Exception ErrorCause `json:"exception"` FromSeqNo int64 `json:"from_seq_no"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/realmcache.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/realmcache.go index e3fc154f3..f682ce97f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/realmcache.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/realmcache.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RealmCache type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L266-L268 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L266-L268 type RealmCache struct { Size int64 `json:"size"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/realminfo.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/realminfo.go index 5b640c488..dea2687bf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/realminfo.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/realminfo.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RealmInfo type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/_types/RealmInfo.ts#L22-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/_types/RealmInfo.ts#L22-L25 type RealmInfo struct { Name string `json:"name"` Type string `json:"type"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recording.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recording.go index a24644377..85797f5c8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recording.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recording.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Recording type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L225-L230 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L225-L230 type Recording struct { CumulativeExecutionCount *int64 `json:"cumulative_execution_count,omitempty"` CumulativeExecutionTime Duration `json:"cumulative_execution_time,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recoverybytes.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recoverybytes.go index d8db7da72..29ce9e261 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recoverybytes.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recoverybytes.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // RecoveryBytes type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/recovery/types.ts#L38-L48 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/recovery/types.ts#L38-L48 type RecoveryBytes struct { Percent Percentage `json:"percent"` Recovered ByteSize `json:"recovered,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recoveryfiles.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recoveryfiles.go index 5ee914ff5..6406edf34 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recoveryfiles.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recoveryfiles.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RecoveryFiles type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/recovery/types.ts#L56-L62 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/recovery/types.ts#L56-L62 type RecoveryFiles struct { Details []FileDetails `json:"details,omitempty"` Percent Percentage `json:"percent"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recoveryindexstatus.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recoveryindexstatus.go index 518b0a21a..d6b3f873c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recoveryindexstatus.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recoveryindexstatus.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // RecoveryIndexStatus type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/recovery/types.ts#L64-L74 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/recovery/types.ts#L64-L74 type RecoveryIndexStatus struct { Bytes *RecoveryBytes `json:"bytes,omitempty"` Files RecoveryFiles `json:"files"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recoveryorigin.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recoveryorigin.go index 5720a79f5..65ea2c828 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recoveryorigin.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recoveryorigin.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RecoveryOrigin type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/recovery/types.ts#L76-L89 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/recovery/types.ts#L76-L89 type RecoveryOrigin struct { BootstrapNewHistoryUuid *bool `json:"bootstrap_new_history_uuid,omitempty"` Host *string `json:"host,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recoveryrecord.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recoveryrecord.go index f4a23b2ce..6963fd97d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recoveryrecord.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recoveryrecord.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RecoveryRecord type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/recovery/types.ts#L24-L155 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/recovery/types.ts#L24-L155 type RecoveryRecord struct { // Bytes The number of bytes to recover. Bytes *string `json:"bytes,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recoverystartstatus.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recoverystartstatus.go index 573d2787b..4d55e58f8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recoverystartstatus.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recoverystartstatus.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // RecoveryStartStatus type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/recovery/types.ts#L91-L96 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/recovery/types.ts#L91-L96 type RecoveryStartStatus struct { CheckIndexTime Duration `json:"check_index_time,omitempty"` CheckIndexTimeInMillis int64 `json:"check_index_time_in_millis"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recoverystats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recoverystats.go index 0aaccccb9..896016256 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recoverystats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recoverystats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RecoveryStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Stats.ts#L228-L233 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Stats.ts#L228-L233 type RecoveryStats struct { CurrentAsSource int64 `json:"current_as_source"` CurrentAsTarget int64 `json:"current_as_target"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recoverystatus.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recoverystatus.go index a5d4cabd9..5b4d798fe 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recoverystatus.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/recoverystatus.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // RecoveryStatus type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/recovery/types.ts#L98-L100 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/recovery/types.ts#L98-L100 type RecoveryStatus struct { Shards []ShardRecovery `json:"shards"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/refreshstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/refreshstats.go index 37ea28889..a65457dc1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/refreshstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/refreshstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RefreshStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Stats.ts#L235-L242 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Stats.ts#L235-L242 type RefreshStats struct { ExternalTotal int64 `json:"external_total"` ExternalTotalTimeInMillis int64 `json:"external_total_time_in_millis"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/regexoptions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/regexoptions.go index 29367318c..a718078cf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/regexoptions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/regexoptions.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RegexOptions type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/suggester.ts#L180-L191 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/suggester.ts#L180-L191 type RegexOptions struct { // Flags Optional operators for the regular expression. Flags string `json:"flags,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/regexpquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/regexpquery.go index 0b571a964..b5bcc0c26 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/regexpquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/regexpquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RegexpQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/term.ts#L185-L215 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/term.ts#L185-L215 type RegexpQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/regressioninferenceoptions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/regressioninferenceoptions.go index 65d1237db..ad5b4b62d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/regressioninferenceoptions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/regressioninferenceoptions.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RegressionInferenceOptions type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/inference.ts#L82-L91 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/inference.ts#L82-L91 type RegressionInferenceOptions struct { // NumTopFeatureImportanceValues Specifies the maximum number of feature importance values per document. NumTopFeatureImportanceValues *int `json:"num_top_feature_importance_values,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reindexdestination.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reindexdestination.go index 917f427d7..b5a3312dc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reindexdestination.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reindexdestination.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -33,7 +33,7 @@ import ( // ReindexDestination type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/reindex/types.ts#L39-L64 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/reindex/types.ts#L39-L64 type ReindexDestination struct { // Index The name of the data stream, index, or index alias you are copying to. Index string `json:"index"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reindexnode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reindexnode.go index 77c65b0a0..8cbeb7f09 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reindexnode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reindexnode.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // ReindexNode type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/reindex_rethrottle/types.ts#L33-L35 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/reindex_rethrottle/types.ts#L33-L35 type ReindexNode struct { Attributes map[string]string `json:"attributes"` Host string `json:"host"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reindexsource.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reindexsource.go index ca4e21112..af266cfb9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reindexsource.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reindexsource.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ReindexSource type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/reindex/types.ts#L66-L97 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/reindex/types.ts#L66-L97 type ReindexSource struct { // Index The name of the data stream, index, or alias you are copying from. // Accepts a comma-separated list to reindex from multiple sources. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reindexstatus.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reindexstatus.go index 1e29ace02..b2a108260 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reindexstatus.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reindexstatus.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ReindexStatus type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/reindex_rethrottle/types.ts#L37-L85 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/reindex_rethrottle/types.ts#L37-L85 type ReindexStatus struct { // Batches The number of scroll responses pulled back by the reindex. Batches int64 `json:"batches"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reindextask.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reindextask.go index 47b397769..23bb6cb6b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reindextask.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reindextask.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ReindexTask type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/reindex_rethrottle/types.ts#L87-L98 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/reindex_rethrottle/types.ts#L87-L98 type ReindexTask struct { Action string `json:"action"` Cancellable bool `json:"cancellable"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reloaddetails.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reloaddetails.go index 6cc0c2657..9b30b4f5c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reloaddetails.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reloaddetails.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ReloadDetails type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/reload_search_analyzers/types.ts#L27-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/reload_search_analyzers/types.ts#L27-L31 type ReloadDetails struct { Index string `json:"index"` ReloadedAnalyzers []string `json:"reloaded_analyzers"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reloadresult.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reloadresult.go index 245fea25d..08a050751 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reloadresult.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reloadresult.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // ReloadResult type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/reload_search_analyzers/types.ts#L22-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/reload_search_analyzers/types.ts#L22-L25 type ReloadResult struct { ReloadDetails []ReloadDetails `json:"reload_details"` Shards_ ShardStatistics `json:"_shards"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/relocationfailureinfo.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/relocationfailureinfo.go index df8f2aac5..8f09975d9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/relocationfailureinfo.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/relocationfailureinfo.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RelocationFailureInfo type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Node.ts#L73-L75 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Node.ts#L73-L75 type RelocationFailureInfo struct { FailedAttempts int `json:"failed_attempts"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/remotesource.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/remotesource.go index 0b0ce6ef5..f88dcbf01 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/remotesource.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/remotesource.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // RemoteSource type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/reindex/types.ts#L99-L125 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/reindex/types.ts#L99-L125 type RemoteSource struct { // ConnectTimeout The remote connection timeout. // Defaults to 30 seconds. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/removeaction.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/removeaction.go index 958f3a986..c767073fd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/removeaction.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/removeaction.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RemoveAction type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/update_aliases/types.ts#L97-L122 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/update_aliases/types.ts#L97-L122 type RemoveAction struct { // Alias Alias for the action. // Index alias names support date math. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/removeduplicatestokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/removeduplicatestokenfilter.go index d015a254b..6c7715466 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/removeduplicatestokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/removeduplicatestokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // RemoveDuplicatesTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L301-L303 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L301-L303 type RemoveDuplicatesTokenFilter struct { Type string `json:"type,omitempty"` Version *string `json:"version,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/removeindexaction.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/removeindexaction.go index 0a3473cfb..798fbf39a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/removeindexaction.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/removeindexaction.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RemoveIndexAction type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/update_aliases/types.ts#L124-L139 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/update_aliases/types.ts#L124-L139 type RemoveIndexAction struct { // Index Data stream or index for the action. // Supports wildcards (`*`). diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/removeprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/removeprocessor.go index 386a05a3c..cc74e5d9e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/removeprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/removeprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RemoveProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L930-L940 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L930-L940 type RemoveProcessor struct { // Description Description of the processor. // Useful for describing the purpose of the processor or its configuration. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/renameprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/renameprocessor.go index 99f808ec0..6a0b6ed84 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/renameprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/renameprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RenameProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L942-L958 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L942-L958 type RenameProcessor struct { // Description Description of the processor. // Useful for describing the purpose of the processor or its configuration. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reportingemailattachment.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reportingemailattachment.go index 1120a04d7..6b75dc320 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reportingemailattachment.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reportingemailattachment.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ReportingEmailAttachment type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Actions.ts#L224-L232 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Actions.ts#L224-L232 type ReportingEmailAttachment struct { Inline *bool `json:"inline,omitempty"` Interval Duration `json:"interval,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/repositoriesrecord.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/repositoriesrecord.go index 3f2e763f1..a30d822fd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/repositoriesrecord.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/repositoriesrecord.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RepositoriesRecord type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/repositories/types.ts#L20-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/repositories/types.ts#L20-L31 type RepositoriesRecord struct { // Id The unique repository identifier. Id *string `json:"id,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/repository.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/repository.go index bb2791652..7336633b0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/repository.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/repository.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Repository type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/_types/SnapshotRepository.ts#L23-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/_types/SnapshotRepository.ts#L23-L27 type Repository struct { Settings RepositorySettings `json:"settings"` Type string `json:"type"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/repositoryintegrityindicator.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/repositoryintegrityindicator.go index bf9b4f030..2821c4f53 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/repositoryintegrityindicator.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/repositoryintegrityindicator.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // RepositoryIntegrityIndicator type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/health_report/types.ts#L134-L138 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/health_report/types.ts#L134-L138 type RepositoryIntegrityIndicator struct { Details *RepositoryIntegrityIndicatorDetails `json:"details,omitempty"` Diagnosis []Diagnosis `json:"diagnosis,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/repositoryintegrityindicatordetails.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/repositoryintegrityindicatordetails.go index d8ba5c47d..4e021ef59 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/repositoryintegrityindicatordetails.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/repositoryintegrityindicatordetails.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RepositoryIntegrityIndicatorDetails type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/health_report/types.ts#L139-L143 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/health_report/types.ts#L139-L143 type RepositoryIntegrityIndicatorDetails struct { Corrupted []string `json:"corrupted,omitempty"` CorruptedRepositories *int64 `json:"corrupted_repositories,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/repositorylocation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/repositorylocation.go index 11beee661..7904b3110 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/repositorylocation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/repositorylocation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RepositoryLocation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/RepositoryMeteringInformation.ts#L68-L74 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/RepositoryMeteringInformation.ts#L68-L74 type RepositoryLocation struct { BasePath string `json:"base_path"` // Bucket Bucket name (GCP, S3) diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/repositorymeteringinformation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/repositorymeteringinformation.go index 5aafd68f9..0992d2065 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/repositorymeteringinformation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/repositorymeteringinformation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RepositoryMeteringInformation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/RepositoryMeteringInformation.ts#L24-L66 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/RepositoryMeteringInformation.ts#L24-L66 type RepositoryMeteringInformation struct { // Archived A flag that tells whether or not this object has been archived. When a // repository is closed or updated the diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/repositorysettings.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/repositorysettings.go index 8db8ecce0..b06399f2a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/repositorysettings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/repositorysettings.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RepositorySettings type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/_types/SnapshotRepository.ts#L29-L38 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/_types/SnapshotRepository.ts#L29-L38 type RepositorySettings struct { ChunkSize *string `json:"chunk_size,omitempty"` Compress string `json:"compress,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/requestcachestats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/requestcachestats.go index daa01fbdf..30690b4c4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/requestcachestats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/requestcachestats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RequestCacheStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Stats.ts#L244-L250 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Stats.ts#L244-L250 type RequestCacheStats struct { Evictions int64 `json:"evictions"` HitCount int64 `json:"hit_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/requestcounts.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/requestcounts.go index 818abe702..5a5286a87 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/requestcounts.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/requestcounts.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RequestCounts type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/RepositoryMeteringInformation.ts#L76-L103 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/RepositoryMeteringInformation.ts#L76-L103 type RequestCounts struct { // GetBlob Number of Get Blob requests (Azure) GetBlob *int64 `json:"GetBlob,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/requestitem.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/requestitem.go index 16dbfff2d..21d3323e5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/requestitem.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/requestitem.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // MultisearchHeader // TemplateConfig // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/msearch_template/types.ts#L25-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/msearch_template/types.ts#L25-L26 type RequestItem interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reroutedecision.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reroutedecision.go index 5b81a680f..a66b20fcb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reroutedecision.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reroutedecision.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RerouteDecision type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/reroute/types.ts#L86-L90 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/reroute/types.ts#L86-L90 type RerouteDecision struct { Decider string `json:"decider"` Decision string `json:"decision"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rerouteexplanation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rerouteexplanation.go index 764a1eb29..8105d91fe 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rerouteexplanation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rerouteexplanation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RerouteExplanation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/reroute/types.ts#L92-L96 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/reroute/types.ts#L92-L96 type RerouteExplanation struct { Command string `json:"command"` Decisions []RerouteDecision `json:"decisions"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rerouteparameters.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rerouteparameters.go index 9493258e7..337441d4f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rerouteparameters.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rerouteparameters.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RerouteParameters type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/reroute/types.ts#L98-L105 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/reroute/types.ts#L98-L105 type RerouteParameters struct { AllowPrimary bool `json:"allow_primary"` FromNode *string `json:"from_node,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rescore.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rescore.go index 2768e2d55..920986938 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rescore.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rescore.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Rescore type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/rescoring.ts#L23-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/rescoring.ts#L23-L26 type Rescore struct { Query RescoreQuery `json:"query"` WindowSize *int `json:"window_size,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rescorequery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rescorequery.go index 658dd9327..f1c6dd599 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rescorequery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rescorequery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // RescoreQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/rescoring.ts#L28-L50 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/rescoring.ts#L28-L50 type RescoreQuery struct { // Query The query to use for rescoring. // This query is only run on the Top-K results returned by the `query` and diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reservedsize.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reservedsize.go index 3f33f8d73..2ad4241e0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reservedsize.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reservedsize.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ReservedSize type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/allocation_explain/types.ts#L71-L76 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/allocation_explain/types.ts#L71-L76 type ReservedSize struct { NodeId string `json:"node_id"` Path string `json:"path"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/resolveindexaliasitem.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/resolveindexaliasitem.go index 7a083eb4b..ff45a9e2b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/resolveindexaliasitem.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/resolveindexaliasitem.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // ResolveIndexAliasItem type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/resolve_index/ResolveIndexResponse.ts#L37-L40 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/resolve_index/ResolveIndexResponse.ts#L37-L40 type ResolveIndexAliasItem struct { Indices []string `json:"indices"` Name string `json:"name"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/resolveindexdatastreamsitem.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/resolveindexdatastreamsitem.go index a7759c4ea..8faca522c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/resolveindexdatastreamsitem.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/resolveindexdatastreamsitem.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // ResolveIndexDataStreamsItem type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/resolve_index/ResolveIndexResponse.ts#L42-L46 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/resolve_index/ResolveIndexResponse.ts#L42-L46 type ResolveIndexDataStreamsItem struct { BackingIndices []string `json:"backing_indices"` Name string `json:"name"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/resolveindexitem.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/resolveindexitem.go index 02073d0a1..7fdcb4304 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/resolveindexitem.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/resolveindexitem.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // ResolveIndexItem type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/resolve_index/ResolveIndexResponse.ts#L30-L35 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/resolve_index/ResolveIndexResponse.ts#L30-L35 type ResolveIndexItem struct { Aliases []string `json:"aliases,omitempty"` Attributes []string `json:"attributes"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/resourceprivileges.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/resourceprivileges.go index 368f17147..0de5294c6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/resourceprivileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/resourceprivileges.go @@ -16,11 +16,11 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // ResourcePrivileges type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/has_privileges/types.ts#L47-L47 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/has_privileges/types.ts#L47-L47 type ResourcePrivileges map[string]Privileges diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/responsebody.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/responsebody.go index 31664dbfd..4bae1d0d1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/responsebody.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/responsebody.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // ResponseBody type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/SearchResponse.ts#L38-L54 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/SearchResponse.ts#L38-L54 type ResponseBody struct { Aggregations map[string]Aggregate `json:"aggregations,omitempty"` Clusters_ *ClusterStatistics `json:"_clusters,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/responseitem.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/responseitem.go index 528910150..d3e47a609 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/responseitem.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/responseitem.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ResponseItem type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/bulk/types.ts#L37-L81 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/bulk/types.ts#L37-L81 type ResponseItem struct { // Error Contains additional information about the failed operation. // The parameter is only returned for failed operations. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/retention.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/retention.go index f6c1a649a..18b9dc7d4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/retention.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/retention.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Retention type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/slm/_types/SnapshotLifecycle.ts#L84-L97 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/slm/_types/SnapshotLifecycle.ts#L84-L97 type Retention struct { // ExpireAfter Time period after which a snapshot is considered expired and eligible for // deletion. SLM deletes expired snapshots based on the slm.retention_schedule. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/retentionlease.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/retentionlease.go index 8bc9c683a..80ab5efd4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/retentionlease.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/retentionlease.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // RetentionLease type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L65-L67 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L65-L67 type RetentionLease struct { Period Duration `json:"period"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/retentionpolicy.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/retentionpolicy.go index 79cc8a8ce..09b0a5e04 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/retentionpolicy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/retentionpolicy.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // RetentionPolicy type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/transform/_types/Transform.ts#L88-L96 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/transform/_types/Transform.ts#L88-L96 type RetentionPolicy struct { // Field The date field that is used to calculate the age of the document. Field string `json:"field"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/retentionpolicycontainer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/retentionpolicycontainer.go index a95074adc..138b72946 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/retentionpolicycontainer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/retentionpolicycontainer.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // RetentionPolicyContainer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/transform/_types/Transform.ts#L80-L86 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/transform/_types/Transform.ts#L80-L86 type RetentionPolicyContainer struct { // Time Specifies that the transform uses a time field to set the retention policy. Time *RetentionPolicy `json:"time,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/retries.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/retries.go index 34fdb1b5a..679b7fd6f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/retries.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/retries.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Retries type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Retries.ts#L22-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Retries.ts#L22-L25 type Retries struct { Bulk int64 `json:"bulk"` Search int64 `json:"search"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reversenestedaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reversenestedaggregate.go index 838900c49..182b1aa2b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reversenestedaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reversenestedaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // ReverseNestedAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L489-L490 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L489-L490 type ReverseNestedAggregate struct { Aggregations map[string]Aggregate `json:"-"` DocCount int64 `json:"doc_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reversenestedaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reversenestedaggregation.go index d3bbef9c8..4e10a80c5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reversenestedaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reversenestedaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ReverseNestedAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L719-L725 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L719-L725 type ReverseNestedAggregation struct { Meta Metadata `json:"meta,omitempty"` Name *string `json:"name,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reversetokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reversetokenfilter.go index f3b76014a..a7f4150d2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reversetokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/reversetokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // ReverseTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L305-L307 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L305-L307 type ReverseTokenFilter struct { Type string `json:"type,omitempty"` Version *string `json:"version,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/role.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/role.go index 63d677edf..8ed4fb282 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/role.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/role.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // Role type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/get_role/types.ts#L29-L42 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/get_role/types.ts#L29-L42 type Role struct { Applications []ApplicationPrivileges `json:"applications"` Cluster []string `json:"cluster"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/roledescriptor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/roledescriptor.go index ff7450f40..db49ec5a9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/roledescriptor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/roledescriptor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // RoleDescriptor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/_types/RoleDescriptor.ts#L27-L55 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/_types/RoleDescriptor.ts#L27-L55 type RoleDescriptor struct { // Applications A list of application privilege entries Applications []ApplicationPrivileges `json:"applications,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/roledescriptorread.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/roledescriptorread.go index 20d8e0a7e..f74572c7e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/roledescriptorread.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/roledescriptorread.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // RoleDescriptorRead type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/_types/RoleDescriptor.ts#L57-L85 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/_types/RoleDescriptor.ts#L57-L85 type RoleDescriptorRead struct { // Applications A list of application privilege entries Applications []ApplicationPrivileges `json:"applications,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/roledescriptorwrapper.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/roledescriptorwrapper.go index 7a91cac4c..6f5c73c8e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/roledescriptorwrapper.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/roledescriptorwrapper.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // RoleDescriptorWrapper type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/get_service_accounts/types.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/get_service_accounts/types.ts#L22-L24 type RoleDescriptorWrapper struct { RoleDescriptor RoleDescriptorRead `json:"role_descriptor"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rolemappingrule.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rolemappingrule.go index b30aa63a1..a70ac847f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rolemappingrule.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rolemappingrule.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // RoleMappingRule type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/_types/RoleMappingRule.ts#L23-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/_types/RoleMappingRule.ts#L23-L31 type RoleMappingRule struct { All []RoleMappingRule `json:"all,omitempty"` Any []RoleMappingRule `json:"any,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/roletemplate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/roletemplate.go index 3a11c5140..8716c844a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/roletemplate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/roletemplate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // RoleTemplate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/get_role/types.ts#L50-L53 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/_types/RoleTemplate.ts#L28-L31 type RoleTemplate struct { Format *templateformat.TemplateFormat `json:"format,omitempty"` Template Script `json:"template"` @@ -58,9 +58,40 @@ func (s *RoleTemplate) UnmarshalJSON(data []byte) error { } case "template": - if err := dec.Decode(&s.Template); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Template = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Template = o + + } + } } } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/roletemplateinlinequery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/roletemplateinlinequery.go index f10a2e21c..298a2bf9c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/roletemplateinlinequery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/roletemplateinlinequery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // string // Query // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/_types/Privileges.ts#L160-L161 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/_types/Privileges.ts#L160-L161 type RoleTemplateInlineQuery interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/roletemplateinlinescript.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/roletemplateinlinescript.go index 7f82cced5..a9d1614b8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/roletemplateinlinescript.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/roletemplateinlinescript.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // RoleTemplateInlineScript type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/_types/Privileges.ts#L153-L158 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/_types/Privileges.ts#L153-L158 type RoleTemplateInlineScript struct { Lang *scriptlanguage.ScriptLanguage `json:"lang,omitempty"` Options map[string]string `json:"options,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/roletemplatequery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/roletemplatequery.go index 939de49b7..175a8ed4e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/roletemplatequery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/roletemplatequery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // RoleTemplateQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/_types/Privileges.ts#L141-L151 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/_types/Privileges.ts#L141-L151 type RoleTemplateQuery struct { // Template When you create a role, you can specify a query that defines the document // level security permissions. You can optionally @@ -58,9 +58,40 @@ func (s *RoleTemplateQuery) UnmarshalJSON(data []byte) error { switch t { case "template": - if err := dec.Decode(&s.Template); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewRoleTemplateInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Template = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Template = o + + } + } } } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/roletemplatescript.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/roletemplatescript.go index b45214d73..a8b47e0ce 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/roletemplatescript.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/roletemplatescript.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // RoleTemplateInlineScript // StoredScriptId // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/_types/Privileges.ts#L163-L164 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/_types/Privileges.ts#L163-L164 type RoleTemplateScript interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rolloverconditions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rolloverconditions.go index d0a2675f3..eeda202e8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rolloverconditions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rolloverconditions.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RolloverConditions type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/rollover/types.ts#L24-L40 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/rollover/types.ts#L24-L40 type RolloverConditions struct { MaxAge Duration `json:"max_age,omitempty"` MaxAgeMillis *int64 `json:"max_age_millis,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupcapabilities.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupcapabilities.go index 9734151a8..29c328b4d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupcapabilities.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupcapabilities.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // RollupCapabilities type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/rollup/get_rollup_caps/types.ts#L25-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/rollup/get_rollup_caps/types.ts#L25-L27 type RollupCapabilities struct { RollupJobs []RollupCapabilitySummary `json:"rollup_jobs"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupcapabilitysummary.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupcapabilitysummary.go index 8374084d1..5d081833b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupcapabilitysummary.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupcapabilitysummary.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RollupCapabilitySummary type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/rollup/get_rollup_caps/types.ts#L29-L34 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/rollup/get_rollup_caps/types.ts#L29-L34 type RollupCapabilitySummary struct { Fields map[string][]RollupFieldSummary `json:"fields"` IndexPattern string `json:"index_pattern"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupfieldsummary.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupfieldsummary.go index e22aad559..b42ae8abc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupfieldsummary.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupfieldsummary.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RollupFieldSummary type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/rollup/get_rollup_caps/types.ts#L36-L40 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/rollup/get_rollup_caps/types.ts#L36-L40 type RollupFieldSummary struct { Agg string `json:"agg"` CalendarInterval Duration `json:"calendar_interval,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupjob.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupjob.go index ff759358f..9d4b0727a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupjob.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupjob.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // RollupJob type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/rollup/get_jobs/types.ts#L28-L32 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/rollup/get_jobs/types.ts#L28-L32 type RollupJob struct { Config RollupJobConfiguration `json:"config"` Stats RollupJobStats `json:"stats"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupjobconfiguration.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupjobconfiguration.go index d2b803aca..0cc7ee199 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupjobconfiguration.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupjobconfiguration.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RollupJobConfiguration type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/rollup/get_jobs/types.ts#L34-L43 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/rollup/get_jobs/types.ts#L34-L43 type RollupJobConfiguration struct { Cron string `json:"cron"` Groups Groupings `json:"groups"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupjobstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupjobstats.go index e37208657..48760a846 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupjobstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupjobstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RollupJobStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/rollup/get_jobs/types.ts#L45-L58 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/rollup/get_jobs/types.ts#L45-L58 type RollupJobStats struct { DocumentsProcessed int64 `json:"documents_processed"` IndexFailures int64 `json:"index_failures"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupjobstatus.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupjobstatus.go index 339c4a236..0c1d4043f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupjobstatus.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupjobstatus.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // RollupJobStatus type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/rollup/get_jobs/types.ts#L60-L64 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/rollup/get_jobs/types.ts#L60-L64 type RollupJobStatus struct { CurrentPosition map[string]json.RawMessage `json:"current_position,omitempty"` JobState indexingjobstate.IndexingJobState `json:"job_state"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupjobsummary.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupjobsummary.go index 3666a3cca..e61cdd444 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupjobsummary.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupjobsummary.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RollupJobSummary type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/rollup/get_rollup_index_caps/types.ts#L28-L33 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/rollup/get_rollup_index_caps/types.ts#L28-L33 type RollupJobSummary struct { Fields map[string][]RollupJobSummaryField `json:"fields"` IndexPattern string `json:"index_pattern"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupjobsummaryfield.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupjobsummaryfield.go index 8c67881a4..06a894ee5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupjobsummaryfield.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rollupjobsummaryfield.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RollupJobSummaryField type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/rollup/get_rollup_index_caps/types.ts#L35-L39 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/rollup/get_rollup_index_caps/types.ts#L35-L39 type RollupJobSummaryField struct { Agg string `json:"agg"` CalendarInterval Duration `json:"calendar_interval,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/routingfield.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/routingfield.go index eced7fa6f..59646c150 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/routingfield.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/routingfield.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RoutingField type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/meta-fields.ts#L50-L52 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/meta-fields.ts#L50-L52 type RoutingField struct { Required bool `json:"required"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rrfrank.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rrfrank.go index ebc487817..805d536dd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rrfrank.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rrfrank.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RrfRank type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Rank.ts#L32-L37 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Rank.ts#L32-L37 type RrfRank struct { // RankConstant How much influence documents in individual result sets per query have over // the final ranked result set diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rulecondition.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rulecondition.go index ab2b72e35..6a4224cda 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rulecondition.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rulecondition.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -33,7 +33,7 @@ import ( // RuleCondition type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Rule.ts#L52-L65 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Rule.ts#L52-L65 type RuleCondition struct { // AppliesTo Specifies the result property to which the condition applies. If your // detector uses `lat_long`, `metric`, `rare`, or `freq_rare` functions, you can diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rulequery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rulequery.go index 28c486159..4c3c931ca 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rulequery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/rulequery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RuleQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/specialized.ts#L369-L373 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/specialized.ts#L369-L373 type RuleQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/runningstatesearchinterval.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/runningstatesearchinterval.go index a4133ce2d..50e628e53 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/runningstatesearchinterval.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/runningstatesearchinterval.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // RunningStateSearchInterval type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Datafeed.ts#L214-L231 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Datafeed.ts#L214-L231 type RunningStateSearchInterval struct { // End The end time. End Duration `json:"end,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/runtimefield.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/runtimefield.go index 3803d1e99..b0d121566 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/runtimefield.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/runtimefield.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // RuntimeField type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/RuntimeFields.ts#L26-L48 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/RuntimeFields.ts#L26-L48 type RuntimeField struct { // FetchFields For type `lookup` FetchFields []RuntimeFieldFetchFields `json:"fetch_fields,omitempty"` @@ -89,9 +89,40 @@ func (s *RuntimeField) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } case "target_field": if err := dec.Decode(&s.TargetField); err != nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/runtimefieldfetchfields.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/runtimefieldfetchfields.go index 5b604072b..28ab4c56a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/runtimefieldfetchfields.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/runtimefieldfetchfields.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RuntimeFieldFetchFields type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/RuntimeFields.ts#L50-L54 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/RuntimeFields.ts#L50-L54 type RuntimeFieldFetchFields struct { Field string `json:"field"` Format *string `json:"format,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/runtimefields.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/runtimefields.go index b48da70af..bc5b4344a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/runtimefields.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/runtimefields.go @@ -16,11 +16,11 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // RuntimeFields type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/RuntimeFields.ts#L24-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/RuntimeFields.ts#L24-L24 type RuntimeFields map[string]RuntimeField diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/runtimefieldstype.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/runtimefieldstype.go index d495386b9..081dfa387 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/runtimefieldstype.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/runtimefieldstype.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // RuntimeFieldsType type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L279-L294 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L279-L294 type RuntimeFieldsType struct { CharsMax int64 `json:"chars_max"` CharsTotal int64 `json:"chars_total"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/samplediversity.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/samplediversity.go index e84017782..4db77329a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/samplediversity.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/samplediversity.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SampleDiversity type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/graph/_types/ExploreControls.ts#L51-L54 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/graph/_types/ExploreControls.ts#L51-L54 type SampleDiversity struct { Field string `json:"field"` MaxDocsPerValue int `json:"max_docs_per_value"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sampleraggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sampleraggregate.go index f77fbbcae..b4c42f5e3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sampleraggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sampleraggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // SamplerAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L498-L499 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L498-L499 type SamplerAggregate struct { Aggregations map[string]Aggregate `json:"-"` DocCount int64 `json:"doc_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sampleraggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sampleraggregation.go index 0b41c6e6e..b198afb0a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sampleraggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sampleraggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SamplerAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L727-L733 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L727-L733 type SamplerAggregation struct { Meta Metadata `json:"meta,omitempty"` Name *string `json:"name,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scalarvalue.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scalarvalue.go new file mode 100644 index 000000000..ef4cc8b1a --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scalarvalue.go @@ -0,0 +1,32 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated from the elasticsearch-specification DO NOT EDIT. +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c + +package types + +// ScalarValue holds the union for the following types: +// +// int64 +// Float64 +// string +// bool +// nil +// +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L39-L43 +type ScalarValue interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scaledfloatnumberproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scaledfloatnumberproperty.go index b43820472..dd1e38551 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scaledfloatnumberproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scaledfloatnumberproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -34,7 +34,7 @@ import ( // ScaledFloatNumberProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/core.ts#L174-L178 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/core.ts#L174-L178 type ScaledFloatNumberProperty struct { Boost *Float64 `json:"boost,omitempty"` Coerce *bool `json:"coerce,omitempty"` @@ -847,9 +847,40 @@ func (s *ScaledFloatNumberProperty) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } case "similarity": var tmp json.RawMessage diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/schedulecontainer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/schedulecontainer.go index 98b6312d7..3880e33ea 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/schedulecontainer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/schedulecontainer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // ScheduleContainer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Schedule.ts#L85-L96 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Schedule.ts#L85-L96 type ScheduleContainer struct { Cron *string `json:"cron,omitempty"` Daily *DailySchedule `json:"daily,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scheduletimeofday.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scheduletimeofday.go index 88d078de4..f8fafe170 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scheduletimeofday.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scheduletimeofday.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // string // HourAndMinute // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Schedule.ts#L103-L108 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Schedule.ts#L103-L108 type ScheduleTimeOfDay interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scheduletriggerevent.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scheduletriggerevent.go index a110f30a8..26abe5b0b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scheduletriggerevent.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scheduletriggerevent.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // ScheduleTriggerEvent type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Schedule.ts#L98-L101 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Schedule.ts#L98-L101 type ScheduleTriggerEvent struct { ScheduledTime DateTime `json:"scheduled_time"` TriggeredTime DateTime `json:"triggered_time,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scoresort.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scoresort.go index 8106b4c6c..bd2cdc30f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scoresort.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scoresort.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,7 +26,7 @@ import ( // ScoreSort type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/sort.ts#L55-L57 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/sort.ts#L55-L57 type ScoreSort struct { Order *sortorder.SortOrder `json:"order,omitempty"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/script.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/script.go index 4d1afe856..194b9f6ce 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/script.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/script.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // InlineScript // StoredScriptId // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Scripting.ts#L88-L89 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Scripting.ts#L88-L89 type Script interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptcache.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptcache.go index 5a173b07e..0de28aa32 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptcache.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptcache.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ScriptCache type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L1031-L1045 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L1031-L1045 type ScriptCache struct { // CacheEvictions Total number of times the script cache has evicted old data. CacheEvictions *int64 `json:"cache_evictions,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptcondition.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptcondition.go index 32fb98688..c73875be8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptcondition.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptcondition.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ScriptCondition type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Conditions.ts#L76-L84 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Conditions.ts#L76-L84 type ScriptCondition struct { Id *string `json:"id,omitempty"` Lang *string `json:"lang,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptedheuristic.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptedheuristic.go index 1b634fdf6..e5f4a7632 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptedheuristic.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptedheuristic.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // ScriptedHeuristic type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L766-L768 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L766-L768 type ScriptedHeuristic struct { Script Script `json:"script"` } @@ -50,9 +50,40 @@ func (s *ScriptedHeuristic) UnmarshalJSON(data []byte) error { switch t { case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } } } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptedmetricaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptedmetricaggregate.go index 3a1ba0e5c..24a953090 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptedmetricaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptedmetricaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // ScriptedMetricAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L649-L652 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L649-L652 type ScriptedMetricAggregate struct { Meta Metadata `json:"meta,omitempty"` Value json.RawMessage `json:"value,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptedmetricaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptedmetricaggregation.go index 0b07466f1..70ce063eb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptedmetricaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptedmetricaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // ScriptedMetricAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L254-L280 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L254-L280 type ScriptedMetricAggregation struct { // CombineScript Runs once on each shard after document collection is complete. // Allows the aggregation to consolidate the state returned from each shard. @@ -74,9 +74,40 @@ func (s *ScriptedMetricAggregation) UnmarshalJSON(data []byte) error { switch t { case "combine_script": - if err := dec.Decode(&s.CombineScript); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.CombineScript = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.CombineScript = o + + } + } case "field": if err := dec.Decode(&s.Field); err != nil { @@ -84,14 +115,76 @@ func (s *ScriptedMetricAggregation) UnmarshalJSON(data []byte) error { } case "init_script": - if err := dec.Decode(&s.InitScript); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.InitScript = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.InitScript = o + + } + } case "map_script": - if err := dec.Decode(&s.MapScript); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.MapScript = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.MapScript = o + + } + } case "missing": if err := dec.Decode(&s.Missing); err != nil { @@ -107,14 +200,76 @@ func (s *ScriptedMetricAggregation) UnmarshalJSON(data []byte) error { } case "reduce_script": - if err := dec.Decode(&s.ReduceScript); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.ReduceScript = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.ReduceScript = o + + } + } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } } } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptfield.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptfield.go index 868adefc3..c2cd1d08c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptfield.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptfield.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ScriptField type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Scripting.ts#L91-L94 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Scripting.ts#L91-L94 type ScriptField struct { IgnoreFailure *bool `json:"ignore_failure,omitempty"` Script Script `json:"script"` @@ -66,9 +66,40 @@ func (s *ScriptField) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } } } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scripting.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scripting.go index 4d6fbd8aa..77966ca70 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scripting.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scripting.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Scripting type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L977-L995 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L977-L995 type Scripting struct { // CacheEvictions Total number of times the script cache has evicted old data. CacheEvictions *int64 `json:"cache_evictions,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptquery.go index 62932b898..f1a70818f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ScriptQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/specialized.ts#L318-L324 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/specialized.ts#L318-L324 type ScriptQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. @@ -88,9 +88,40 @@ func (s *ScriptQuery) UnmarshalJSON(data []byte) error { s.QueryName_ = &o case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } } } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptscorefunction.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptscorefunction.go index 51123ff4a..8c66764ab 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptscorefunction.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptscorefunction.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // ScriptScoreFunction type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/compound.ts#L120-L125 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/compound.ts#L120-L125 type ScriptScoreFunction struct { // Script A script that computes a score. Script Script `json:"script"` @@ -51,9 +51,40 @@ func (s *ScriptScoreFunction) UnmarshalJSON(data []byte) error { switch t { case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } } } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptscorequery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptscorequery.go index 594e9ce81..3a809a124 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptscorequery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptscorequery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ScriptScoreQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/specialized.ts#L326-L340 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/specialized.ts#L326-L340 type ScriptScoreQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. @@ -115,9 +115,40 @@ func (s *ScriptScoreQuery) UnmarshalJSON(data []byte) error { s.QueryName_ = &o case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } } } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptsort.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptsort.go index 1d531314f..e41b03b8c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptsort.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scriptsort.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -33,7 +33,7 @@ import ( // ScriptSort type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/sort.ts#L68-L74 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/sort.ts#L68-L74 type ScriptSort struct { Mode *sortmode.SortMode `json:"mode,omitempty"` Nested *NestedSortValue `json:"nested,omitempty"` @@ -73,9 +73,40 @@ func (s *ScriptSort) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } case "type": if err := dec.Decode(&s.Type); err != nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scripttransform.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scripttransform.go index 26b4344d2..3eef85f58 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scripttransform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scripttransform.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ScriptTransform type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Transform.ts#L36-L44 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Transform.ts#L36-L44 type ScriptTransform struct { Id *string `json:"id,omitempty"` Lang *string `json:"lang,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scrollids.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scrollids.go index 3501d3ad3..54ec201d4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scrollids.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/scrollids.go @@ -16,11 +16,11 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // ScrollIds type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L50-L50 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L56-L56 type ScrollIds []string diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchablesnapshots.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchablesnapshots.go index b3ba5cf10..ce8b89bb0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchablesnapshots.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchablesnapshots.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SearchableSnapshots type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L428-L432 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L428-L432 type SearchableSnapshots struct { Available bool `json:"available"` Enabled bool `json:"enabled"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchapplication.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchapplication.go index 54e75637f..bdc1f3fc5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchapplication.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchapplication.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // SearchApplication type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/search_application/_types/SearchApplication.ts#L24-L45 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/search_application/_types/SearchApplication.ts#L24-L45 type SearchApplication struct { // AnalyticsCollectionName Analytics collection associated to the Search Application. AnalyticsCollectionName *string `json:"analytics_collection_name,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchapplicationlistitem.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchapplicationlistitem.go index c2572373f..a1fdf50cb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchapplicationlistitem.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchapplicationlistitem.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // SearchApplicationListItem type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/search_application/list/SearchApplicationsListResponse.ts#L31-L48 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/search_application/list/SearchApplicationsListResponse.ts#L31-L48 type SearchApplicationListItem struct { // AnalyticsCollectionName Analytics collection associated to the Search Application AnalyticsCollectionName *string `json:"analytics_collection_name,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchapplicationtemplate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchapplicationtemplate.go index 8fac2cd1f..f4e01c068 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchapplicationtemplate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchapplicationtemplate.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // SearchApplicationTemplate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/search_application/_types/SearchApplication.ts#L47-L52 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/search_application/_types/SearchApplication.ts#L47-L52 type SearchApplicationTemplate struct { // Script The associated mustache template. Script InlineScript `json:"script"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchasyoutypeproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchasyoutypeproperty.go index 1d86ed360..afca17eec 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchasyoutypeproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchasyoutypeproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -34,7 +34,7 @@ import ( // SearchAsYouTypeProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/core.ts#L197-L207 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/core.ts#L197-L207 type SearchAsYouTypeProperty struct { Analyzer *string `json:"analyzer,omitempty"` CopyTo []string `json:"copy_to,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchidle.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchidle.go index 47f5fd1a1..d8ef42c23 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchidle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchidle.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // SearchIdle type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L236-L239 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L236-L239 type SearchIdle struct { After Duration `json:"after,omitempty"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchinput.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchinput.go index c569d80b5..7e7da8227 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchinput.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchinput.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // SearchInput type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Input.ts#L112-L116 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Input.ts#L112-L116 type SearchInput struct { Extract []string `json:"extract,omitempty"` Request SearchInputRequestDefinition `json:"request"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchinputrequestbody.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchinputrequestbody.go index b050fd19e..5ef53575e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchinputrequestbody.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchinputrequestbody.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // SearchInputRequestBody type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Input.ts#L147-L149 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Input.ts#L147-L149 type SearchInputRequestBody struct { Query Query `json:"query"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchinputrequestdefinition.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchinputrequestdefinition.go index 391979cf7..6609001aa 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchinputrequestdefinition.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchinputrequestdefinition.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // SearchInputRequestDefinition type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Input.ts#L118-L125 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Input.ts#L118-L125 type SearchInputRequestDefinition struct { Body *SearchInputRequestBody `json:"body,omitempty"` Indices []string `json:"indices,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchprofile.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchprofile.go index ac2842565..b1126ceca 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchprofile.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchprofile.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SearchProfile type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/profile.ts#L126-L130 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/profile.ts#L126-L130 type SearchProfile struct { Collector []Collector `json:"collector"` Query []QueryProfile `json:"query"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchstats.go index b1861b204..48c504a75 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SearchStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Stats.ts#L252-L271 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Stats.ts#L252-L271 type SearchStats struct { FetchCurrent int64 `json:"fetch_current"` FetchTime Duration `json:"fetch_time,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchtemplaterequestbody.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchtemplaterequestbody.go index 8730ef7a0..33c4a1b30 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchtemplaterequestbody.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchtemplaterequestbody.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SearchTemplateRequestBody type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Input.ts#L128-L145 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Input.ts#L128-L145 type SearchTemplateRequestBody struct { Explain *bool `json:"explain,omitempty"` // Id ID of the search template to use. If no source is specified, diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchtransform.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchtransform.go index f9f8a0ab7..5e19a1af0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchtransform.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/searchtransform.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // SearchTransform type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Transform.ts#L46-L49 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Transform.ts#L46-L49 type SearchTransform struct { Request SearchInputRequestDefinition `json:"request"` Timeout Duration `json:"timeout"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/security.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/security.go index ef806fc3c..ea55d3af1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/security.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/security.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Security type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L434-L447 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L434-L447 type Security struct { Anonymous FeatureToggle `json:"anonymous"` ApiKeyService FeatureToggle `json:"api_key_service"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/securityrealm.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/securityrealm.go index 1c3bbbb55..1954fe097 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/securityrealm.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/securityrealm.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // SecurityRealm type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/_types/RoleMappingRule.ts#L44-L46 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/_types/RoleMappingRule.ts#L44-L46 type SecurityRealm struct { Name string `json:"name"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/securityrolemapping.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/securityrolemapping.go index 707810e1f..59a52edbf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/securityrolemapping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/securityrolemapping.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SecurityRoleMapping type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/_types/RoleMapping.ts#L25-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/_types/RoleMapping.ts#L25-L31 type SecurityRoleMapping struct { Enabled bool `json:"enabled"` Metadata Metadata `json:"metadata"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/securityroles.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/securityroles.go index bd125150f..1a0fd88d0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/securityroles.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/securityroles.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // SecurityRoles type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L296-L300 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L296-L300 type SecurityRoles struct { Dls SecurityRolesDls `json:"dls"` File SecurityRolesFile `json:"file"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/securityrolesdls.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/securityrolesdls.go index a8b0ea396..7564bf21c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/securityrolesdls.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/securityrolesdls.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // SecurityRolesDls type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L308-L310 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L308-L310 type SecurityRolesDls struct { BitSetCache SecurityRolesDlsBitSetCache `json:"bit_set_cache"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/securityrolesdlsbitsetcache.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/securityrolesdlsbitsetcache.go index 464e87dd2..0bcf0e98d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/securityrolesdlsbitsetcache.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/securityrolesdlsbitsetcache.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SecurityRolesDlsBitSetCache type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L312-L316 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L312-L316 type SecurityRolesDlsBitSetCache struct { Count int `json:"count"` Memory ByteSize `json:"memory,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/securityrolesfile.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/securityrolesfile.go index f838e47c7..12972aff5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/securityrolesfile.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/securityrolesfile.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SecurityRolesFile type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L318-L322 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L318-L322 type SecurityRolesFile struct { Dls bool `json:"dls"` Fls bool `json:"fls"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/securityrolesnative.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/securityrolesnative.go index 17752e5cf..8624d9fa0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/securityrolesnative.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/securityrolesnative.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SecurityRolesNative type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L302-L306 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L302-L306 type SecurityRolesNative struct { Dls bool `json:"dls"` Fls bool `json:"fls"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/segment.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/segment.go index dc9390dde..8c48c01e9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/segment.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/segment.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Segment type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/segments/types.ts#L28-L38 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/segments/types.ts#L28-L38 type Segment struct { Attributes map[string]string `json:"attributes"` Committed bool `json:"committed"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/segmentsrecord.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/segmentsrecord.go index c25022c79..933f8359a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/segmentsrecord.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/segmentsrecord.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SegmentsRecord type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/segments/types.ts#L22-L107 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/segments/types.ts#L22-L107 type SegmentsRecord struct { // Committed If `true`, the segment is synced to disk. // Segments that are synced can survive a hard reboot. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/segmentsstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/segmentsstats.go index 6198193f0..df20c1fb4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/segmentsstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/segmentsstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SegmentsStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Stats.ts#L273-L366 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Stats.ts#L273-L366 type SegmentsStats struct { // Count Total number of segments across all shards assigned to selected nodes. Count int `json:"count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/serialdifferencingaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/serialdifferencingaggregation.go index ff3e7d296..7bff4abc7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/serialdifferencingaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/serialdifferencingaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // SerialDifferencingAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L363-L369 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L363-L369 type SerialDifferencingAggregation struct { // BucketsPath Path to the buckets that contain one set of values to correlate. BucketsPath BucketsPath `json:"buckets_path,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/serializedclusterstate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/serializedclusterstate.go index 2f4d09e03..265077a5d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/serializedclusterstate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/serializedclusterstate.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // SerializedClusterState type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L232-L238 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L232-L238 type SerializedClusterState struct { Diffs *SerializedClusterStateDetail `json:"diffs,omitempty"` // FullStates Number of published cluster states. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/serializedclusterstatedetail.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/serializedclusterstatedetail.go index 61bddf4e7..b236b9e35 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/serializedclusterstatedetail.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/serializedclusterstatedetail.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SerializedClusterStateDetail type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L240-L246 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L240-L246 type SerializedClusterStateDetail struct { CompressedSize *string `json:"compressed_size,omitempty"` CompressedSizeInBytes *int64 `json:"compressed_size_in_bytes,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/servicetoken.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/servicetoken.go index 7ecc34c2c..4e9d0e301 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/servicetoken.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/servicetoken.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ServiceToken type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/create_service_token/types.ts#L22-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/create_service_token/types.ts#L22-L25 type ServiceToken struct { Name string `json:"name"` Value string `json:"value"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/setprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/setprocessor.go index 339c49970..735448c68 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/setprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/setprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SetProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L982-L1016 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L982-L1016 type SetProcessor struct { // CopyFrom The origin field which will be copied to `field`, cannot set `value` // simultaneously. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/setsecurityuserprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/setsecurityuserprocessor.go index 8047cc1fd..eef66f66c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/setsecurityuserprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/setsecurityuserprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SetSecurityUserProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L1018-L1027 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L1018-L1027 type SetSecurityUserProcessor struct { // Description Description of the processor. // Useful for describing the purpose of the processor or its configuration. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settings.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settings.go index df0e73bbd..6048408ce 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settings.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Settings type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/transform/_types/Transform.ts#L98-L144 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/transform/_types/Transform.ts#L98-L144 type Settings struct { // AlignCheckpoints Specifies whether the transform checkpoint ranges should be optimized for // performance. Such optimization can align diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingsanalyze.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingsanalyze.go index 65954ed88..5ab72fd8a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingsanalyze.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingsanalyze.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // SettingsAnalyze type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L226-L229 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L226-L229 type SettingsAnalyze struct { MaxTokenCount Stringifiedinteger `json:"max_token_count,omitempty"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingshighlight.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingshighlight.go index 9624a3a64..44bc9558c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingshighlight.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingshighlight.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SettingsHighlight type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L221-L224 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L221-L224 type SettingsHighlight struct { MaxAnalyzedOffset *int `json:"max_analyzed_offset,omitempty"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingsquerystring.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingsquerystring.go index 890d45de5..fdf7436df 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingsquerystring.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingsquerystring.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // SettingsQueryString type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L241-L243 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L241-L243 type SettingsQueryString struct { Lenient Stringifiedboolean `json:"lenient"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssearch.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssearch.go index fb5d92cca..a83acbd99 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssearch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssearch.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // SettingsSearch type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L231-L234 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L231-L234 type SettingsSearch struct { Idle *SearchIdle `json:"idle,omitempty"` Slowlog *SlowlogSettings `json:"slowlog,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssimilarity.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssimilarity.go index b7e82f6bb..ea021b4b2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssimilarity.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssimilarity.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // SettingsSimilarity type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L170-L178 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L170-L178 type SettingsSimilarity struct { Bm25 *SettingsSimilarityBm25 `json:"bm25,omitempty"` Dfi *SettingsSimilarityDfi `json:"dfi,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssimilaritybm25.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssimilaritybm25.go index aeb93e08d..9b95d50e5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssimilaritybm25.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssimilaritybm25.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SettingsSimilarityBm25 type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L180-L185 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L180-L185 type SettingsSimilarityBm25 struct { B Float64 `json:"b"` DiscountOverlaps bool `json:"discount_overlaps"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssimilaritydfi.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssimilaritydfi.go index 8ec9ffd7b..fca9600bd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssimilaritydfi.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssimilaritydfi.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -28,7 +28,7 @@ import ( // SettingsSimilarityDfi type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L187-L190 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L187-L190 type SettingsSimilarityDfi struct { IndependenceMeasure dfiindependencemeasure.DFIIndependenceMeasure `json:"independence_measure"` Type string `json:"type,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssimilaritydfr.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssimilaritydfr.go index e6631e753..0a50ea63c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssimilaritydfr.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssimilaritydfr.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SettingsSimilarityDfr type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L192-L197 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L192-L197 type SettingsSimilarityDfr struct { AfterEffect dfraftereffect.DFRAfterEffect `json:"after_effect"` BasicModel dfrbasicmodel.DFRBasicModel `json:"basic_model"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssimilarityib.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssimilarityib.go index 38cbf779e..0b1682a16 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssimilarityib.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssimilarityib.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SettingsSimilarityIb type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L199-L204 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L199-L204 type SettingsSimilarityIb struct { Distribution ibdistribution.IBDistribution `json:"distribution"` Lambda iblambda.IBLambda `json:"lambda"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssimilaritylmd.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssimilaritylmd.go index d341d0e99..3b6ede846 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssimilaritylmd.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssimilaritylmd.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SettingsSimilarityLmd type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L206-L209 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L206-L209 type SettingsSimilarityLmd struct { Mu int `json:"mu"` Type string `json:"type,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssimilaritylmj.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssimilaritylmj.go index fdb98447c..66cc2b693 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssimilaritylmj.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssimilaritylmj.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SettingsSimilarityLmj type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L211-L214 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L211-L214 type SettingsSimilarityLmj struct { Lambda Float64 `json:"lambda"` Type string `json:"type,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssimilarityscriptedtfidf.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssimilarityscriptedtfidf.go index 38c182336..182907f5a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssimilarityscriptedtfidf.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/settingssimilarityscriptedtfidf.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // SettingsSimilarityScriptedTfidf type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L216-L219 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L216-L219 type SettingsSimilarityScriptedTfidf struct { Script Script `json:"script"` Type string `json:"type,omitempty"` @@ -51,9 +51,40 @@ func (s *SettingsSimilarityScriptedTfidf) UnmarshalJSON(data []byte) error { switch t { case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } case "type": if err := dec.Decode(&s.Type); err != nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shapefieldquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shapefieldquery.go index 7709ea965..1a82104db 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shapefieldquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shapefieldquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // ShapeFieldQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/specialized.ts#L354-L367 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/specialized.ts#L354-L367 type ShapeFieldQuery struct { // IndexedShape Queries using a pre-indexed shape. IndexedShape *FieldLookup `json:"indexed_shape,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shapeproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shapeproperty.go index 288e8b0b6..42c61faf9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shapeproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shapeproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -33,7 +33,7 @@ import ( // ShapeProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/geo.ts#L69-L81 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/geo.ts#L69-L81 type ShapeProperty struct { Coerce *bool `json:"coerce,omitempty"` CopyTo []string `json:"copy_to,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shapequery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shapequery.go index c9a0c03f0..9ea661429 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shapequery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shapequery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // ShapeQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/specialized.ts#L344-L352 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/specialized.ts#L344-L352 type ShapeQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardcommit.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardcommit.go index f5bacf31f..9ff3b73e1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardcommit.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardcommit.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ShardCommit type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/stats/types.ts#L112-L117 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/stats/types.ts#L112-L117 type ShardCommit struct { Generation int `json:"generation"` Id string `json:"id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardfailure.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardfailure.go index 399dcf387..54853b915 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardfailure.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardfailure.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ShardFailure type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Errors.ts#L50-L56 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Errors.ts#L50-L56 type ShardFailure struct { Index *string `json:"index,omitempty"` Node *string `json:"node,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardfilesizeinfo.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardfilesizeinfo.go index f8fdf88e6..f1da14598 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardfilesizeinfo.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardfilesizeinfo.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ShardFileSizeInfo type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/stats/types.ts#L124-L131 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/stats/types.ts#L124-L131 type ShardFileSizeInfo struct { AverageSizeInBytes *int64 `json:"average_size_in_bytes,omitempty"` Count *int64 `json:"count,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardhealthstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardhealthstats.go index a74706c65..4128e30ef 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardhealthstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardhealthstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // ShardHealthStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/health/types.ts#L36-L43 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/health/types.ts#L36-L43 type ShardHealthStats struct { ActiveShards int `json:"active_shards"` InitializingShards int `json:"initializing_shards"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardlease.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardlease.go index b5164a195..73272ed81 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardlease.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardlease.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ShardLease type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/stats/types.ts#L133-L138 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/stats/types.ts#L133-L138 type ShardLease struct { Id string `json:"id"` RetainingSeqNo int64 `json:"retaining_seq_no"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardmigrationstatus.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardmigrationstatus.go index 087f82fd8..69f74ef15 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardmigrationstatus.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardmigrationstatus.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,7 +26,7 @@ import ( // ShardMigrationStatus type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/shutdown/get_node/ShutdownGetNodeResponse.ts#L52-L54 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/shutdown/get_node/ShutdownGetNodeResponse.ts#L52-L54 type ShardMigrationStatus struct { Status shutdownstatus.ShutdownStatus `json:"status"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardpath.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardpath.go index 6f0f1c49b..05cf8d157 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardpath.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardpath.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ShardPath type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/stats/types.ts#L140-L144 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/stats/types.ts#L140-L144 type ShardPath struct { DataPath string `json:"data_path"` IsCustomDataPath bool `json:"is_custom_data_path"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardprofile.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardprofile.go index 95246c940..7694d28b6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardprofile.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardprofile.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ShardProfile type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/profile.ts#L132-L137 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/profile.ts#L132-L137 type ShardProfile struct { Aggregations []AggregationProfile `json:"aggregations"` Fetch *FetchProfile `json:"fetch,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardquerycache.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardquerycache.go index f8166e97c..0d52bc92a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardquerycache.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardquerycache.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ShardQueryCache type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/stats/types.ts#L146-L154 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/stats/types.ts#L146-L154 type ShardQueryCache struct { CacheCount int64 `json:"cache_count"` CacheSize int64 `json:"cache_size"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardrecovery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardrecovery.go index 372cfa14b..b7efd89d5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardrecovery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardrecovery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ShardRecovery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/recovery/types.ts#L118-L135 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/recovery/types.ts#L118-L135 type ShardRecovery struct { Id int64 `json:"id"` Index RecoveryIndexStatus `json:"index"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardretentionleases.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardretentionleases.go index 62d4eb605..42b2a06a4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardretentionleases.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardretentionleases.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ShardRetentionLeases type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/stats/types.ts#L156-L160 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/stats/types.ts#L156-L160 type ShardRetentionLeases struct { Leases []ShardLease `json:"leases"` PrimaryTerm int64 `json:"primary_term"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardrouting.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardrouting.go index 094554608..e2e3cfc88 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardrouting.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardrouting.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // ShardRouting type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/stats/types.ts#L162-L167 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/stats/types.ts#L162-L167 type ShardRouting struct { Node string `json:"node"` Primary bool `json:"primary"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardsavailabilityindicator.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardsavailabilityindicator.go index eeac1e49e..778558809 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardsavailabilityindicator.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardsavailabilityindicator.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // ShardsAvailabilityIndicator type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/health_report/types.ts#L104-L108 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/health_report/types.ts#L104-L108 type ShardsAvailabilityIndicator struct { Details *ShardsAvailabilityIndicatorDetails `json:"details,omitempty"` Diagnosis []Diagnosis `json:"diagnosis,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardsavailabilityindicatordetails.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardsavailabilityindicatordetails.go index e0e7d79c0..6634a601d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardsavailabilityindicatordetails.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardsavailabilityindicatordetails.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ShardsAvailabilityIndicatorDetails type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/health_report/types.ts#L109-L119 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/health_report/types.ts#L109-L119 type ShardsAvailabilityIndicatorDetails struct { CreatingPrimaries int64 `json:"creating_primaries"` InitializingPrimaries int64 `json:"initializing_primaries"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardscapacityindicator.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardscapacityindicator.go index 4f52d9ec1..7ae8c3fac 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardscapacityindicator.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardscapacityindicator.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // ShardsCapacityIndicator type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/health_report/types.ts#L171-L175 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/health_report/types.ts#L171-L175 type ShardsCapacityIndicator struct { Details *ShardsCapacityIndicatorDetails `json:"details,omitempty"` Diagnosis []Diagnosis `json:"diagnosis,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardscapacityindicatordetails.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardscapacityindicatordetails.go index 0d7150fba..6daa0bb46 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardscapacityindicatordetails.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardscapacityindicatordetails.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // ShardsCapacityIndicatorDetails type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/health_report/types.ts#L177-L180 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/health_report/types.ts#L177-L180 type ShardsCapacityIndicatorDetails struct { Data ShardsCapacityIndicatorTierDetail `json:"data"` Frozen ShardsCapacityIndicatorTierDetail `json:"frozen"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardscapacityindicatortierdetail.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardscapacityindicatortierdetail.go index 899bd69f1..222b39dba 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardscapacityindicatortierdetail.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardscapacityindicatortierdetail.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ShardsCapacityIndicatorTierDetail type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/health_report/types.ts#L182-L185 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/health_report/types.ts#L182-L185 type ShardsCapacityIndicatorTierDetail struct { CurrentUsedShards *int `json:"current_used_shards,omitempty"` MaxShardsInCluster int `json:"max_shards_in_cluster"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardsegmentrouting.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardsegmentrouting.go index 7e0d0d60b..408aaa563 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardsegmentrouting.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardsegmentrouting.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ShardSegmentRouting type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/segments/types.ts#L40-L44 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/segments/types.ts#L40-L44 type ShardSegmentRouting struct { Node string `json:"node"` Primary bool `json:"primary"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardsequencenumber.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardsequencenumber.go index 52b53ab53..f40b022bd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardsequencenumber.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardsequencenumber.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ShardSequenceNumber type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/stats/types.ts#L176-L180 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/stats/types.ts#L176-L180 type ShardSequenceNumber struct { GlobalCheckpoint int64 `json:"global_checkpoint"` LocalCheckpoint int64 `json:"local_checkpoint"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardsrecord.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardsrecord.go index d81b1fbf1..1c7dc6be7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardsrecord.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardsrecord.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ShardsRecord type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/shards/types.ts#L20-L421 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/shards/types.ts#L20-L421 type ShardsRecord struct { // BulkAvgSizeInBytes The average size in bytes of shard bulk operations. BulkAvgSizeInBytes *string `json:"bulk.avg_size_in_bytes,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardssegment.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardssegment.go index 143c4bedb..365357300 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardssegment.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardssegment.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ShardsSegment type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/segments/types.ts#L46-L51 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/segments/types.ts#L46-L51 type ShardsSegment struct { NumCommittedSegments int `json:"num_committed_segments"` NumSearchSegments int `json:"num_search_segments"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardsstatssummary.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardsstatssummary.go index 65b9608cb..69832fdb7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardsstatssummary.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardsstatssummary.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // ShardsStatsSummary type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/_types/SnapshotShardsStatus.ts#L29-L35 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/_types/SnapshotShardsStatus.ts#L29-L35 type ShardsStatsSummary struct { Incremental ShardsStatsSummaryItem `json:"incremental"` StartTimeInMillis int64 `json:"start_time_in_millis"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardsstatssummaryitem.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardsstatssummaryitem.go index cb239d12e..1629a70e1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardsstatssummaryitem.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardsstatssummaryitem.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ShardsStatsSummaryItem type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/_types/SnapshotShardsStatus.ts#L37-L40 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/_types/SnapshotShardsStatus.ts#L37-L40 type ShardsStatsSummaryItem struct { FileCount int64 `json:"file_count"` SizeInBytes int64 `json:"size_in_bytes"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardstatistics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardstatistics.go index c2591a2f7..dd4ce5845 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardstatistics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardstatistics.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // ShardStatistics type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Stats.ts#L54-L66 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Stats.ts#L54-L66 type ShardStatistics struct { Failed uint `json:"failed"` Failures []ShardFailure `json:"failures,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardstore.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardstore.go index b7fe7cca0..c62c35862 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardstore.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardstore.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // ShardStore type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/shard_stores/types.ts#L30-L34 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/shard_stores/types.ts#L30-L34 type ShardStore struct { Allocation shardstoreallocation.ShardStoreAllocation `json:"allocation"` AllocationId *string `json:"allocation_id,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardstoreexception.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardstoreexception.go index 32ce996d2..b87586e8b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardstoreexception.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardstoreexception.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ShardStoreException type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/shard_stores/types.ts#L51-L54 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/shard_stores/types.ts#L51-L54 type ShardStoreException struct { Reason string `json:"reason"` Type string `json:"type"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardstoreindex.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardstoreindex.go index b46b7641a..46a75c208 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardstoreindex.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardstoreindex.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // ShardStoreIndex type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search_shards/SearchShardsResponse.ts#L33-L36 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search_shards/SearchShardsResponse.ts#L33-L36 type ShardStoreIndex struct { Aliases []string `json:"aliases,omitempty"` Filter *Query `json:"filter,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardstorenode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardstorenode.go index add7ed26e..6dbfdfc44 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardstorenode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardstorenode.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ShardStoreNode type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/shard_stores/types.ts#L36-L43 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/shard_stores/types.ts#L36-L43 type ShardStoreNode struct { Attributes map[string]string `json:"attributes"` EphemeralId *string `json:"ephemeral_id,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardstorewrapper.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardstorewrapper.go index faecd6826..cb159d76a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardstorewrapper.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardstorewrapper.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // ShardStoreWrapper type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/shard_stores/types.ts#L56-L58 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/shard_stores/types.ts#L56-L58 type ShardStoreWrapper struct { Stores []ShardStore `json:"stores"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardstotalstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardstotalstats.go index 35b37982c..68a72b97b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardstotalstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shardstotalstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ShardsTotalStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/stats/types.ts#L182-L184 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/stats/types.ts#L182-L184 type ShardsTotalStats struct { TotalCount int64 `json:"total_count"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shared.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shared.go index aebb7b807..0f2667d76 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shared.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shared.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Shared type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/searchable_snapshots/cache_stats/Response.ts#L34-L43 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/searchable_snapshots/cache_stats/Response.ts#L34-L43 type Shared struct { BytesReadInBytes ByteSize `json:"bytes_read_in_bytes"` BytesWrittenInBytes ByteSize `json:"bytes_written_in_bytes"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shingletokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shingletokenfilter.go index 7478747a7..e72c95120 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shingletokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shingletokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ShingleTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L87-L95 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L87-L95 type ShingleTokenFilter struct { FillerToken *string `json:"filler_token,omitempty"` MaxShingleSize string `json:"max_shingle_size,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shortnumberproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shortnumberproperty.go index c7d562f76..08e54c6d4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shortnumberproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shortnumberproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -34,7 +34,7 @@ import ( // ShortNumberProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/core.ts#L159-L162 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/core.ts#L159-L162 type ShortNumberProperty struct { Boost *Float64 `json:"boost,omitempty"` Coerce *bool `json:"coerce,omitempty"` @@ -819,9 +819,40 @@ func (s *ShortNumberProperty) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } case "similarity": var tmp json.RawMessage diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shrinkconfiguration.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shrinkconfiguration.go index d249e2d3e..d7a7d0671 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shrinkconfiguration.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/shrinkconfiguration.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ShrinkConfiguration type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ilm/_types/Phase.ts#L60-L62 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ilm/_types/Phase.ts#L60-L62 type ShrinkConfiguration struct { NumberOfShards int `json:"number_of_shards"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significantlongtermsaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significantlongtermsaggregate.go index 65addbeea..3c23727cc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significantlongtermsaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significantlongtermsaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SignificantLongTermsAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L588-L590 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L588-L590 type SignificantLongTermsAggregate struct { BgCount *int64 `json:"bg_count,omitempty"` Buckets BucketsSignificantLongTermsBucket `json:"buckets"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significantlongtermsbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significantlongtermsbucket.go index c158cde1f..b79e8c747 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significantlongtermsbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significantlongtermsbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // SignificantLongTermsBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L597-L600 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L597-L600 type SignificantLongTermsBucket struct { Aggregations map[string]Aggregate `json:"-"` BgCount int64 `json:"bg_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significantstringtermsaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significantstringtermsaggregate.go index c0f4835e9..de17ca5b0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significantstringtermsaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significantstringtermsaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SignificantStringTermsAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L602-L604 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L602-L604 type SignificantStringTermsAggregate struct { BgCount *int64 `json:"bg_count,omitempty"` Buckets BucketsSignificantStringTermsBucket `json:"buckets"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significantstringtermsbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significantstringtermsbucket.go index 7380a9678..66b37fd23 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significantstringtermsbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significantstringtermsbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // SignificantStringTermsBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L606-L608 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L606-L608 type SignificantStringTermsBucket struct { Aggregations map[string]Aggregate `json:"-"` BgCount int64 `json:"bg_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significanttermsaggregatebasesignificantlongtermsbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significanttermsaggregatebasesignificantlongtermsbucket.go index ef229b8d8..b1498a12d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significanttermsaggregatebasesignificantlongtermsbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significanttermsaggregatebasesignificantlongtermsbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SignificantTermsAggregateBaseSignificantLongTermsBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L581-L586 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L581-L586 type SignificantTermsAggregateBaseSignificantLongTermsBucket struct { BgCount *int64 `json:"bg_count,omitempty"` Buckets BucketsSignificantLongTermsBucket `json:"buckets"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significanttermsaggregatebasesignificantstringtermsbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significanttermsaggregatebasesignificantstringtermsbucket.go index ba561ed0c..aea9fbc02 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significanttermsaggregatebasesignificantstringtermsbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significanttermsaggregatebasesignificantstringtermsbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SignificantTermsAggregateBaseSignificantStringTermsBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L581-L586 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L581-L586 type SignificantTermsAggregateBaseSignificantStringTermsBucket struct { BgCount *int64 `json:"bg_count,omitempty"` Buckets BucketsSignificantStringTermsBucket `json:"buckets"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significanttermsaggregatebasevoid.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significanttermsaggregatebasevoid.go index 75454ae05..a08b576f7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significanttermsaggregatebasevoid.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significanttermsaggregatebasevoid.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SignificantTermsAggregateBaseVoid type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L581-L586 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L581-L586 type SignificantTermsAggregateBaseVoid struct { BgCount *int64 `json:"bg_count,omitempty"` Buckets BucketsVoid `json:"buckets"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significanttermsaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significanttermsaggregation.go index 32defb7e3..5a64bae2e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significanttermsaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significanttermsaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // SignificantTermsAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L770-L834 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L770-L834 type SignificantTermsAggregation struct { // BackgroundFilter A background filter that can be used to focus in on significant terms within // a narrower context, instead of the entire index. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significanttextaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significanttextaggregation.go index cd0797529..96ff83f84 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significanttextaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/significanttextaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // SignificantTextAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L836-L908 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L836-L908 type SignificantTextAggregation struct { // BackgroundFilter A background filter that can be used to focus in on significant terms within // a narrower context, instead of the entire index. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/simpleanalyzer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/simpleanalyzer.go index aad790fad..a00af4612 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/simpleanalyzer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/simpleanalyzer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // SimpleAnalyzer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/analyzers.ts#L83-L86 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/analyzers.ts#L83-L86 type SimpleAnalyzer struct { Type string `json:"type,omitempty"` Version *string `json:"version,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/simplemovingaverageaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/simplemovingaverageaggregation.go index 775f99f6b..ea6eaaa25 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/simplemovingaverageaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/simplemovingaverageaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // SimpleMovingAverageAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L247-L250 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L247-L250 type SimpleMovingAverageAggregation struct { // BucketsPath Path to the buckets that contain one set of values to correlate. BucketsPath BucketsPath `json:"buckets_path,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/simplequerystringflags.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/simplequerystringflags.go index 3383ec7c5..11e716c04 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/simplequerystringflags.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/simplequerystringflags.go @@ -16,11 +16,11 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // SimpleQueryStringFlags type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/fulltext.ts#L702-L706 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/fulltext.ts#L702-L706 type SimpleQueryStringFlags PipeSeparatedFlagsSimpleQueryStringFlag diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/simplequerystringquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/simplequerystringquery.go index 8c04391dd..999898851 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/simplequerystringquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/simplequerystringquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // SimpleQueryStringQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/fulltext.ts#L765-L830 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/fulltext.ts#L765-L830 type SimpleQueryStringQuery struct { // AnalyzeWildcard If `true`, the query attempts to analyze wildcard terms in the query string. AnalyzeWildcard *bool `json:"analyze_wildcard,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/simplevalueaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/simplevalueaggregate.go index 0c21836c7..93a747b10 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/simplevalueaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/simplevalueaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SimpleValueAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L224-L225 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L224-L225 type SimpleValueAggregate struct { Meta Metadata `json:"meta,omitempty"` // Value The metric value. A missing value generally means that there was no data to diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/simulatedactions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/simulatedactions.go index 7b3ad4c4e..6b7e1037c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/simulatedactions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/simulatedactions.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SimulatedActions type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Action.ts#L96-L100 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Action.ts#L96-L100 type SimulatedActions struct { Actions []string `json:"actions"` All *SimulatedActions `json:"all,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/simulateingest.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/simulateingest.go index a40b469da..ad01b5fcd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/simulateingest.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/simulateingest.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // SimulateIngest type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/simulate/types.ts#L28-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/simulate/types.ts#L28-L31 type SimulateIngest struct { Pipeline *string `json:"pipeline,omitempty"` Timestamp DateTime `json:"timestamp"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sizefield.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sizefield.go index 8747972c6..0e6d5aab6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sizefield.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sizefield.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SizeField type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/meta-fields.ts#L54-L56 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/meta-fields.ts#L54-L56 type SizeField struct { Enabled bool `json:"enabled"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slackaction.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slackaction.go index 5c94262b0..df88fa5a1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slackaction.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slackaction.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SlackAction type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Actions.ts#L91-L94 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Actions.ts#L91-L94 type SlackAction struct { Account *string `json:"account,omitempty"` Message SlackMessage `json:"message"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slackattachment.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slackattachment.go index 3f451c692..5548f6b35 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slackattachment.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slackattachment.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SlackAttachment type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Actions.ts#L101-L117 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Actions.ts#L101-L117 type SlackAttachment struct { AuthorIcon *string `json:"author_icon,omitempty"` AuthorLink *string `json:"author_link,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slackattachmentfield.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slackattachmentfield.go index 0cd1d2f5b..f35235113 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slackattachmentfield.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slackattachmentfield.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SlackAttachmentField type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Actions.ts#L119-L123 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Actions.ts#L119-L123 type SlackAttachmentField struct { Int bool `json:"short"` Title string `json:"title"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slackdynamicattachment.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slackdynamicattachment.go index 4754b5fd1..b6a42ff69 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slackdynamicattachment.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slackdynamicattachment.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SlackDynamicAttachment type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Actions.ts#L125-L128 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Actions.ts#L125-L128 type SlackDynamicAttachment struct { AttachmentTemplate SlackAttachment `json:"attachment_template"` ListPath string `json:"list_path"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slackmessage.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slackmessage.go index ed11c57fb..2cad5cd78 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slackmessage.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slackmessage.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SlackMessage type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Actions.ts#L130-L137 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Actions.ts#L130-L137 type SlackMessage struct { Attachments []SlackAttachment `json:"attachments"` DynamicAttachments *SlackDynamicAttachment `json:"dynamic_attachments,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slackresult.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slackresult.go index 6fda82cc6..a23f3c708 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slackresult.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slackresult.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SlackResult type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Actions.ts#L96-L99 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Actions.ts#L96-L99 type SlackResult struct { Account *string `json:"account,omitempty"` Message SlackMessage `json:"message"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slicedscroll.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slicedscroll.go index 94b910a70..ad1042110 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slicedscroll.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slicedscroll.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SlicedScroll type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/SlicedScroll.ts#L23-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/SlicedScroll.ts#L23-L27 type SlicedScroll struct { Field *string `json:"field,omitempty"` Id string `json:"id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slices.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slices.go index bc3f23112..24a85428a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slices.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slices.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // int // slicescalculation.SlicesCalculation // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L361-L366 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L372-L377 type Slices interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slm.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slm.go index b44f6b964..cb301c768 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slm.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slm.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Slm type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L449-L452 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L449-L452 type Slm struct { Available bool `json:"available"` Enabled bool `json:"enabled"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slmindicator.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slmindicator.go index 795aa6c24..67d23bb61 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slmindicator.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slmindicator.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // SlmIndicator type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/health_report/types.ts#L155-L159 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/health_report/types.ts#L155-L159 type SlmIndicator struct { Details *SlmIndicatorDetails `json:"details,omitempty"` Diagnosis []Diagnosis `json:"diagnosis,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slmindicatordetails.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slmindicatordetails.go index 8d19a0ece..2761a43b1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slmindicatordetails.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slmindicatordetails.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // SlmIndicatorDetails type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/health_report/types.ts#L160-L164 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/health_report/types.ts#L160-L164 type SlmIndicatorDetails struct { Policies int64 `json:"policies"` SlmStatus lifecycleoperationmode.LifecycleOperationMode `json:"slm_status"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slmindicatorunhealthypolicies.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slmindicatorunhealthypolicies.go index d53420092..73313f1f0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slmindicatorunhealthypolicies.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slmindicatorunhealthypolicies.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SlmIndicatorUnhealthyPolicies type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/health_report/types.ts#L166-L169 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/health_report/types.ts#L166-L169 type SlmIndicatorUnhealthyPolicies struct { Count int64 `json:"count"` InvocationsSinceLastSuccess map[string]int64 `json:"invocations_since_last_success,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slmpolicy.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slmpolicy.go index 6bf45349a..cf27dcee7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slmpolicy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slmpolicy.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SLMPolicy type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/slm/_types/SnapshotLifecycle.ts#L76-L82 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/slm/_types/SnapshotLifecycle.ts#L76-L82 type SLMPolicy struct { Config *Configuration `json:"config,omitempty"` Name string `json:"name"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slowlogsettings.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slowlogsettings.go index 3531004f5..c49ca790e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slowlogsettings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slowlogsettings.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SlowlogSettings type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L472-L477 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L472-L477 type SlowlogSettings struct { Level *string `json:"level,omitempty"` Reformat *bool `json:"reformat,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slowlogtresholdlevels.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slowlogtresholdlevels.go index ab6d1c15f..df513fb36 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slowlogtresholdlevels.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slowlogtresholdlevels.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // SlowlogTresholdLevels type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L484-L489 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L484-L489 type SlowlogTresholdLevels struct { Debug Duration `json:"debug,omitempty"` Info Duration `json:"info,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slowlogtresholds.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slowlogtresholds.go index b5a156f1d..06124169a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slowlogtresholds.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/slowlogtresholds.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // SlowlogTresholds type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L479-L482 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L479-L482 type SlowlogTresholds struct { Fetch *SlowlogTresholdLevels `json:"fetch,omitempty"` Query *SlowlogTresholdLevels `json:"query,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/smoothingmodelcontainer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/smoothingmodelcontainer.go index 72dac7c4d..070eeed2a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/smoothingmodelcontainer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/smoothingmodelcontainer.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // SmoothingModelContainer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/suggester.ts#L442-L458 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/suggester.ts#L442-L458 type SmoothingModelContainer struct { // Laplace A smoothing model that uses an additive smoothing where a constant (typically // `1.0` or smaller) is added to all counts to balance weights. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotindexstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotindexstats.go index 302cfcfb1..62c4e0f8e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotindexstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotindexstats.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // SnapshotIndexStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/_types/SnapshotIndexStats.ts#L25-L29 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/_types/SnapshotIndexStats.ts#L25-L29 type SnapshotIndexStats struct { Shards map[string]SnapshotShardsStatus `json:"shards"` ShardsStats SnapshotShardsStats `json:"shards_stats"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotinfo.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotinfo.go index b871af1f0..4d58a0043 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotinfo.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotinfo.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SnapshotInfo type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/_types/SnapshotInfo.ts#L41-L71 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/_types/SnapshotInfo.ts#L41-L71 type SnapshotInfo struct { DataStreams []string `json:"data_streams"` Duration Duration `json:"duration,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotlifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotlifecycle.go index d2a17dab4..cb2690f3b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotlifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotlifecycle.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // SnapshotLifecycle type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/slm/_types/SnapshotLifecycle.ts#L38-L49 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/slm/_types/SnapshotLifecycle.ts#L38-L49 type SnapshotLifecycle struct { InProgress *InProgress `json:"in_progress,omitempty"` LastFailure *Invocation `json:"last_failure,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotresponseitem.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotresponseitem.go index 9588c5967..52549751c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotresponseitem.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotresponseitem.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // SnapshotResponseItem type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/get/SnapshotGetResponse.ts#L44-L48 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/get/SnapshotGetResponse.ts#L44-L48 type SnapshotResponseItem struct { Error *ErrorCause `json:"error,omitempty"` Repository string `json:"repository"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotrestore.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotrestore.go index 17e32a3cc..335d051af 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotrestore.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotrestore.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SnapshotRestore type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/restore/SnapshotRestoreResponse.ts#L27-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/restore/SnapshotRestoreResponse.ts#L27-L31 type SnapshotRestore struct { Indices []string `json:"indices"` Shards ShardStatistics `json:"shards"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotshardfailure.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotshardfailure.go index 3cc106f02..ea19e34d4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotshardfailure.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotshardfailure.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SnapshotShardFailure type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/_types/SnapshotShardFailure.ts#L22-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/_types/SnapshotShardFailure.ts#L22-L28 type SnapshotShardFailure struct { Index string `json:"index"` NodeId *string `json:"node_id,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotshardsstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotshardsstats.go index 5c6e5f17f..3a9f70108 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotshardsstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotshardsstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SnapshotShardsStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/_types/SnapshotShardsStats.ts#L22-L29 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/_types/SnapshotShardsStats.ts#L22-L29 type SnapshotShardsStats struct { Done int64 `json:"done"` Failed int64 `json:"failed"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotshardsstatus.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotshardsstatus.go index 54db1c8b1..ceaff68fb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotshardsstatus.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotshardsstatus.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,7 +26,7 @@ import ( // SnapshotShardsStatus type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/_types/SnapshotShardsStatus.ts#L24-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/_types/SnapshotShardsStatus.ts#L24-L27 type SnapshotShardsStatus struct { Stage shardsstatsstage.ShardsStatsStage `json:"stage"` Stats ShardsStatsSummary `json:"stats"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotsrecord.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotsrecord.go index be16db8ad..951886ecf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotsrecord.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotsrecord.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SnapshotsRecord type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/snapshots/types.ts#L24-L96 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/snapshots/types.ts#L24-L96 type SnapshotsRecord struct { // Duration The time it took the snapshot process to complete, in time units. Duration Duration `json:"duration,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotstats.go index 668253c90..21794fceb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snapshotstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // SnapshotStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/_types/SnapshotStats.ts#L23-L29 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/_types/SnapshotStats.ts#L23-L29 type SnapshotStats struct { Incremental FileCountSnapshotStats `json:"incremental"` StartTimeInMillis int64 `json:"start_time_in_millis"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snowballanalyzer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snowballanalyzer.go index 9ebaafb83..31ba595e9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snowballanalyzer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snowballanalyzer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // SnowballAnalyzer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/analyzers.ts#L88-L93 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/analyzers.ts#L88-L93 type SnowballAnalyzer struct { Language snowballlanguage.SnowballLanguage `json:"language"` Stopwords []string `json:"stopwords,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snowballtokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snowballtokenfilter.go index a4abc4aa4..12732b6fd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snowballtokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/snowballtokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // SnowballTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L309-L312 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L309-L312 type SnowballTokenFilter struct { Language snowballlanguage.SnowballLanguage `json:"language"` Type string `json:"type,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/softdeletes.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/softdeletes.go index ec2ebf722..019674911 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/softdeletes.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/softdeletes.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SoftDeletes type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L50-L63 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L50-L63 type SoftDeletes struct { // Enabled Indicates whether soft deletes are enabled on the index. Enabled *bool `json:"enabled,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sort.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sort.go index 21a3d6346..4ee7300e1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sort.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sort.go @@ -16,11 +16,11 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // Sort type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/sort.ts#L99-L99 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/sort.ts#L99-L99 type Sort []SortCombinations diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sortcombinations.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sortcombinations.go index 7cdf9b438..792cbf869 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sortcombinations.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sortcombinations.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // string // SortOptions // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/sort.ts#L93-L97 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/sort.ts#L93-L97 type SortCombinations interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sortoptions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sortoptions.go index 0a8cb151e..ded7d2476 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sortoptions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sortoptions.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -27,7 +27,7 @@ import ( // SortOptions type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/sort.ts#L82-L91 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/sort.ts#L82-L91 type SortOptions struct { Doc_ *ScoreSort `json:"_doc,omitempty"` GeoDistance_ *GeoDistanceSort `json:"_geo_distance,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sortprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sortprocessor.go index 14c389a44..59dfc45c9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sortprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sortprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // SortProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L1034-L1050 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L1034-L1050 type SortProcessor struct { // Description Description of the processor. // Useful for describing the purpose of the processor or its configuration. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sourceconfig.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sourceconfig.go index 2baa49db1..0fa7ad3a7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sourceconfig.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sourceconfig.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // bool // SourceFilter // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/SourceFilter.ts#L33-L37 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/SourceFilter.ts#L33-L37 type SourceConfig interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sourceconfigparam.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sourceconfigparam.go index e72bdc919..85c56312c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sourceconfigparam.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sourceconfigparam.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // bool // []string // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/SourceFilter.ts#L39-L45 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/SourceFilter.ts#L39-L45 type SourceConfigParam interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sourcefield.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sourcefield.go index 1e4079fd5..d796e3e0c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sourcefield.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sourcefield.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // SourceField type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/meta-fields.ts#L58-L65 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/meta-fields.ts#L58-L65 type SourceField struct { Compress *bool `json:"compress,omitempty"` CompressThreshold *string `json:"compress_threshold,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sourcefilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sourcefilter.go index c5c61eacf..914ff18ea 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sourcefilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sourcefilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // SourceFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/SourceFilter.ts#L23-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/SourceFilter.ts#L23-L31 type SourceFilter struct { Excludes []string `json:"excludes,omitempty"` Includes []string `json:"includes,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spancontainingquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spancontainingquery.go index 8ef39cc3a..24e536a7c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spancontainingquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spancontainingquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SpanContainingQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/span.ts#L25-L36 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/span.ts#L25-L36 type SpanContainingQuery struct { // Big Can be any span query. // Matching spans from `big` that contain matches from `little` are returned. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spanfieldmaskingquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spanfieldmaskingquery.go index a65d2b535..5e86a7c5e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spanfieldmaskingquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spanfieldmaskingquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SpanFieldMaskingQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/span.ts#L38-L41 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/span.ts#L38-L41 type SpanFieldMaskingQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spanfirstquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spanfirstquery.go index e5cb3a75e..38cc805a7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spanfirstquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spanfirstquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SpanFirstQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/span.ts#L43-L52 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/span.ts#L43-L52 type SpanFirstQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spangapquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spangapquery.go index fbcf24f8b..e26f23fc5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spangapquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spangapquery.go @@ -16,11 +16,11 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // SpanGapQuery type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/span.ts#L54-L56 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/span.ts#L54-L56 type SpanGapQuery map[string]int diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spanmultitermquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spanmultitermquery.go index f93469a80..fcc64fdf8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spanmultitermquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spanmultitermquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SpanMultiTermQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/span.ts#L58-L63 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/span.ts#L58-L63 type SpanMultiTermQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spannearquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spannearquery.go index e334f5844..f021a7ae3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spannearquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spannearquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SpanNearQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/span.ts#L65-L78 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/span.ts#L65-L78 type SpanNearQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spannotquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spannotquery.go index cd464604a..988c3fd80 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spannotquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spannotquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SpanNotQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/span.ts#L80-L104 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/span.ts#L80-L104 type SpanNotQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spanorquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spanorquery.go index 9340fbfde..b464f665d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spanorquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spanorquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SpanOrQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/span.ts#L106-L111 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/span.ts#L106-L111 type SpanOrQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spanquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spanquery.go index a4964ac8f..c5da146b9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spanquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spanquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // SpanQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/span.ts#L131-L170 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/span.ts#L131-L170 type SpanQuery struct { // FieldMaskingSpan Allows queries like `span_near` or `span_or` across different fields. FieldMaskingSpan *SpanFieldMaskingQuery `json:"field_masking_span,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spantermquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spantermquery.go index 2234afcb4..1a48e7321 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spantermquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spantermquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SpanTermQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/span.ts#L113-L116 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/span.ts#L113-L116 type SpanTermQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spanwithinquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spanwithinquery.go index 38a58d6ad..ad6ff2535 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spanwithinquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/spanwithinquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SpanWithinQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/span.ts#L118-L129 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/span.ts#L118-L129 type SpanWithinQuery struct { // Big Can be any span query. // Matching spans from `little` that are enclosed within `big` are returned. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sparseembeddingresult.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sparseembeddingresult.go new file mode 100644 index 000000000..42e92aae5 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sparseembeddingresult.go @@ -0,0 +1,67 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated from the elasticsearch-specification DO NOT EDIT. +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c + +package types + +import ( + "bytes" + "encoding/json" + "errors" + "io" +) + +// SparseEmbeddingResult type. +// +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/inference/_types/Results.ts#L35-L37 +type SparseEmbeddingResult struct { + Embedding SparseVector `json:"embedding"` +} + +func (s *SparseEmbeddingResult) UnmarshalJSON(data []byte) error { + + dec := json.NewDecoder(bytes.NewReader(data)) + + for { + t, err := dec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "embedding": + if err := dec.Decode(&s.Embedding); err != nil { + return err + } + + } + } + return nil +} + +// NewSparseEmbeddingResult returns a SparseEmbeddingResult. +func NewSparseEmbeddingResult() *SparseEmbeddingResult { + r := &SparseEmbeddingResult{} + + return r +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sparsevector.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sparsevector.go new file mode 100644 index 000000000..07a5eb676 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sparsevector.go @@ -0,0 +1,26 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated from the elasticsearch-specification DO NOT EDIT. +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c + +package types + +// SparseVector type alias. +// +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/inference/_types/Results.ts#L23-L27 +type SparseVector map[string]float32 diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sparsevectorproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sparsevectorproperty.go index 1ad288a47..1976651c2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sparsevectorproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sparsevectorproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // SparseVectorProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/core.ts#L193-L195 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/core.ts#L193-L195 type SparseVectorProperty struct { Dynamic *dynamicmapping.DynamicMapping `json:"dynamic,omitempty"` Fields map[string]Property `json:"fields,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/splitprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/splitprocessor.go index 175b51c1f..a1abe0086 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/splitprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/splitprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SplitProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L1052-L1077 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L1052-L1077 type SplitProcessor struct { // Description Description of the processor. // Useful for describing the purpose of the processor or its configuration. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sql.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sql.go index 45922c88e..a12ee338e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sql.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sql.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Sql type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L386-L389 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L386-L389 type Sql struct { Available bool `json:"available"` Enabled bool `json:"enabled"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ssl.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ssl.go index c5502e1ac..2e5be6629 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ssl.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ssl.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // Ssl type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L391-L394 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L391-L394 type Ssl struct { Http FeatureToggle `json:"http"` Transport FeatureToggle `json:"transport"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/standardanalyzer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/standardanalyzer.go index cbb5a4847..a604488ad 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/standardanalyzer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/standardanalyzer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // StandardAnalyzer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/analyzers.ts#L95-L99 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/analyzers.ts#L95-L99 type StandardAnalyzer struct { MaxTokenLength *int `json:"max_token_length,omitempty"` Stopwords []string `json:"stopwords,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/standarddeviationbounds.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/standarddeviationbounds.go index a84a5de12..7deaef92d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/standarddeviationbounds.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/standarddeviationbounds.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // StandardDeviationBounds type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L260-L267 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L260-L267 type StandardDeviationBounds struct { Lower Float64 `json:"lower,omitempty"` LowerPopulation Float64 `json:"lower_population,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/standarddeviationboundsasstring.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/standarddeviationboundsasstring.go index 594646008..7c2ddaaef 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/standarddeviationboundsasstring.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/standarddeviationboundsasstring.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // StandardDeviationBoundsAsString type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L269-L276 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L269-L276 type StandardDeviationBoundsAsString struct { Lower string `json:"lower"` LowerPopulation string `json:"lower_population"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/standardtokenizer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/standardtokenizer.go index 66befabbc..df6813a11 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/standardtokenizer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/standardtokenizer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // StandardTokenizer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/tokenizers.ts#L105-L108 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/tokenizers.ts#L105-L108 type StandardTokenizer struct { MaxTokenLength *int `json:"max_token_length,omitempty"` Type string `json:"type,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/statistics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/statistics.go index 6ff3b0cfe..79c00492a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/statistics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/statistics.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Statistics type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/slm/_types/SnapshotLifecycle.ts#L51-L74 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/slm/_types/SnapshotLifecycle.ts#L51-L74 type Statistics struct { Policy *string `json:"policy,omitempty"` RetentionDeletionTime Duration `json:"retention_deletion_time,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stats.go index 326af3995..772f206fa 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // Stats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L30-L114 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L30-L114 type Stats struct { // AdaptiveSelection Statistics about adaptive replica selection. AdaptiveSelection map[string]AdaptiveSelection `json:"adaptive_selection,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/statsaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/statsaggregate.go index 703908c5b..a1e3dcc7f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/statsaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/statsaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // StatsAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L240-L255 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L240-L255 type StatsAggregate struct { Avg Float64 `json:"avg,omitempty"` AvgAsString *string `json:"avg_as_string,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/statsaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/statsaggregation.go index 3aa48b8f1..e91436a3f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/statsaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/statsaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // StatsAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L282-L282 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L282-L282 type StatsAggregation struct { // Field The field on which to run the aggregation. Field *string `json:"field,omitempty"` @@ -79,9 +79,40 @@ func (s *StatsAggregation) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } } } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/statsbucketaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/statsbucketaggregate.go index c5222d390..4410df239 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/statsbucketaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/statsbucketaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // StatsBucketAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L257-L258 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L257-L258 type StatsBucketAggregate struct { Avg Float64 `json:"avg,omitempty"` AvgAsString *string `json:"avg_as_string,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/statsbucketaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/statsbucketaggregation.go index 9c25cab1e..ee172d009 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/statsbucketaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/statsbucketaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // StatsBucketAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L371-L371 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L371-L371 type StatsBucketAggregation struct { // BucketsPath Path to the buckets that contain one set of values to correlate. BucketsPath BucketsPath `json:"buckets_path,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/status.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/status.go index 8cf90ea9f..2c4e5acf9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/status.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/status.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Status type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/snapshot/_types/SnapshotStatus.ts#L26-L35 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/snapshot/_types/SnapshotStatus.ts#L26-L35 type Status struct { IncludeGlobalState bool `json:"include_global_state"` Indices map[string]SnapshotIndexStats `json:"indices"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stemmeroverridetokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stemmeroverridetokenfilter.go index b4adab9ac..d9fe9a663 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stemmeroverridetokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stemmeroverridetokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // StemmerOverrideTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L314-L318 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L314-L318 type StemmerOverrideTokenFilter struct { Rules []string `json:"rules,omitempty"` RulesPath *string `json:"rules_path,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stemmertokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stemmertokenfilter.go index d853af23e..2fb41f926 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stemmertokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stemmertokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // StemmerTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L320-L324 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L320-L324 type StemmerTokenFilter struct { Language *string `json:"language,omitempty"` Type string `json:"type,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stepkey.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stepkey.go index 1ce6f41f9..1903da598 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stepkey.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stepkey.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // StepKey type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ilm/move_to_step/types.ts#L20-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ilm/move_to_step/types.ts#L20-L24 type StepKey struct { Action string `json:"action"` Name string `json:"name"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stopanalyzer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stopanalyzer.go index 0b345788d..bede4b965 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stopanalyzer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stopanalyzer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // StopAnalyzer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/analyzers.ts#L101-L106 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/analyzers.ts#L101-L106 type StopAnalyzer struct { Stopwords []string `json:"stopwords,omitempty"` StopwordsPath *string `json:"stopwords_path,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stoptokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stoptokenfilter.go index 68e9912f6..8f2c4296c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stoptokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stoptokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // StopTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L97-L103 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L97-L103 type StopTokenFilter struct { IgnoreCase *bool `json:"ignore_case,omitempty"` RemoveTrailing *bool `json:"remove_trailing,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stopwords.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stopwords.go index 11c7a678e..6b45139cc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stopwords.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stopwords.go @@ -16,11 +16,11 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // StopWords type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/StopWords.ts#L20-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/StopWords.ts#L20-L26 type StopWords []string diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/storage.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/storage.go index 63cef20b0..5b9a624bb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/storage.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/storage.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // Storage type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L491-L500 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L491-L500 type Storage struct { // AllowMmap You can restrict the use of the mmapfs and the related hybridfs store type // via the setting node.store.allow_mmap. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/storedscript.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/storedscript.go index 9477b0fe6..5310a6819 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/storedscript.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/storedscript.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // StoredScript type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Scripting.ts#L47-L57 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Scripting.ts#L47-L57 type StoredScript struct { // Lang Specifies the language the script is written in. Lang scriptlanguage.ScriptLanguage `json:"lang"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/storedscriptid.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/storedscriptid.go index 54af21dcf..199dcf4bb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/storedscriptid.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/storedscriptid.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // StoredScriptId type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Scripting.ts#L81-L86 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Scripting.ts#L81-L86 type StoredScriptId struct { // Id The `id` for a stored script. Id string `json:"id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/storestats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/storestats.go index 9c08d832c..e1e11d401 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/storestats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/storestats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // StoreStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Stats.ts#L368-L395 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Stats.ts#L368-L395 type StoreStats struct { // Reserved A prediction of how much larger the shard stores will eventually grow due to // ongoing peer recoveries, restoring snapshots, and similar activities. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringifiedboolean.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringifiedboolean.go index 66693d295..37a926ee5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringifiedboolean.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringifiedboolean.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // bool // string // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_spec_utils/Stringified.ts#L20-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_spec_utils/Stringified.ts#L20-L27 type Stringifiedboolean interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringifiedepochtimeunitmillis.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringifiedepochtimeunitmillis.go index 8a195e26c..063001c58 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringifiedepochtimeunitmillis.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringifiedepochtimeunitmillis.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // int64 // string // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_spec_utils/Stringified.ts#L20-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_spec_utils/Stringified.ts#L20-L27 type StringifiedEpochTimeUnitMillis interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringifiedepochtimeunitseconds.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringifiedepochtimeunitseconds.go index cc007c7b4..460f849cd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringifiedepochtimeunitseconds.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringifiedepochtimeunitseconds.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // int64 // string // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_spec_utils/Stringified.ts#L20-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_spec_utils/Stringified.ts#L20-L27 type StringifiedEpochTimeUnitSeconds interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringifiedinteger.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringifiedinteger.go index a1ff0d721..c35c975cd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringifiedinteger.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringifiedinteger.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // int // string // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_spec_utils/Stringified.ts#L20-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_spec_utils/Stringified.ts#L20-L27 type Stringifiedinteger interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringifiedversionnumber.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringifiedversionnumber.go index a9b8d229c..70c263344 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringifiedversionnumber.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringifiedversionnumber.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // int64 // string // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_spec_utils/Stringified.ts#L20-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_spec_utils/Stringified.ts#L20-L27 type StringifiedVersionNumber interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringraretermsaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringraretermsaggregate.go index cd179c1a0..258e360b4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringraretermsaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringraretermsaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // StringRareTermsAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L443-L447 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L443-L447 type StringRareTermsAggregate struct { Buckets BucketsStringRareTermsBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringraretermsbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringraretermsbucket.go index ca8fe9006..2124d7594 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringraretermsbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringraretermsbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // StringRareTermsBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L449-L451 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L449-L451 type StringRareTermsBucket struct { Aggregations map[string]Aggregate `json:"-"` DocCount int64 `json:"doc_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringstatsaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringstatsaggregate.go index 4a9e9ccb1..7ba23b450 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringstatsaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringstatsaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // StringStatsAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L693-L704 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L693-L704 type StringStatsAggregate struct { AvgLength Float64 `json:"avg_length,omitempty"` AvgLengthAsString *string `json:"avg_length_as_string,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringstatsaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringstatsaggregation.go index 0a9fe9124..698bbffa8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringstatsaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringstatsaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // StringStatsAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L284-L290 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L284-L290 type StringStatsAggregation struct { // Field The field on which to run the aggregation. Field *string `json:"field,omitempty"` @@ -68,9 +68,40 @@ func (s *StringStatsAggregation) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } case "show_distribution": var tmp interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringtermsaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringtermsaggregate.go index 468eb3778..e5f10bbea 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringtermsaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringtermsaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // StringTermsAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L384-L389 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L384-L389 type StringTermsAggregate struct { Buckets BucketsStringTermsBucket `json:"buckets"` DocCountErrorUpperBound *int64 `json:"doc_count_error_upper_bound,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringtermsbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringtermsbucket.go index bca8c47d1..c5870be9f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringtermsbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stringtermsbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // StringTermsBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L395-L397 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L395-L397 type StringTermsBucket struct { Aggregations map[string]Aggregate `json:"-"` DocCount int64 `json:"doc_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stupidbackoffsmoothingmodel.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stupidbackoffsmoothingmodel.go index 5fa9f51e4..64b748ba9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stupidbackoffsmoothingmodel.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/stupidbackoffsmoothingmodel.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // StupidBackoffSmoothingModel type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/suggester.ts#L460-L465 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/suggester.ts#L460-L465 type StupidBackoffSmoothingModel struct { // Discount A constant factor that the lower order n-gram model is discounted by. Discount Float64 `json:"discount"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/suggest.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/suggest.go index e6d0f798c..59de82883 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/suggest.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/suggest.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,5 +26,5 @@ package types // PhraseSuggest // TermSuggest // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/suggester.ts#L34-L40 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/suggester.ts#L34-L40 type Suggest interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/suggestcontext.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/suggestcontext.go index d45dbac8f..821577275 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/suggestcontext.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/suggestcontext.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SuggestContext type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/specialized.ts#L37-L42 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/specialized.ts#L37-L42 type SuggestContext struct { Name string `json:"name"` Path *string `json:"path,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/suggester.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/suggester.go index 9ebe158d0..d5b0c77be 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/suggester.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/suggester.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // Suggester type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/suggester.ts#L101-L104 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/suggester.ts#L101-L104 type Suggester struct { Suggesters map[string]FieldSuggester `json:"-"` // Text Global suggest text, to avoid repetition when the same text is used in diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/suggestfuzziness.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/suggestfuzziness.go index 20d1c9de1..82776a4a9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/suggestfuzziness.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/suggestfuzziness.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SuggestFuzziness type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/suggester.ts#L193-L221 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/suggester.ts#L193-L221 type SuggestFuzziness struct { // Fuzziness The fuzziness factor. Fuzziness Fuzziness `json:"fuzziness,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sumaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sumaggregate.go index 0152b0695..92778e388 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sumaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sumaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SumAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L203-L207 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L203-L207 type SumAggregate struct { Meta Metadata `json:"meta,omitempty"` // Value The metric value. A missing value generally means that there was no data to diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sumaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sumaggregation.go index d97f818a6..585082045 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sumaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sumaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SumAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L292-L292 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L292-L292 type SumAggregation struct { // Field The field on which to run the aggregation. Field *string `json:"field,omitempty"` @@ -79,9 +79,40 @@ func (s *SumAggregation) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } } } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sumbucketaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sumbucketaggregation.go index 0edad0e64..b1a452f6c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sumbucketaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/sumbucketaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // SumBucketAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/pipeline.ts#L373-L373 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/pipeline.ts#L373-L373 type SumBucketAggregation struct { // BucketsPath Path to the buckets that contain one set of values to correlate. BucketsPath BucketsPath `json:"buckets_path,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/summary.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/summary.go index 08c6ceab0..f2792e886 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/summary.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/summary.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,7 +26,7 @@ import ( // Summary type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/enrich/_types/Policy.ts#L23-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/enrich/_types/Policy.ts#L23-L25 type Summary struct { Config map[policytype.PolicyType]EnrichPolicy `json:"config"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/synccontainer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/synccontainer.go index 4a13d2cf5..20a2e1abb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/synccontainer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/synccontainer.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // SyncContainer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/transform/_types/Transform.ts#L169-L175 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/transform/_types/Transform.ts#L169-L175 type SyncContainer struct { // Time Specifies that the transform uses a time field to synchronize the source and // destination indices. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/synonymgraphtokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/synonymgraphtokenfilter.go index b0eb7e556..b750a103e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/synonymgraphtokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/synonymgraphtokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // SynonymGraphTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L110-L119 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L110-L119 type SynonymGraphTokenFilter struct { Expand *bool `json:"expand,omitempty"` Format *synonymformat.SynonymFormat `json:"format,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/synonymrule.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/synonymrule.go index fd944f2a1..8fc9c01b6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/synonymrule.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/synonymrule.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // SynonymRule type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/synonyms/_types/SynonymRule.ts#L26-L35 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/synonyms/_types/SynonymRule.ts#L26-L35 type SynonymRule struct { // Id Synonym Rule identifier Id *string `json:"id,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/synonymruleread.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/synonymruleread.go index 0a3f24d65..e23b647dd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/synonymruleread.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/synonymruleread.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // SynonymRuleRead type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/synonyms/_types/SynonymRule.ts#L38-L47 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/synonyms/_types/SynonymRule.ts#L38-L47 type SynonymRuleRead struct { // Id Synonym Rule identifier Id string `json:"id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/synonymssetitem.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/synonymssetitem.go index 9c70f0f21..213a6e31f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/synonymssetitem.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/synonymssetitem.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // SynonymsSetItem type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/synonyms/get_synonyms_sets/SynonymsSetsGetResponse.ts#L30-L39 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/synonyms/get_synonyms_sets/SynonymsSetsGetResponse.ts#L30-L39 type SynonymsSetItem struct { // Count Number of synonym rules that the synonym set contains Count int `json:"count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/synonymsupdateresult.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/synonymsupdateresult.go index e26fe1ab4..b7677fe90 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/synonymsupdateresult.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/synonymsupdateresult.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,7 +26,7 @@ import ( // SynonymsUpdateResult type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/synonyms/_types/SynonymsUpdateResult.ts#L23-L34 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/synonyms/_types/SynonymsUpdateResult.ts#L23-L34 type SynonymsUpdateResult struct { // ReloadAnalyzersDetails Updating synonyms in a synonym set reloads the associated analyzers. // This is the analyzers reloading result diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/synonymtokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/synonymtokenfilter.go index 936f84ba3..b9d479a5c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/synonymtokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/synonymtokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // SynonymTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L121-L130 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L121-L130 type SynonymTokenFilter struct { Expand *bool `json:"expand,omitempty"` Format *synonymformat.SynonymFormat `json:"format,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/targetmeanencodingpreprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/targetmeanencodingpreprocessor.go index 9f5a640c9..3267793f4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/targetmeanencodingpreprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/targetmeanencodingpreprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TargetMeanEncodingPreprocessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/put_trained_model/types.ts#L49-L54 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/put_trained_model/types.ts#L49-L54 type TargetMeanEncodingPreprocessor struct { DefaultValue Float64 `json:"default_value"` FeatureName string `json:"feature_name"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/taskfailure.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/taskfailure.go index 88e4135df..0092da011 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/taskfailure.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/taskfailure.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TaskFailure type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Errors.ts#L66-L71 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Errors.ts#L66-L71 type TaskFailure struct { NodeId string `json:"node_id"` Reason ErrorCause `json:"reason"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/taskid.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/taskid.go index ce00b19c7..3bc11aee4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/taskid.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/taskid.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // string // int // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L126-L126 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L137-L137 type TaskId interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/taskinfo.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/taskinfo.go index 426b6c5b4..e94d31130 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/taskinfo.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/taskinfo.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TaskInfo type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/tasks/_types/TaskInfo.ts#L32-L47 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/tasks/_types/TaskInfo.ts#L32-L47 type TaskInfo struct { Action string `json:"action"` Cancellable bool `json:"cancellable"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/taskinfos.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/taskinfos.go index 3eb50ae12..fa0562cff 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/taskinfos.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/taskinfos.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // []TaskInfo // map[string]ParentTaskInfo // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/tasks/_types/TaskListResponseBase.ts#L40-L43 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/tasks/_types/TaskListResponseBase.ts#L40-L43 type TaskInfos interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tasksrecord.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tasksrecord.go index 96421ef24..0eeda1111 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tasksrecord.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tasksrecord.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TasksRecord type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/tasks/types.ts#L22-L101 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/tasks/types.ts#L22-L101 type TasksRecord struct { // Action The task action. Action *string `json:"action,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tdigest.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tdigest.go index 69ed46ad7..b5a29d657 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tdigest.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tdigest.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TDigest type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L223-L228 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L223-L228 type TDigest struct { // Compression Limits the maximum number of nodes used by the underlying TDigest algorithm // to `20 * compression`, enabling control of memory usage and approximation diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tdigestpercentileranksaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tdigestpercentileranksaggregate.go index 7bd3a5c21..9cc6efdce 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tdigestpercentileranksaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tdigestpercentileranksaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // TDigestPercentileRanksAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L175-L176 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L175-L176 type TDigestPercentileRanksAggregate struct { Meta Metadata `json:"meta,omitempty"` Values Percentiles `json:"values"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tdigestpercentilesaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tdigestpercentilesaggregate.go index 017f2d785..79a7974c2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tdigestpercentilesaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tdigestpercentilesaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // TDigestPercentilesAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L172-L173 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L172-L173 type TDigestPercentilesAggregate struct { Meta Metadata `json:"meta,omitempty"` Values Percentiles `json:"values"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/template.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/template.go index 6c4581710..092af649b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/template.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // Template type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/simulate_template/IndicesSimulateTemplateResponse.ts#L33-L37 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/simulate_template/IndicesSimulateTemplateResponse.ts#L33-L37 type Template struct { Aliases map[string]Alias `json:"aliases"` Mappings TypeMapping `json:"mappings"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/templateconfig.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/templateconfig.go index 15841f2e9..8505287c3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/templateconfig.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/templateconfig.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TemplateConfig type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/msearch_template/types.ts#L28-L54 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/msearch_template/types.ts#L28-L54 type TemplateConfig struct { // Explain If `true`, returns detailed information about score calculation as part of // each hit. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/templatemapping.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/templatemapping.go index 7395a47aa..1858d8b24 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/templatemapping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/templatemapping.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TemplateMapping type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/TemplateMapping.ts#L27-L34 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/TemplateMapping.ts#L27-L34 type TemplateMapping struct { Aliases map[string]Alias `json:"aliases"` IndexPatterns []string `json:"index_patterns"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/templatesrecord.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/templatesrecord.go index 79e9a2c16..6062dd1ca 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/templatesrecord.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/templatesrecord.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TemplatesRecord type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/templates/types.ts#L22-L48 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/templates/types.ts#L22-L48 type TemplatesRecord struct { // ComposedOf The component templates that comprise the index template. ComposedOf *string `json:"composed_of,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/term.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/term.go index 226c5fa9a..f8aa7112b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/term.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/term.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Term type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/termvectors/types.ts#L34-L40 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/termvectors/types.ts#L34-L40 type Term struct { DocFreq *int `json:"doc_freq,omitempty"` Score *Float64 `json:"score,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termquery.go index 2e59b07f9..e28d8489f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TermQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/term.ts#L217-L231 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/term.ts#L217-L231 type TermQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsaggregatebasedoubletermsbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsaggregatebasedoubletermsbucket.go index 9123ed62d..9ef93ec79 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsaggregatebasedoubletermsbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsaggregatebasedoubletermsbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TermsAggregateBaseDoubleTermsBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L377-L382 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L377-L382 type TermsAggregateBaseDoubleTermsBucket struct { Buckets BucketsDoubleTermsBucket `json:"buckets"` DocCountErrorUpperBound *int64 `json:"doc_count_error_upper_bound,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsaggregatebaselongtermsbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsaggregatebaselongtermsbucket.go index 82c8eebfd..88459eaa2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsaggregatebaselongtermsbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsaggregatebaselongtermsbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TermsAggregateBaseLongTermsBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L377-L382 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L377-L382 type TermsAggregateBaseLongTermsBucket struct { Buckets BucketsLongTermsBucket `json:"buckets"` DocCountErrorUpperBound *int64 `json:"doc_count_error_upper_bound,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsaggregatebasemultitermsbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsaggregatebasemultitermsbucket.go index e26db20d1..6de7dc319 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsaggregatebasemultitermsbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsaggregatebasemultitermsbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TermsAggregateBaseMultiTermsBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L377-L382 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L377-L382 type TermsAggregateBaseMultiTermsBucket struct { Buckets BucketsMultiTermsBucket `json:"buckets"` DocCountErrorUpperBound *int64 `json:"doc_count_error_upper_bound,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsaggregatebasestringtermsbucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsaggregatebasestringtermsbucket.go index c854e75ed..715761ffd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsaggregatebasestringtermsbucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsaggregatebasestringtermsbucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TermsAggregateBaseStringTermsBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L377-L382 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L377-L382 type TermsAggregateBaseStringTermsBucket struct { Buckets BucketsStringTermsBucket `json:"buckets"` DocCountErrorUpperBound *int64 `json:"doc_count_error_upper_bound,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsaggregatebasevoid.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsaggregatebasevoid.go index 1fcf6697e..15ac51dd8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsaggregatebasevoid.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsaggregatebasevoid.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TermsAggregateBaseVoid type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L377-L382 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L377-L382 type TermsAggregateBaseVoid struct { Buckets BucketsVoid `json:"buckets"` DocCountErrorUpperBound *int64 `json:"doc_count_error_upper_bound,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsaggregation.go index 8c34adb95..caababa41 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -35,7 +35,7 @@ import ( // TermsAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L910-L970 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L910-L970 type TermsAggregation struct { // CollectMode Determines how child aggregations should be calculated: breadth-first or // depth-first. @@ -220,9 +220,40 @@ func (s *TermsAggregation) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } case "shard_size": diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsexclude.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsexclude.go index 7d394f39e..c0c94d536 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsexclude.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsexclude.go @@ -16,11 +16,11 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // TermsExclude type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L1001-L1002 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L1001-L1002 type TermsExclude []string diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsgrouping.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsgrouping.go index 4c4e5efd8..dbcf11786 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsgrouping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsgrouping.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // TermsGrouping type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/rollup/_types/Groupings.ts#L75-L82 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/rollup/_types/Groupings.ts#L75-L82 type TermsGrouping struct { // Fields The set of fields that you wish to collect terms for. // This array can contain fields that are both keyword and numerics. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsinclude.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsinclude.go index b2e2f646c..3595e06af 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsinclude.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsinclude.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,5 +26,5 @@ package types // []string // TermsPartition // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L998-L999 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L998-L999 type TermsInclude interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termslookup.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termslookup.go index 506b43328..ae127ce0b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termslookup.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termslookup.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // TermsLookup type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/term.ts#L242-L247 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/term.ts#L242-L247 type TermsLookup struct { Id string `json:"id"` Index string `json:"index"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termspartition.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termspartition.go index dc300ec75..adedeed63 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termspartition.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termspartition.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TermsPartition type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L1004-L1013 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L1004-L1013 type TermsPartition struct { // NumPartitions The number of partitions. NumPartitions int64 `json:"num_partitions"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsquery.go index c1fae49b5..383867c82 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // TermsQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/term.ts#L233-L235 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/term.ts#L233-L235 type TermsQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsqueryfield.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsqueryfield.go index 15bfcc29c..8b03f36cf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsqueryfield.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsqueryfield.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // []FieldValue // TermsLookup // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/term.ts#L237-L240 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/term.ts#L237-L240 type TermsQueryField interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termssetquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termssetquery.go index e7b3735cc..33f007e73 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termssetquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termssetquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TermsSetQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/term.ts#L249-L262 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/term.ts#L249-L262 type TermsSetQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. @@ -86,9 +86,40 @@ func (s *TermsSetQuery) UnmarshalJSON(data []byte) error { } case "minimum_should_match_script": - if err := dec.Decode(&s.MinimumShouldMatchScript); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.MinimumShouldMatchScript = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.MinimumShouldMatchScript = o + + } + } case "_name": var tmp json.RawMessage diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsuggest.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsuggest.go index 217ad2720..4d1aa0148 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsuggest.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsuggest.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TermSuggest type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/suggester.ts#L64-L69 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/suggester.ts#L64-L69 type TermSuggest struct { Length int `json:"length"` Offset int `json:"offset"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsuggester.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsuggester.go index 65eda9f72..832e559e3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsuggester.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsuggester.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -34,7 +34,7 @@ import ( // TermSuggester type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/suggester.ts#L503-L565 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/suggester.ts#L503-L565 type TermSuggester struct { // Analyzer The analyzer to analyze the suggest text with. // Defaults to the search analyzer of the suggest field. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsuggestoption.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsuggestoption.go index c83cc633c..45cb83389 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsuggestoption.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termsuggestoption.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TermSuggestOption type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/suggester.ts#L93-L99 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/suggester.ts#L93-L99 type TermSuggestOption struct { CollateMatch *bool `json:"collate_match,omitempty"` Freq int64 `json:"freq"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termvector.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termvector.go index ba24c0cf8..64474ca16 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termvector.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termvector.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // TermVector type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/termvectors/types.ts#L23-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/termvectors/types.ts#L23-L26 type TermVector struct { FieldStatistics FieldStatistics `json:"field_statistics"` Terms map[string]Term `json:"terms"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termvectorsfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termvectorsfilter.go index c35e7448d..8a4968b21 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termvectorsfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termvectorsfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TermVectorsFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/termvectors/types.ts#L49-L86 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/termvectors/types.ts#L49-L86 type TermVectorsFilter struct { // MaxDocFreq Ignore words which occur in more than this many docs. // Defaults to unbounded. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termvectorsresult.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termvectorsresult.go index d2a18dab1..ba862252f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termvectorsresult.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termvectorsresult.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TermVectorsResult type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/mtermvectors/types.ts#L96-L104 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/mtermvectors/types.ts#L96-L104 type TermVectorsResult struct { Error *ErrorCause `json:"error,omitempty"` Found *bool `json:"found,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termvectorstoken.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termvectorstoken.go index ff25c17df..16da5d6f6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termvectorstoken.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/termvectorstoken.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TermVectorsToken type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/termvectors/types.ts#L42-L47 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/termvectors/types.ts#L42-L47 type TermVectorsToken struct { EndOffset *int `json:"end_offset,omitempty"` Payload *string `json:"payload,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/testpopulation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/testpopulation.go index aa49c0b38..50b92e2f1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/testpopulation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/testpopulation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // TestPopulation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L310-L320 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L310-L320 type TestPopulation struct { // Field The field to aggregate. Field string `json:"field"` @@ -64,9 +64,40 @@ func (s *TestPopulation) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } } } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textclassificationinferenceoptions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textclassificationinferenceoptions.go index a683e871a..5298146ed 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textclassificationinferenceoptions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textclassificationinferenceoptions.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TextClassificationInferenceOptions type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/inference.ts#L189-L199 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/inference.ts#L189-L199 type TextClassificationInferenceOptions struct { // ClassificationLabels Classification labels to apply other than the stored labels. Must have the // same deminsions as the default configured labels diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textclassificationinferenceupdateoptions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textclassificationinferenceupdateoptions.go index ae5edf33f..6e8ad0788 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textclassificationinferenceupdateoptions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textclassificationinferenceupdateoptions.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TextClassificationInferenceUpdateOptions type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/inference.ts#L363-L372 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/inference.ts#L363-L372 type TextClassificationInferenceUpdateOptions struct { // ClassificationLabels Classification labels to apply other than the stored labels. Must have the // same deminsions as the default configured labels diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textembedding.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textembedding.go index 86cb811cb..8e7ff1a7c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textembedding.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textembedding.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TextEmbedding type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Knn.ts#L50-L53 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Knn.ts#L50-L53 type TextEmbedding struct { ModelId string `json:"model_id"` ModelText string `json:"model_text"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textembeddinginferenceoptions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textembeddinginferenceoptions.go index 69511772e..374197b4b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textembeddinginferenceoptions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textembeddinginferenceoptions.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TextEmbeddingInferenceOptions type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/inference.ts#L237-L245 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/inference.ts#L237-L245 type TextEmbeddingInferenceOptions struct { // EmbeddingSize The number of dimensions in the embedding output EmbeddingSize *int `json:"embedding_size,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textembeddinginferenceupdateoptions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textembeddinginferenceupdateoptions.go index fb85a27ea..4b7ca84fb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textembeddinginferenceupdateoptions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textembeddinginferenceupdateoptions.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TextEmbeddingInferenceUpdateOptions type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/inference.ts#L392-L396 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/inference.ts#L392-L396 type TextEmbeddingInferenceUpdateOptions struct { // ResultsField The field that is added to incoming documents to contain the inference // prediction. Defaults to predicted_value. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textembeddingresult.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textembeddingresult.go new file mode 100644 index 000000000..0d3069a7f --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textembeddingresult.go @@ -0,0 +1,67 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated from the elasticsearch-specification DO NOT EDIT. +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c + +package types + +import ( + "bytes" + "encoding/json" + "errors" + "io" +) + +// TextEmbeddingResult type. +// +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/inference/_types/Results.ts#L39-L44 +type TextEmbeddingResult struct { + Embedding []float32 `json:"embedding"` +} + +func (s *TextEmbeddingResult) UnmarshalJSON(data []byte) error { + + dec := json.NewDecoder(bytes.NewReader(data)) + + for { + t, err := dec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "embedding": + if err := dec.Decode(&s.Embedding); err != nil { + return err + } + + } + } + return nil +} + +// NewTextEmbeddingResult returns a TextEmbeddingResult. +func NewTextEmbeddingResult() *TextEmbeddingResult { + r := &TextEmbeddingResult{} + + return r +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textexpansioninferenceoptions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textexpansioninferenceoptions.go index 34c6bcf8c..bbde8507f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textexpansioninferenceoptions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textexpansioninferenceoptions.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TextExpansionInferenceOptions type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/inference.ts#L247-L253 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/inference.ts#L247-L253 type TextExpansionInferenceOptions struct { // ResultsField The field that is added to incoming documents to contain the inference // prediction. Defaults to predicted_value. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textexpansioninferenceupdateoptions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textexpansioninferenceupdateoptions.go index 4327ecc81..b892ead5b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textexpansioninferenceupdateoptions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textexpansioninferenceupdateoptions.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TextExpansionInferenceUpdateOptions type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/inference.ts#L398-L402 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/inference.ts#L398-L402 type TextExpansionInferenceUpdateOptions struct { // ResultsField The field that is added to incoming documents to contain the inference // prediction. Defaults to predicted_value. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textexpansionquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textexpansionquery.go index 3fd42a212..809e6ecc7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textexpansionquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textexpansionquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TextExpansionQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/TextExpansionQuery.ts#L22-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/TextExpansionQuery.ts#L22-L27 type TextExpansionQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textindexprefixes.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textindexprefixes.go index 219e3f51f..bfccaa95c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textindexprefixes.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textindexprefixes.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TextIndexPrefixes type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/core.ts#L249-L252 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/core.ts#L249-L252 type TextIndexPrefixes struct { MaxChars int `json:"max_chars"` MinChars int `json:"min_chars"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textproperty.go index 3f73ff07d..ce75decb0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/textproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -34,7 +34,7 @@ import ( // TextProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/core.ts#L254-L270 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/core.ts#L254-L270 type TextProperty struct { Analyzer *string `json:"analyzer,omitempty"` Boost *Float64 `json:"boost,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/texttoanalyze.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/texttoanalyze.go index 6ba0b39c2..1a2244796 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/texttoanalyze.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/texttoanalyze.go @@ -16,11 +16,11 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // TextToAnalyze type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/analyze/types.ts#L66-L66 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/analyze/types.ts#L66-L66 type TextToAnalyze []string diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/threadcount.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/threadcount.go index ff0561cba..b4cca83c1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/threadcount.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/threadcount.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ThreadCount type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L1004-L1029 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L1004-L1029 type ThreadCount struct { // Active Number of active threads in the thread pool. Active *int64 `json:"active,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/threadpoolrecord.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/threadpoolrecord.go index d5337258e..87a4aa672 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/threadpoolrecord.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/threadpoolrecord.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ThreadPoolRecord type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/thread_pool/types.ts#L22-L124 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/thread_pool/types.ts#L22-L124 type ThreadPoolRecord struct { // Active The number of active threads in the current thread pool. Active *string `json:"active,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/throttlestate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/throttlestate.go index cb9614643..c4d7cf700 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/throttlestate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/throttlestate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ThrottleState type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Action.ts#L126-L129 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Action.ts#L126-L129 type ThrottleState struct { Reason string `json:"reason"` Timestamp DateTime `json:"timestamp"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/timeofmonth.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/timeofmonth.go index 0d25af1d9..4ed9058db 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/timeofmonth.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/timeofmonth.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // TimeOfMonth type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Schedule.ts#L115-L118 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Schedule.ts#L115-L118 type TimeOfMonth struct { At []string `json:"at"` On []int `json:"on"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/timeofweek.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/timeofweek.go index 0830c82cb..716a2714d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/timeofweek.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/timeofweek.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,7 +26,7 @@ import ( // TimeOfWeek type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Schedule.ts#L120-L123 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Schedule.ts#L120-L123 type TimeOfWeek struct { At []string `json:"at"` On []day.Day `json:"on"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/timeofyear.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/timeofyear.go index e540ddf8d..accb45320 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/timeofyear.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/timeofyear.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,7 +26,7 @@ import ( // TimeOfYear type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Schedule.ts#L125-L129 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Schedule.ts#L125-L129 type TimeOfYear struct { At []string `json:"at"` Int []month.Month `json:"int"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/timesync.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/timesync.go index 7033f2638..dcf6f46b8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/timesync.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/timesync.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // TimeSync type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/transform/_types/Transform.ts#L177-L189 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/transform/_types/Transform.ts#L177-L189 type TimeSync struct { // Delay The time delay between the current time and the latest input data time. Delay Duration `json:"delay,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/timingstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/timingstats.go index 8c0302c83..b931eec31 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/timingstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/timingstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // TimingStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeAnalytics.ts#L563-L568 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeAnalytics.ts#L563-L568 type TimingStats struct { // ElapsedTime Runtime of the analysis in milliseconds. ElapsedTime int64 `json:"elapsed_time"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tokencountproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tokencountproperty.go index d54b1308b..8038c93d1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tokencountproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tokencountproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // TokenCountProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/specialized.ts#L79-L86 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/specialized.ts#L79-L86 type TokenCountProperty struct { Analyzer *string `json:"analyzer,omitempty"` Boost *Float64 `json:"boost,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tokendetail.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tokendetail.go index bf861c68f..a8c9d1f6f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tokendetail.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tokendetail.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TokenDetail type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/analyze/types.ts#L68-L71 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/analyze/types.ts#L68-L71 type TokenDetail struct { Name string `json:"name"` Tokens []ExplainAnalyzeToken `json:"tokens"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tokenfilter.go index a7e7f7e75..4db5b30dc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // string // TokenFilterDefinition // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L344-L346 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L344-L346 type TokenFilter interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tokenfilterdefinition.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tokenfilterdefinition.go index b4f3a81cf..9c7921ee6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tokenfilterdefinition.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tokenfilterdefinition.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -71,5 +71,5 @@ package types // PhoneticTokenFilter // DictionaryDecompounderTokenFilter // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L348-L401 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L348-L401 type TokenFilterDefinition interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tokenizationconfigcontainer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tokenizationconfigcontainer.go index 3456a4beb..277ec8290 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tokenizationconfigcontainer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tokenizationconfigcontainer.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // TokenizationConfigContainer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/inference.ts#L110-L129 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/inference.ts#L110-L129 type TokenizationConfigContainer struct { // Bert Indicates BERT tokenization and its options Bert *NlpBertTokenizationConfig `json:"bert,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tokenizer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tokenizer.go index c19c87cdf..678c9b0a6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tokenizer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tokenizer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // string // TokenizerDefinition // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/tokenizers.ts#L120-L122 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/tokenizers.ts#L120-L122 type Tokenizer interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tokenizerdefinition.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tokenizerdefinition.go index f6a881086..715530996 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tokenizerdefinition.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tokenizerdefinition.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -37,5 +37,5 @@ package types // PatternTokenizer // IcuTokenizer // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/tokenizers.ts#L124-L142 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/tokenizers.ts#L124-L142 type TokenizerDefinition interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/topclassentry.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/topclassentry.go index 4ac828104..a55adcc3b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/topclassentry.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/topclassentry.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TopClassEntry type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/inference.ts#L440-L444 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/inference.ts#L440-L444 type TopClassEntry struct { ClassName string `json:"class_name"` ClassProbability Float64 `json:"class_probability"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tophit.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tophit.go index a9ebc01eb..94fe4321f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tophit.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tophit.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TopHit type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/text_structure/find_structure/types.ts#L35-L38 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/text_structure/find_structure/types.ts#L35-L38 type TopHit struct { Count int64 `json:"count"` Value json.RawMessage `json:"value,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tophitsaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tophitsaggregate.go index 43df28b14..e80d9c3d9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tophitsaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tophitsaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // TopHitsAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L654-L657 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L654-L657 type TopHitsAggregate struct { Hits HitsMetadata `json:"hits"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tophitsaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tophitsaggregation.go index a74a4838b..3bef55f06 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tophitsaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/tophitsaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TopHitsAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L337-L392 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L337-L392 type TopHitsAggregation struct { // DocvalueFields Fields for which to return doc values. DocvalueFields []string `json:"docvalue_fields,omitempty"` @@ -147,9 +147,40 @@ func (s *TopHitsAggregation) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } case "script_fields": if s.ScriptFields == nil { diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/topleftbottomrightgeobounds.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/topleftbottomrightgeobounds.go index c533eab5f..ede9a6bc6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/topleftbottomrightgeobounds.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/topleftbottomrightgeobounds.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // TopLeftBottomRightGeoBounds type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Geo.ts#L170-L173 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Geo.ts#L170-L173 type TopLeftBottomRightGeoBounds struct { BottomRight GeoLocation `json:"bottom_right"` TopLeft GeoLocation `json:"top_left"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/topmetrics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/topmetrics.go index 1950fed68..1120657d6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/topmetrics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/topmetrics.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // TopMetrics type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L729-L733 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L729-L733 type TopMetrics struct { Metrics map[string]FieldValue `json:"metrics"` Sort []FieldValue `json:"sort"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/topmetricsaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/topmetricsaggregate.go index 186581a03..fc9571546 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/topmetricsaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/topmetricsaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // TopMetricsAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L724-L727 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L724-L727 type TopMetricsAggregate struct { Meta Metadata `json:"meta,omitempty"` Top []TopMetrics `json:"top"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/topmetricsaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/topmetricsaggregation.go index 8dd8f3bb3..e6879179b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/topmetricsaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/topmetricsaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TopMetricsAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L394-L408 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L394-L408 type TopMetricsAggregation struct { // Field The field on which to run the aggregation. Field *string `json:"field,omitempty"` @@ -88,9 +88,40 @@ func (s *TopMetricsAggregation) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } case "size": diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/topmetricsvalue.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/topmetricsvalue.go index 367428b17..5e009653b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/topmetricsvalue.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/topmetricsvalue.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // TopMetricsValue type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L410-L415 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L410-L415 type TopMetricsValue struct { // Field A field to return as a metric. Field string `json:"field"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/toprightbottomleftgeobounds.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/toprightbottomleftgeobounds.go index 189f4bb93..e498d9fd7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/toprightbottomleftgeobounds.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/toprightbottomleftgeobounds.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // TopRightBottomLeftGeoBounds type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Geo.ts#L175-L178 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Geo.ts#L175-L178 type TopRightBottomLeftGeoBounds struct { BottomLeft GeoLocation `json:"bottom_left"` TopRight GeoLocation `json:"top_right"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/totalfeatureimportance.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/totalfeatureimportance.go index ccbcaf901..193829672 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/totalfeatureimportance.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/totalfeatureimportance.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // TotalFeatureImportance type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/TrainedModel.ts#L232-L239 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/TrainedModel.ts#L232-L239 type TotalFeatureImportance struct { // Classes If the trained model is a classification model, feature importance statistics // are gathered per target class value. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/totalfeatureimportanceclass.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/totalfeatureimportanceclass.go index c993a7132..088b2c41d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/totalfeatureimportanceclass.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/totalfeatureimportanceclass.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // TotalFeatureImportanceClass type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/TrainedModel.ts#L241-L246 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/TrainedModel.ts#L241-L246 type TotalFeatureImportanceClass struct { // ClassName The target class value. Could be a string, boolean, or number. ClassName string `json:"class_name"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/totalfeatureimportancestatistics.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/totalfeatureimportancestatistics.go index afaf04f97..2e859761a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/totalfeatureimportancestatistics.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/totalfeatureimportancestatistics.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TotalFeatureImportanceStatistics type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/TrainedModel.ts#L248-L255 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/TrainedModel.ts#L248-L255 type TotalFeatureImportanceStatistics struct { // Max The maximum importance value across all the training data for this feature. Max int `json:"max"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/totaluserprofiles.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/totaluserprofiles.go index be5a66a4d..86dd230d8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/totaluserprofiles.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/totaluserprofiles.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TotalUserProfiles type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/suggest_user_profiles/Response.ts#L24-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/suggest_user_profiles/Response.ts#L24-L27 type TotalUserProfiles struct { Relation string `json:"relation"` Value int64 `json:"value"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trackhits.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trackhits.go index 3f5c34bb1..e80f547de 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trackhits.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trackhits.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // bool // int // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/search/_types/hits.ts#L142-L150 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/search/_types/hits.ts#L142-L150 type TrackHits interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodel.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodel.go index 3e1affa41..08d1f30a0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodel.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodel.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // TrainedModel type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/put_trained_model/types.ts#L60-L72 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/put_trained_model/types.ts#L60-L72 type TrainedModel struct { // Ensemble The definition for an ensemble model Ensemble *Ensemble `json:"ensemble,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelassignment.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelassignment.go index 5e3334550..64ec67acc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelassignment.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelassignment.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // TrainedModelAssignment type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/TrainedModel.ts#L402-L417 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/TrainedModel.ts#L402-L417 type TrainedModelAssignment struct { // AssignmentState The overall assignment state. AssignmentState deploymentassignmentstate.DeploymentAssignmentState `json:"assignment_state"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelassignmentroutingtable.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelassignmentroutingtable.go index 03dca9245..aa7bba280 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelassignmentroutingtable.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelassignmentroutingtable.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // TrainedModelAssignmentRoutingTable type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/TrainedModel.ts#L373-L391 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/TrainedModel.ts#L373-L391 type TrainedModelAssignmentRoutingTable struct { // CurrentAllocations Current number of allocations. CurrentAllocations int `json:"current_allocations"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelassignmenttaskparameters.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelassignmenttaskparameters.go index 19506b957..4b8f4678a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelassignmenttaskparameters.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelassignmenttaskparameters.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // TrainedModelAssignmentTaskParameters type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/TrainedModel.ts#L315-L348 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/TrainedModel.ts#L315-L348 type TrainedModelAssignmentTaskParameters struct { // CacheSize The size of the trained model cache. CacheSize ByteSize `json:"cache_size"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelconfig.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelconfig.go index c4401e8ff..cbedf774b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelconfig.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelconfig.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // TrainedModelConfig type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/TrainedModel.ts#L165-L199 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/TrainedModel.ts#L165-L199 type TrainedModelConfig struct { CompressedDefinition *string `json:"compressed_definition,omitempty"` // CreateTime The time when the trained model was created. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelconfiginput.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelconfiginput.go index 3e48e47b5..9c6d3ced7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelconfiginput.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelconfiginput.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // TrainedModelConfigInput type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/TrainedModel.ts#L201-L204 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/TrainedModel.ts#L201-L204 type TrainedModelConfigInput struct { // FieldNames An array of input field names for the model. FieldNames []string `json:"field_names"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelconfigmetadata.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelconfigmetadata.go index 4dc3d5758..a3a709776 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelconfigmetadata.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelconfigmetadata.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // TrainedModelConfigMetadata type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/TrainedModel.ts#L206-L214 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/TrainedModel.ts#L206-L214 type TrainedModelConfigMetadata struct { // FeatureImportanceBaseline An object that contains the baseline for feature importance values. For // regression analysis, it is a single value. For classification analysis, there diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodeldeploymentallocationstatus.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodeldeploymentallocationstatus.go index 67aa23652..95c332f00 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodeldeploymentallocationstatus.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodeldeploymentallocationstatus.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // TrainedModelDeploymentAllocationStatus type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/TrainedModel.ts#L393-L400 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/TrainedModel.ts#L393-L400 type TrainedModelDeploymentAllocationStatus struct { // AllocationCount The current number of nodes where the model is allocated. AllocationCount int `json:"allocation_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodeldeploymentnodesstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodeldeploymentnodesstats.go index 8aabc5e1e..72a1abea5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodeldeploymentnodesstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodeldeploymentnodesstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TrainedModelDeploymentNodesStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/TrainedModel.ts#L133-L163 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/TrainedModel.ts#L133-L163 type TrainedModelDeploymentNodesStats struct { // AverageInferenceTimeMs The average time for each inference call to complete on this node. AverageInferenceTimeMs Float64 `json:"average_inference_time_ms"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodeldeploymentstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodeldeploymentstats.go index 67283950c..d4023b5d7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodeldeploymentstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodeldeploymentstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // TrainedModelDeploymentStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/TrainedModel.ts#L62-L102 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/TrainedModel.ts#L62-L102 type TrainedModelDeploymentStats struct { // AllocationStatus The detailed allocation status for the deployment. AllocationStatus TrainedModelDeploymentAllocationStatus `json:"allocation_status"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelentities.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelentities.go index 8551a4c9e..1465053ca 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelentities.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelentities.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TrainedModelEntities type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/inference.ts#L433-L439 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/inference.ts#L433-L439 type TrainedModelEntities struct { ClassName string `json:"class_name"` ClassProbability Float64 `json:"class_probability"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelinferenceclassimportance.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelinferenceclassimportance.go index 43a7af878..59fe90ea0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelinferenceclassimportance.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelinferenceclassimportance.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TrainedModelInferenceClassImportance type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/inference.ts#L446-L449 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/inference.ts#L446-L449 type TrainedModelInferenceClassImportance struct { ClassName string `json:"class_name"` Importance Float64 `json:"importance"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelinferencefeatureimportance.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelinferencefeatureimportance.go index a4cc782c3..09cfb3509 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelinferencefeatureimportance.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelinferencefeatureimportance.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TrainedModelInferenceFeatureImportance type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/inference.ts#L451-L455 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/inference.ts#L451-L455 type TrainedModelInferenceFeatureImportance struct { Classes []TrainedModelInferenceClassImportance `json:"classes,omitempty"` FeatureName string `json:"feature_name"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelinferencestats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelinferencestats.go index 99c018704..d156102e6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelinferencestats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelinferencestats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TrainedModelInferenceStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/TrainedModel.ts#L104-L124 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/TrainedModel.ts#L104-L124 type TrainedModelInferenceStats struct { // CacheMissCount The number of times the model was loaded for inference and was not retrieved // from the cache. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodellocation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodellocation.go index db613e5d6..fa9eaa343 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodellocation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodellocation.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // TrainedModelLocation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/TrainedModel.ts#L419-L421 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/TrainedModel.ts#L419-L421 type TrainedModelLocation struct { Index TrainedModelLocationIndex `json:"index"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodellocationindex.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodellocationindex.go index e861e9dd6..394035986 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodellocationindex.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodellocationindex.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // TrainedModelLocationIndex type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/TrainedModel.ts#L423-L425 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/TrainedModel.ts#L423-L425 type TrainedModelLocationIndex struct { Name string `json:"name"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelsizestats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelsizestats.go index b2c436b06..971a6651a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelsizestats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelsizestats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TrainedModelSizeStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/TrainedModel.ts#L126-L131 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/TrainedModel.ts#L126-L131 type TrainedModelSizeStats struct { // ModelSizeBytes The size of the model in bytes. ModelSizeBytes ByteSize `json:"model_size_bytes"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelsrecord.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelsrecord.go index 1f32abece..232e4b5e4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelsrecord.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelsrecord.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TrainedModelsRecord type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/ml_trained_models/types.ts#L23-L115 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/ml_trained_models/types.ts#L23-L115 type TrainedModelsRecord struct { // CreateTime The time the model was created. CreateTime DateTime `json:"create_time,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelstats.go index d5668d9b1..a8f7882d2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodelstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TrainedModelStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/TrainedModel.ts#L42-L60 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/TrainedModel.ts#L42-L60 type TrainedModelStats struct { // DeploymentStats A collection of deployment stats, which is present when the models are // deployed. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodeltree.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodeltree.go index c939863e8..6463b3215 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodeltree.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodeltree.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TrainedModelTree type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/put_trained_model/types.ts#L74-L79 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/put_trained_model/types.ts#L74-L79 type TrainedModelTree struct { ClassificationLabels []string `json:"classification_labels,omitempty"` FeatureNames []string `json:"feature_names"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodeltreenode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodeltreenode.go index 12247cf45..2a22dbb1e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodeltreenode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trainedmodeltreenode.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TrainedModelTreeNode type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/put_trained_model/types.ts#L81-L91 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/put_trained_model/types.ts#L81-L91 type TrainedModelTreeNode struct { DecisionType *string `json:"decision_type,omitempty"` DefaultLeft *bool `json:"default_left,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformauthorization.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformauthorization.go index 426e135cc..2f9fa20ba 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformauthorization.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformauthorization.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TransformAuthorization type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/Authorization.ts#L59-L71 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/Authorization.ts#L59-L71 type TransformAuthorization struct { // ApiKey If an API key was used for the most recent update to the transform, its name // and identifier are listed in the response. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformcontainer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformcontainer.go index cebe3904a..2be65db89 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformcontainer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformcontainer.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // TransformContainer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Transform.ts#L27-L34 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Transform.ts#L27-L34 type TransformContainer struct { Chain []TransformContainer `json:"chain,omitempty"` Script *ScriptTransform `json:"script,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformdestination.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformdestination.go index 43eff5bd4..260b117ff 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformdestination.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformdestination.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TransformDestination type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/transform/_types/Transform.ts#L34-L45 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/transform/_types/Transform.ts#L34-L45 type TransformDestination struct { // Index The destination index for the transform. The mappings of the destination // index are deduced based on the source diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformindexerstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformindexerstats.go index 69fb579b3..f851df6c9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformindexerstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformindexerstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TransformIndexerStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/transform/get_transform_stats/types.ts#L56-L74 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/transform/get_transform_stats/types.ts#L56-L74 type TransformIndexerStats struct { DeleteTimeInMs *int64 `json:"delete_time_in_ms,omitempty"` DocumentsDeleted *int64 `json:"documents_deleted,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformprogress.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformprogress.go index c1f22e966..119754910 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformprogress.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformprogress.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TransformProgress type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/transform/get_transform_stats/types.ts#L48-L54 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/transform/get_transform_stats/types.ts#L48-L54 type TransformProgress struct { DocsIndexed int64 `json:"docs_indexed"` DocsProcessed int64 `json:"docs_processed"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformsource.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformsource.go index 4dcca9e1a..9ac30d812 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformsource.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformsource.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // TransformSource type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/transform/_types/Transform.ts#L146-L165 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/transform/_types/Transform.ts#L146-L165 type TransformSource struct { // Index The source indices for the transform. It can be a single index, an index // pattern (for example, `"my-index-*""`), an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformsrecord.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformsrecord.go index 3a6a4e8e3..2a8d9f146 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformsrecord.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformsrecord.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TransformsRecord type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cat/transforms/types.ts#L22-L197 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cat/transforms/types.ts#L22-L197 type TransformsRecord struct { // ChangesLastDetectionTime The timestamp when changes were last detected in the source indices. ChangesLastDetectionTime string `json:"changes_last_detection_time,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformstats.go index cf725464e..90eedc6b0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TransformStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/transform/get_transform_stats/types.ts#L31-L42 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/transform/get_transform_stats/types.ts#L31-L42 type TransformStats struct { Checkpointing Checkpointing `json:"checkpointing"` Health *TransformStatsHealth `json:"health,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformstatshealth.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformstatshealth.go index ac5502b23..5d650faea 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformstatshealth.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformstatshealth.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,7 +26,7 @@ import ( // TransformStatsHealth type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/transform/get_transform_stats/types.ts#L44-L46 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/transform/get_transform_stats/types.ts#L44-L46 type TransformStatsHealth struct { Status healthstatus.HealthStatus `json:"status"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformsummary.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformsummary.go index 4c87469cc..d6530aeed 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformsummary.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transformsummary.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TransformSummary type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/transform/get_transform/types.ts#L33-L61 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/transform/get_transform/types.ts#L33-L61 type TransformSummary struct { // Authorization The security privileges that the transform uses to run its queries. If // Elastic Stack security features were disabled at the time of the most recent diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transientmetadataconfig.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transientmetadataconfig.go index 238bdc9ee..1e2e8f82b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transientmetadataconfig.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transientmetadataconfig.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TransientMetadataConfig type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/_types/TransientMetadataConfig.ts#L20-L22 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/_types/TransientMetadataConfig.ts#L20-L22 type TransientMetadataConfig struct { Enabled bool `json:"enabled"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/translog.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/translog.go index aa56c212c..1927ea124 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/translog.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/translog.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // Translog type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L332-L354 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L332-L354 type Translog struct { // Durability Whether or not to `fsync` and commit the translog after every index, delete, // update, or bulk request. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/translogretention.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/translogretention.go index 3d38f6744..6787f3891 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/translogretention.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/translogretention.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // TranslogRetention type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/_types/IndexSettings.ts#L373-L392 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/_types/IndexSettings.ts#L373-L392 type TranslogRetention struct { // Age This controls the maximum duration for which translog files are kept by each // shard. Keeping more diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/translogstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/translogstats.go index dbcd23279..36819b94a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/translogstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/translogstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TranslogStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Stats.ts#L397-L405 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Stats.ts#L397-L405 type TranslogStats struct { EarliestLastModifiedAge int64 `json:"earliest_last_modified_age"` Operations int64 `json:"operations"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/translogstatus.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/translogstatus.go index 05c5b2efc..b7c175ffb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/translogstatus.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/translogstatus.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TranslogStatus type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/recovery/types.ts#L102-L109 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/recovery/types.ts#L102-L109 type TranslogStatus struct { Percent Percentage `json:"percent"` Recovered int64 `json:"recovered"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transport.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transport.go index 904b0fcbd..0d913013a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transport.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transport.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Transport type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L1047-L1090 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L1047-L1090 type Transport struct { // InboundHandlingTimeHistogram The distribution of the time spent handling each inbound message on a // transport thread, represented as a histogram. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transporthistogram.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transporthistogram.go index 9218c42bd..4331e56d1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transporthistogram.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/transporthistogram.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TransportHistogram type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/nodes/_types/Stats.ts#L1092-L1106 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/nodes/_types/Stats.ts#L1092-L1106 type TransportHistogram struct { // Count The number of times a transport thread took a period of time within the // bounds of this bucket to handle an inbound message. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/triggercontainer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/triggercontainer.go index 3ad8881c5..96c88e52d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/triggercontainer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/triggercontainer.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // TriggerContainer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Trigger.ts#L23-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Trigger.ts#L23-L28 type TriggerContainer struct { Schedule *ScheduleContainer `json:"schedule,omitempty"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/triggereventcontainer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/triggereventcontainer.go index 31fab6e13..cd2a7c8b1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/triggereventcontainer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/triggereventcontainer.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // TriggerEventContainer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Trigger.ts#L32-L37 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Trigger.ts#L32-L37 type TriggerEventContainer struct { Schedule *ScheduleTriggerEvent `json:"schedule,omitempty"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/triggereventresult.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/triggereventresult.go index 921b74e11..af83e63d4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/triggereventresult.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/triggereventresult.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TriggerEventResult type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Trigger.ts#L39-L43 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Trigger.ts#L39-L43 type TriggerEventResult struct { Manual TriggerEventContainer `json:"manual"` TriggeredTime DateTime `json:"triggered_time"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trimprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trimprocessor.go index af2fa6939..5342eeaba 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trimprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trimprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TrimProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L1079-L1095 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L1079-L1095 type TrimProcessor struct { // Description Description of the processor. // Useful for describing the purpose of the processor or its configuration. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trimtokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trimtokenfilter.go index 04cb6e1c9..c5cef9a0d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trimtokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/trimtokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // TrimTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L326-L328 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L326-L328 type TrimTokenFilter struct { Type string `json:"type,omitempty"` Version *string `json:"version,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/truncatetokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/truncatetokenfilter.go index 37ed83d88..8d53cd15b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/truncatetokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/truncatetokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TruncateTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L330-L333 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L330-L333 type TruncateTokenFilter struct { Length *int `json:"length,omitempty"` Type string `json:"type,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ttestaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ttestaggregate.go index 3b8ca1e05..e4a597c67 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ttestaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ttestaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TTestAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L735-L739 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L735-L739 type TTestAggregate struct { Meta Metadata `json:"meta,omitempty"` Value Float64 `json:"value,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ttestaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ttestaggregation.go index 49aa7de75..a601cf58d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ttestaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/ttestaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // TTestAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L294-L308 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L294-L308 type TTestAggregation struct { // A Test population A. A *TestPopulation `json:"a,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/typefieldmappings.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/typefieldmappings.go index 3d5f90159..fbd732de7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/typefieldmappings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/typefieldmappings.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // TypeFieldMappings type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/get_field_mapping/types.ts#L24-L26 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/get_field_mapping/types.ts#L24-L26 type TypeFieldMappings struct { Mappings map[string]FieldMapping `json:"mappings"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/typemapping.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/typemapping.go index c21e3fa2b..c141f7f63 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/typemapping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/typemapping.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // TypeMapping type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/TypeMapping.ts#L34-L56 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/TypeMapping.ts#L34-L56 type TypeMapping struct { AllField *AllField `json:"all_field,omitempty"` DataStreamTimestamp_ *DataStreamTimestamp `json:"_data_stream_timestamp,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/typequery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/typequery.go index 0cda84094..0c0781e87 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/typequery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/typequery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // TypeQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/term.ts#L264-L266 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/term.ts#L264-L266 type TypeQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/uaxemailurltokenizer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/uaxemailurltokenizer.go index a44eea520..3776d0cf6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/uaxemailurltokenizer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/uaxemailurltokenizer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // UaxEmailUrlTokenizer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/tokenizers.ts#L110-L113 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/tokenizers.ts#L110-L113 type UaxEmailUrlTokenizer struct { MaxTokenLength *int `json:"max_token_length,omitempty"` Type string `json:"type,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/unassignedinformation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/unassignedinformation.go index 8658732de..d93dd1470 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/unassignedinformation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/unassignedinformation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // UnassignedInformation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/cluster/allocation_explain/types.ts#L117-L125 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/cluster/allocation_explain/types.ts#L117-L125 type UnassignedInformation struct { AllocationStatus *string `json:"allocation_status,omitempty"` At DateTime `json:"at"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/uniquetokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/uniquetokenfilter.go index 28586de16..5baa3c652 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/uniquetokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/uniquetokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // UniqueTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L335-L338 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L335-L338 type UniqueTokenFilter struct { OnlyOnSamePosition *bool `json:"only_on_same_position,omitempty"` Type string `json:"type,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/unmappedraretermsaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/unmappedraretermsaggregate.go index 42dd28ed4..43a79b663 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/unmappedraretermsaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/unmappedraretermsaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // UnmappedRareTermsAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L453-L459 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L453-L459 type UnmappedRareTermsAggregate struct { Buckets BucketsVoid `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/unmappedsampleraggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/unmappedsampleraggregate.go index dee75435c..690c03b68 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/unmappedsampleraggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/unmappedsampleraggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // UnmappedSamplerAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L501-L502 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L501-L502 type UnmappedSamplerAggregate struct { Aggregations map[string]Aggregate `json:"-"` DocCount int64 `json:"doc_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/unmappedsignificanttermsaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/unmappedsignificanttermsaggregate.go index 810abf548..0cd9f5764 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/unmappedsignificanttermsaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/unmappedsignificanttermsaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // UnmappedSignificantTermsAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L610-L616 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L610-L616 type UnmappedSignificantTermsAggregate struct { BgCount *int64 `json:"bg_count,omitempty"` Buckets BucketsVoid `json:"buckets"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/unmappedtermsaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/unmappedtermsaggregate.go index ba052837f..d7a769df6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/unmappedtermsaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/unmappedtermsaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // UnmappedTermsAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L423-L429 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L423-L429 type UnmappedTermsAggregate struct { Buckets BucketsVoid `json:"buckets"` DocCountErrorUpperBound *int64 `json:"doc_count_error_upper_bound,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/unrateddocument.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/unrateddocument.go index 089fb9c82..263a02e02 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/unrateddocument.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/unrateddocument.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // UnratedDocument type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/rank_eval/types.ts#L147-L150 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/rank_eval/types.ts#L147-L150 type UnratedDocument struct { Id_ string `json:"_id"` Index_ string `json:"_index"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/unsignedlongnumberproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/unsignedlongnumberproperty.go index bf4287d42..2c1b73015 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/unsignedlongnumberproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/unsignedlongnumberproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -34,7 +34,7 @@ import ( // UnsignedLongNumberProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/core.ts#L169-L172 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/core.ts#L169-L172 type UnsignedLongNumberProperty struct { Boost *Float64 `json:"boost,omitempty"` Coerce *bool `json:"coerce,omitempty"` @@ -819,9 +819,40 @@ func (s *UnsignedLongNumberProperty) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } case "similarity": var tmp json.RawMessage diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/updateaction.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/updateaction.go index 0b5ae79a2..13eec470c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/updateaction.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/updateaction.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // UpdateAction type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/bulk/types.ts#L169-L205 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/bulk/types.ts#L169-L205 type UpdateAction struct { // DetectNoop Set to false to disable setting 'result' in the response // to 'noop' if no change to the document occurred. @@ -102,9 +102,40 @@ func (s *UpdateAction) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } case "scripted_upsert": var tmp interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/updatebyqueryrethrottlenode.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/updatebyqueryrethrottlenode.go index 4ed191fc3..1dd787e08 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/updatebyqueryrethrottlenode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/updatebyqueryrethrottlenode.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // UpdateByQueryRethrottleNode type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/update_by_query_rethrottle/UpdateByQueryRethrottleNode.ts#L25-L27 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/update_by_query_rethrottle/UpdateByQueryRethrottleNode.ts#L25-L27 type UpdateByQueryRethrottleNode struct { Attributes map[string]string `json:"attributes"` Host string `json:"host"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/updateoperation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/updateoperation.go index 1c24ec21a..0ef352c55 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/updateoperation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/updateoperation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // UpdateOperation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/bulk/types.ts#L136-L143 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/bulk/types.ts#L136-L143 type UpdateOperation struct { // Id_ The document ID. Id_ *string `json:"_id,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/uppercaseprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/uppercaseprocessor.go index 8edfe561e..48663fe81 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/uppercaseprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/uppercaseprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // UppercaseProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L1097-L1113 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L1097-L1113 type UppercaseProcessor struct { // Description Description of the processor. // Useful for describing the purpose of the processor or its configuration. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/uppercasetokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/uppercasetokenfilter.go index 3de9e98b0..2d59ba13f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/uppercasetokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/uppercasetokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // UppercaseTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L340-L342 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L340-L342 type UppercaseTokenFilter struct { Type string `json:"type,omitempty"` Version *string `json:"version,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/urldecodeprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/urldecodeprocessor.go index 1be153d67..8af81192a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/urldecodeprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/urldecodeprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // UrlDecodeProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L1115-L1131 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L1115-L1131 type UrlDecodeProcessor struct { // Description Description of the processor. // Useful for describing the purpose of the processor or its configuration. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/usagestatsindex.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/usagestatsindex.go index 4f3b87597..0fb6c0e2d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/usagestatsindex.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/usagestatsindex.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // UsageStatsIndex type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/field_usage_stats/IndicesFieldUsageStatsResponse.ts#L38-L40 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/field_usage_stats/IndicesFieldUsageStatsResponse.ts#L38-L40 type UsageStatsIndex struct { Shards []UsageStatsShards `json:"shards"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/usagestatsshards.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/usagestatsshards.go index 78bcc2ea2..48b6b6047 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/usagestatsshards.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/usagestatsshards.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // UsageStatsShards type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/field_usage_stats/IndicesFieldUsageStatsResponse.ts#L42-L47 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/field_usage_stats/IndicesFieldUsageStatsResponse.ts#L42-L47 type UsageStatsShards struct { Routing ShardRouting `json:"routing"` Stats IndicesShardsStats `json:"stats"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/user.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/user.go index f675f4074..4a4a1c686 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/user.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/user.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // User type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/_types/User.ts#L23-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/_types/User.ts#L23-L31 type User struct { Email string `json:"email,omitempty"` Enabled bool `json:"enabled"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/useragentprocessor.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/useragentprocessor.go index bda951c5b..e9b4adaa1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/useragentprocessor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/useragentprocessor.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // UserAgentProcessor type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ingest/_types/Processors.ts#L359-L379 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ingest/_types/Processors.ts#L359-L379 type UserAgentProcessor struct { // Description Description of the processor. // Useful for describing the purpose of the processor or its configuration. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/userindicesprivileges.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/userindicesprivileges.go index b86f2738e..deb54287d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/userindicesprivileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/userindicesprivileges.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // UserIndicesPrivileges type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/_types/Privileges.ts#L107-L129 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/_types/Privileges.ts#L107-L129 type UserIndicesPrivileges struct { // AllowRestrictedIndices Set to `true` if using wildcard or regular expressions for patterns that // cover restricted indices. Implicitly, restricted indices have limited diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/userprofile.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/userprofile.go index 9e490c21b..064689f21 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/userprofile.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/userprofile.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // UserProfile type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/_types/UserProfile.ts#L42-L48 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/_types/UserProfile.ts#L42-L48 type UserProfile struct { Data map[string]json.RawMessage `json:"data"` Enabled *bool `json:"enabled,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/userprofilehitmetadata.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/userprofilehitmetadata.go index 183b4e0d1..ac439c623 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/userprofilehitmetadata.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/userprofilehitmetadata.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // UserProfileHitMetadata type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/_types/UserProfile.ts#L28-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/_types/UserProfile.ts#L28-L31 type UserProfileHitMetadata struct { PrimaryTerm_ int64 `json:"_primary_term"` SeqNo_ int64 `json:"_seq_no"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/userprofileuser.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/userprofileuser.go index 723164dd5..bb243f143 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/userprofileuser.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/userprofileuser.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // UserProfileUser type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/_types/UserProfile.ts#L33-L40 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/_types/UserProfile.ts#L33-L40 type UserProfileUser struct { Email string `json:"email,omitempty"` FullName string `json:"full_name,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/userprofilewithmetadata.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/userprofilewithmetadata.go index a06c39c5f..7a454659e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/userprofilewithmetadata.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/userprofilewithmetadata.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // UserProfileWithMetadata type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/_types/UserProfile.ts#L50-L53 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/_types/UserProfile.ts#L50-L53 type UserProfileWithMetadata struct { Data map[string]json.RawMessage `json:"data"` Doc_ UserProfileHitMetadata `json:"_doc"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/userrealm.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/userrealm.go index dff6142a1..556915e2f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/userrealm.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/userrealm.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // UserRealm type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/security/get_token/types.ts#L30-L33 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/security/get_token/types.ts#L30-L33 type UserRealm struct { Name string `json:"name"` Type string `json:"type"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/validationloss.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/validationloss.go index cd478e440..f9935885c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/validationloss.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/validationloss.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ValidationLoss type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/DataframeAnalytics.ts#L570-L575 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/DataframeAnalytics.ts#L570-L575 type ValidationLoss struct { // FoldValues Validation loss values for every added decision tree during the forest // growing procedure. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/valuecountaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/valuecountaggregate.go index f8cfee130..7abd6289a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/valuecountaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/valuecountaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ValueCountAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L218-L222 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L218-L222 type ValueCountAggregate struct { Meta Metadata `json:"meta,omitempty"` // Value The metric value. A missing value generally means that there was no data to diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/valuecountaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/valuecountaggregation.go index 97b432f0c..1808e9955 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/valuecountaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/valuecountaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ValueCountAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L417-L417 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L417-L417 type ValueCountAggregation struct { // Field The field on which to run the aggregation. Field *string `json:"field,omitempty"` @@ -79,9 +79,40 @@ func (s *ValueCountAggregation) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } } } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/variablewidthhistogramaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/variablewidthhistogramaggregate.go index 3bfef1e28..951bd1ec1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/variablewidthhistogramaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/variablewidthhistogramaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // VariableWidthHistogramAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L362-L364 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L362-L364 type VariableWidthHistogramAggregate struct { Buckets BucketsVariableWidthHistogramBucket `json:"buckets"` Meta Metadata `json:"meta,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/variablewidthhistogramaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/variablewidthhistogramaggregation.go index 40676fa7c..c98c1cff3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/variablewidthhistogramaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/variablewidthhistogramaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // VariableWidthHistogramAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/bucket.ts#L1015-L1035 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/bucket.ts#L1015-L1035 type VariableWidthHistogramAggregation struct { // Buckets The target number of buckets. Buckets *int `json:"buckets,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/variablewidthhistogrambucket.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/variablewidthhistogrambucket.go index 962cea7a5..25817d2c1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/variablewidthhistogrambucket.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/variablewidthhistogrambucket.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // VariableWidthHistogramBucket type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L366-L373 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L366-L373 type VariableWidthHistogramBucket struct { Aggregations map[string]Aggregate `json:"-"` DocCount int64 `json:"doc_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/vector.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/vector.go index 9931e54af..fb237bcb3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/vector.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/vector.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Vector type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L454-L458 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L454-L458 type Vector struct { Available bool `json:"available"` DenseVectorDimsAvgCount int `json:"dense_vector_dims_avg_count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/verifyindex.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/verifyindex.go index d7b183ff6..d72d42f2f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/verifyindex.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/verifyindex.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // VerifyIndex type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/indices/recovery/types.ts#L111-L116 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/indices/recovery/types.ts#L111-L116 type VerifyIndex struct { CheckIndexTime Duration `json:"check_index_time,omitempty"` CheckIndexTimeInMillis int64 `json:"check_index_time_in_millis"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/versionproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/versionproperty.go index 9e7180c07..8a685f254 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/versionproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/versionproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // VersionProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/core.ts#L272-L274 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/core.ts#L272-L274 type VersionProperty struct { CopyTo []string `json:"copy_to,omitempty"` DocValues *bool `json:"doc_values,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/vertex.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/vertex.go index 7749f1a72..8cc41f4e9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/vertex.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/vertex.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Vertex type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/graph/_types/Vertex.ts#L23-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/graph/_types/Vertex.ts#L23-L28 type Vertex struct { Depth int64 `json:"depth"` Field string `json:"field"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/vertexdefinition.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/vertexdefinition.go index 7dc95d1e0..a49fab418 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/vertexdefinition.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/vertexdefinition.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // VertexDefinition type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/graph/_types/Vertex.ts#L30-L59 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/graph/_types/Vertex.ts#L30-L59 type VertexDefinition struct { // Exclude Prevents the specified terms from being included in the results. Exclude []string `json:"exclude,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/vertexinclude.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/vertexinclude.go index 683a8e6ee..7293e7abc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/vertexinclude.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/vertexinclude.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // VertexInclude type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/graph/_types/Vertex.ts#L61-L64 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/graph/_types/Vertex.ts#L61-L64 type VertexInclude struct { Boost Float64 `json:"boost"` Term string `json:"term"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/vocabulary.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/vocabulary.go index c246fd04a..4664f1e8f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/vocabulary.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/vocabulary.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // Vocabulary type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/inference.ts#L233-L235 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/inference.ts#L233-L235 type Vocabulary struct { Index string `json:"index"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/waitforactiveshards.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/waitforactiveshards.go index 213e5c9de..ce793fa2a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/waitforactiveshards.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/waitforactiveshards.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -25,5 +25,5 @@ package types // int // waitforactiveshardoptions.WaitForActiveShardOptions // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/common.ts#L136-L137 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/common.ts#L147-L148 type WaitForActiveShards interface{} diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/warmerstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/warmerstats.go index 0d3174ffa..19bec174e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/warmerstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/warmerstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // WarmerStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Stats.ts#L407-L412 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Stats.ts#L407-L412 type WarmerStats struct { Current int64 `json:"current"` Total int64 `json:"total"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watch.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watch.go index b469f52f1..6796be314 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watch.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // Watch type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Watch.ts#L37-L47 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Watch.ts#L37-L47 type Watch struct { Actions map[string]WatcherAction `json:"actions"` Condition WatcherCondition `json:"condition"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcher.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcher.go index 00da62c78..7d7b5d5d4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcher.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcher.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Watcher type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L460-L464 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L460-L464 type Watcher struct { Available bool `json:"available"` Count Counter `json:"count"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcheraction.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcheraction.go index 85607cec4..6d3c25e84 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcheraction.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcheraction.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // WatcherAction type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Action.ts#L41-L60 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Action.ts#L41-L60 type WatcherAction struct { ActionType *actiontype.ActionType `json:"action_type,omitempty"` Condition *WatcherCondition `json:"condition,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcheractions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcheractions.go index 774822b79..67c2b27c2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcheractions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcheractions.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // WatcherActions type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L396-L398 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L396-L398 type WatcherActions struct { Actions map[string]WatcherActionTotals `json:"actions"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcheractiontotals.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcheractiontotals.go index 945ffc168..680a94f65 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcheractiontotals.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcheractiontotals.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // WatcherActionTotals type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L412-L415 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L412-L415 type WatcherActionTotals struct { Total Duration `json:"total"` TotalTimeInMs int64 `json:"total_time_in_ms"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watchercondition.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watchercondition.go index e163b388a..21ab47084 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watchercondition.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watchercondition.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,7 +26,7 @@ import ( // WatcherCondition type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Conditions.ts#L47-L59 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Conditions.ts#L47-L59 type WatcherCondition struct { Always *AlwaysCondition `json:"always,omitempty"` ArrayCompare map[string]ArrayCompareCondition `json:"array_compare,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcherinput.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcherinput.go index 84642f03e..1c1d7b5ac 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcherinput.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcherinput.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -26,7 +26,7 @@ import ( // WatcherInput type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Input.ts#L90-L98 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Input.ts#L90-L98 type WatcherInput struct { Chain *ChainInput `json:"chain,omitempty"` Http *HttpInput `json:"http,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watchernodestats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watchernodestats.go index 779e05754..ecf6f2283 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watchernodestats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watchernodestats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // WatcherNodeStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/stats/types.ts#L33-L40 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/stats/types.ts#L33-L40 type WatcherNodeStats struct { CurrentWatches []WatchRecordStats `json:"current_watches,omitempty"` ExecutionThreadPool ExecutionThreadPool `json:"execution_thread_pool"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcherstatusactions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcherstatusactions.go index acf571288..d96a97884 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcherstatusactions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcherstatusactions.go @@ -16,11 +16,11 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // WatcherStatusActions type alias. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Action.ts#L62-L62 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Action.ts#L62-L62 type WatcherStatusActions map[string]ActionStatus diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcherwatch.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcherwatch.go index 9f2e2f0cd..322b3a308 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcherwatch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcherwatch.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // WatcherWatch type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L400-L405 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L400-L405 type WatcherWatch struct { Action map[string]Counter `json:"action,omitempty"` Condition map[string]Counter `json:"condition,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcherwatchtrigger.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcherwatchtrigger.go index 8e7e74919..f7f52aa14 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcherwatchtrigger.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcherwatchtrigger.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // WatcherWatchTrigger type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L407-L410 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L407-L410 type WatcherWatchTrigger struct { All_ Counter `json:"_all"` Schedule *WatcherWatchTriggerSchedule `json:"schedule,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcherwatchtriggerschedule.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcherwatchtriggerschedule.go index b9aec48b6..7a5b95f75 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcherwatchtriggerschedule.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watcherwatchtriggerschedule.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // WatcherWatchTriggerSchedule type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L466-L469 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L466-L469 type WatcherWatchTriggerSchedule struct { Active int64 `json:"active"` All_ Counter `json:"_all"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watchrecord.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watchrecord.go index acd20d802..c17136bec 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watchrecord.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watchrecord.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // WatchRecord type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/execute_watch/types.ts#L27-L39 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/execute_watch/types.ts#L27-L39 type WatchRecord struct { Condition WatcherCondition `json:"condition"` Input WatcherInput `json:"input"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watchrecordqueuedstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watchrecordqueuedstats.go index 8b06543de..a171423ca 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watchrecordqueuedstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watchrecordqueuedstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // WatchRecordQueuedStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/stats/types.ts#L50-L52 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/stats/types.ts#L50-L52 type WatchRecordQueuedStats struct { ExecutionTime DateTime `json:"execution_time"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watchrecordstats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watchrecordstats.go index 095061a18..70e8b822b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watchrecordstats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watchrecordstats.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -31,7 +31,7 @@ import ( // WatchRecordStats type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/stats/types.ts#L54-L60 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/stats/types.ts#L54-L60 type WatchRecordStats struct { ExecutedActions []string `json:"executed_actions,omitempty"` ExecutionPhase executionphase.ExecutionPhase `json:"execution_phase"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watchstatus.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watchstatus.go index 98d13ca64..164bb73b4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watchstatus.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/watchstatus.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // WatchStatus type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Watch.ts#L49-L56 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Watch.ts#L49-L56 type WatchStatus struct { Actions WatcherStatusActions `json:"actions"` ExecutionState *string `json:"execution_state,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/webhookaction.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/webhookaction.go index 4b3ff5b4f..3e030307f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/webhookaction.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/webhookaction.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -33,7 +33,7 @@ import ( // WebhookAction type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Actions.ts#L293-L293 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Actions.ts#L293-L293 type WebhookAction struct { Auth *HttpInputAuthentication `json:"auth,omitempty"` Body *string `json:"body,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/webhookresult.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/webhookresult.go index 0e0701555..3508e3678 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/webhookresult.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/webhookresult.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // WebhookResult type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/_types/Actions.ts#L295-L298 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/_types/Actions.ts#L295-L298 type WebhookResult struct { Request HttpInputRequestResult `json:"request"` Response *HttpInputResponseResult `json:"response,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/weightedaverageaggregation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/weightedaverageaggregation.go index c3d96055d..f54f50220 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/weightedaverageaggregation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/weightedaverageaggregation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // WeightedAverageAggregation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L432-L446 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L432-L446 type WeightedAverageAggregation struct { // Format A numeric response formatter. Format *string `json:"format,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/weightedaveragevalue.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/weightedaveragevalue.go index d8c2a5bdc..e8e4da679 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/weightedaveragevalue.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/weightedaveragevalue.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // WeightedAverageValue type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/metric.ts#L448-L458 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/metric.ts#L448-L458 type WeightedAverageValue struct { // Field The field from which to extract the values or weights. Field *string `json:"field,omitempty"` @@ -76,9 +76,40 @@ func (s *WeightedAverageValue) UnmarshalJSON(data []byte) error { } case "script": - if err := dec.Decode(&s.Script); err != nil { + message := json.RawMessage{} + if err := dec.Decode(&message); err != nil { return err } + keyDec := json.NewDecoder(bytes.NewReader(message)) + for { + t, err := keyDec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + return err + } + + switch t { + + case "lang", "options", "source": + o := NewInlineScript() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + case "id": + o := NewStoredScriptId() + localDec := json.NewDecoder(bytes.NewReader(message)) + if err := localDec.Decode(&o); err != nil { + return err + } + s.Script = o + + } + } } } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/weightedavgaggregate.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/weightedavgaggregate.go index ab2c4cea1..2e0fe9f76 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/weightedavgaggregate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/weightedavgaggregate.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // WeightedAvgAggregate type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/aggregations/Aggregate.ts#L212-L216 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/aggregations/Aggregate.ts#L212-L216 type WeightedAvgAggregate struct { Meta Metadata `json:"meta,omitempty"` // Value The metric value. A missing value generally means that there was no data to diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/weights.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/weights.go index bb942bd0f..29e4b7b1c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/weights.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/weights.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // Weights type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/put_trained_model/types.ts#L108-L110 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/put_trained_model/types.ts#L108-L110 type Weights struct { Weights Float64 `json:"weights"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/whitespaceanalyzer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/whitespaceanalyzer.go index 1710e4432..b45164e13 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/whitespaceanalyzer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/whitespaceanalyzer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -29,7 +29,7 @@ import ( // WhitespaceAnalyzer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/analyzers.ts#L108-L111 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/analyzers.ts#L108-L111 type WhitespaceAnalyzer struct { Type string `json:"type,omitempty"` Version *string `json:"version,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/whitespacetokenizer.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/whitespacetokenizer.go index 4d7ff76d3..3455a9371 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/whitespacetokenizer.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/whitespacetokenizer.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // WhitespaceTokenizer type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/tokenizers.ts#L115-L118 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/tokenizers.ts#L115-L118 type WhitespaceTokenizer struct { MaxTokenLength *int `json:"max_token_length,omitempty"` Type string `json:"type,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/wildcardproperty.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/wildcardproperty.go index 75ae002f9..e60eac266 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/wildcardproperty.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/wildcardproperty.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // WildcardProperty type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/mapping/core.ts#L276-L283 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/mapping/core.ts#L276-L283 type WildcardProperty struct { CopyTo []string `json:"copy_to,omitempty"` DocValues *bool `json:"doc_values,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/wildcardquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/wildcardquery.go index 7683e29a7..7cc805266 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/wildcardquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/wildcardquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // WildcardQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/term.ts#L268-L285 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/term.ts#L268-L285 type WildcardQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/wktgeobounds.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/wktgeobounds.go index a72d14322..c88fdb646 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/wktgeobounds.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/wktgeobounds.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // WktGeoBounds type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/Geo.ts#L159-L161 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/Geo.ts#L159-L161 type WktGeoBounds struct { Wkt string `json:"wkt"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/worddelimitergraphtokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/worddelimitergraphtokenfilter.go index 07eedbd03..1573426ed 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/worddelimitergraphtokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/worddelimitergraphtokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // WordDelimiterGraphTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L149-L166 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L149-L166 type WordDelimiterGraphTokenFilter struct { AdjustOffsets *bool `json:"adjust_offsets,omitempty"` CatenateAll *bool `json:"catenate_all,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/worddelimitertokenfilter.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/worddelimitertokenfilter.go index 4c14985f6..f7049368e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/worddelimitertokenfilter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/worddelimitertokenfilter.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // WordDelimiterTokenFilter type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/analysis/token_filters.ts#L132-L147 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/analysis/token_filters.ts#L132-L147 type WordDelimiterTokenFilter struct { CatenateAll *bool `json:"catenate_all,omitempty"` CatenateNumbers *bool `json:"catenate_numbers,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/wrapperquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/wrapperquery.go index 791fb2064..c5986f093 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/wrapperquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/wrapperquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // WrapperQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_types/query_dsl/abstractions.ts#L465-L471 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_types/query_dsl/abstractions.ts#L465-L471 type WrapperQuery struct { // Boost Floating point number used to decrease or increase the relevance scores of // the query. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/writeoperation.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/writeoperation.go index ecb186be6..b570b88f1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/writeoperation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/writeoperation.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -32,7 +32,7 @@ import ( // WriteOperation type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/_global/bulk/types.ts#L109-L128 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/_global/bulk/types.ts#L109-L128 type WriteOperation struct { // DynamicTemplates A map from the full name of fields to the name of dynamic templates. // Defaults to an empty map. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/xpackdatafeed.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/xpackdatafeed.go index e94440272..f47efe2bc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/xpackdatafeed.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/xpackdatafeed.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // XpackDatafeed type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L77-L79 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L77-L79 type XpackDatafeed struct { Count int64 `json:"count"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/xpackfeature.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/xpackfeature.go index 8cfe55223..d9c3e90b6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/xpackfeature.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/xpackfeature.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // XpackFeature type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/info/types.ts#L77-L82 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/info/types.ts#L77-L82 type XpackFeature struct { Available bool `json:"available"` Description *string `json:"description,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/xpackfeatures.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/xpackfeatures.go index f6da930b5..bd8479546 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/xpackfeatures.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/xpackfeatures.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types // XpackFeatures type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/info/types.ts#L42-L75 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/info/types.ts#L42-L75 type XpackFeatures struct { AggregateMetric XpackFeature `json:"aggregate_metric"` Analytics XpackFeature `json:"analytics"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/xpackquery.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/xpackquery.go index 650dc8a49..0899b5334 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/xpackquery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/xpackquery.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // XpackQuery type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L259-L264 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L259-L264 type XpackQuery struct { Count *int `json:"count,omitempty"` Failed *int `json:"failed,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/xpackrealm.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/xpackrealm.go index a7d747b98..54fa44918 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/xpackrealm.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/xpackrealm.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // XpackRealm type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L417-L426 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L417-L426 type XpackRealm struct { Available bool `json:"available"` Cache []RealmCache `json:"cache,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/xpackrolemapping.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/xpackrolemapping.go index 868eca8c0..abde5ff96 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/xpackrolemapping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/xpackrolemapping.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // XpackRoleMapping type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L270-L273 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L270-L273 type XpackRoleMapping struct { Enabled int `json:"enabled"` Size int `json:"size"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/xpackruntimefieldtypes.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/xpackruntimefieldtypes.go index 866276354..d37228c6b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/xpackruntimefieldtypes.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/xpackruntimefieldtypes.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // XpackRuntimeFieldTypes type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/types.ts#L275-L277 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/types.ts#L275-L277 type XpackRuntimeFieldTypes struct { Available bool `json:"available"` Enabled bool `json:"enabled"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/zeroshotclassificationinferenceoptions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/zeroshotclassificationinferenceoptions.go index c01196675..0b6ac3732 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/zeroshotclassificationinferenceoptions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/zeroshotclassificationinferenceoptions.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ZeroShotClassificationInferenceOptions type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/inference.ts#L201-L222 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/inference.ts#L201-L222 type ZeroShotClassificationInferenceOptions struct { // ClassificationLabels The zero shot classification labels indicating entailment, neutral, and // contradiction diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/zeroshotclassificationinferenceupdateoptions.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/zeroshotclassificationinferenceupdateoptions.go index 8d5e9ad80..5ccfd1736 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/zeroshotclassificationinferenceupdateoptions.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/types/zeroshotclassificationinferenceupdateoptions.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package types @@ -30,7 +30,7 @@ import ( // ZeroShotClassificationInferenceUpdateOptions type. // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/ml/_types/inference.ts#L374-L383 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/ml/_types/inference.ts#L374-L383 type ZeroShotClassificationInferenceUpdateOptions struct { // Labels The labels to predict. Labels []string `json:"labels"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/ackwatch/ack_watch.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/ackwatch/ack_watch.go index 998528793..d06b88454 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/ackwatch/ack_watch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/ackwatch/ack_watch.go @@ -16,14 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Acknowledges a watch, manually throttling the execution of the watch's // actions. package ackwatch import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -54,12 +53,16 @@ type AckWatch struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int watchid string actionid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewAckWatch type alias for index. @@ -86,7 +89,12 @@ func New(tp elastictransport.Interface) *AckWatch { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -111,6 +119,9 @@ func (r *AckWatch) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("watch") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "watchid", r.watchid) + } path.WriteString(r.watchid) path.WriteString("/") path.WriteString("_ack") @@ -123,11 +134,17 @@ func (r *AckWatch) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("watch") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "watchid", r.watchid) + } path.WriteString(r.watchid) path.WriteString("/") path.WriteString("_ack") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "actionid", r.actionid) + } path.WriteString(r.actionid) method = http.MethodPut @@ -141,9 +158,9 @@ func (r *AckWatch) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -160,27 +177,66 @@ func (r *AckWatch) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r AckWatch) Perform(ctx context.Context) (*http.Response, error) { +func (r AckWatch) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "watcher.ack_watch") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "watcher.ack_watch") + if reader := instrument.RecordRequestBody(ctx, "watcher.ack_watch", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "watcher.ack_watch") + } if err != nil { - return nil, fmt.Errorf("an error happened during the AckWatch query execution: %w", err) + localErr := fmt.Errorf("an error happened during the AckWatch query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a ackwatch.Response -func (r AckWatch) Do(ctx context.Context) (*Response, error) { +func (r AckWatch) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.ack_watch") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -188,6 +244,9 @@ func (r AckWatch) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -197,6 +256,9 @@ func (r AckWatch) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -204,12 +266,25 @@ func (r AckWatch) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r AckWatch) IsSuccess(ctx context.Context) (bool, error) { +func (r AckWatch) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.ack_watch") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -225,6 +300,14 @@ func (r AckWatch) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the AckWatch query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/ackwatch/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/ackwatch/response.go index 018410bce..c1b32c77a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/ackwatch/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/ackwatch/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package ackwatch @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package ackwatch // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/ack_watch/WatcherAckWatchResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/ack_watch/WatcherAckWatchResponse.ts#L22-L24 type Response struct { Status types.WatchStatus `json:"status"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/activatewatch/activate_watch.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/activatewatch/activate_watch.go index 4bd928b87..4e5be36bd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/activatewatch/activate_watch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/activatewatch/activate_watch.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Activates a currently inactive watch. package activatewatch import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type ActivateWatch struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int watchid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewActivateWatch type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *ActivateWatch { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *ActivateWatch) HttpRequest(ctx context.Context) (*http.Request, error) path.WriteString("watch") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "watchid", r.watchid) + } path.WriteString(r.watchid) path.WriteString("/") path.WriteString("_activate") @@ -121,9 +132,9 @@ func (r *ActivateWatch) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -140,27 +151,66 @@ func (r *ActivateWatch) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ActivateWatch) Perform(ctx context.Context) (*http.Response, error) { +func (r ActivateWatch) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "watcher.activate_watch") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "watcher.activate_watch") + if reader := instrument.RecordRequestBody(ctx, "watcher.activate_watch", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "watcher.activate_watch") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ActivateWatch query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ActivateWatch query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a activatewatch.Response -func (r ActivateWatch) Do(ctx context.Context) (*Response, error) { +func (r ActivateWatch) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.activate_watch") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -168,6 +218,9 @@ func (r ActivateWatch) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -177,6 +230,9 @@ func (r ActivateWatch) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,12 +240,25 @@ func (r ActivateWatch) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r ActivateWatch) IsSuccess(ctx context.Context) (bool, error) { +func (r ActivateWatch) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.activate_watch") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -205,6 +274,14 @@ func (r ActivateWatch) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the ActivateWatch query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/activatewatch/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/activatewatch/response.go index 82d329fbb..4ba0f39cd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/activatewatch/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/activatewatch/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package activatewatch @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package activatewatch // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/activate_watch/WatcherActivateWatchResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/activate_watch/WatcherActivateWatchResponse.ts#L22-L24 type Response struct { Status types.ActivationStatus `json:"status"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/deactivatewatch/deactivate_watch.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/deactivatewatch/deactivate_watch.go index 1a608a8da..0cf1d7b56 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/deactivatewatch/deactivate_watch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/deactivatewatch/deactivate_watch.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Deactivates a currently active watch. package deactivatewatch import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type DeactivateWatch struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int watchid string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeactivateWatch type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *DeactivateWatch { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *DeactivateWatch) HttpRequest(ctx context.Context) (*http.Request, error path.WriteString("watch") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "watchid", r.watchid) + } path.WriteString(r.watchid) path.WriteString("/") path.WriteString("_deactivate") @@ -121,9 +132,9 @@ func (r *DeactivateWatch) HttpRequest(ctx context.Context) (*http.Request, error } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -140,27 +151,66 @@ func (r *DeactivateWatch) HttpRequest(ctx context.Context) (*http.Request, error } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeactivateWatch) Perform(ctx context.Context) (*http.Response, error) { +func (r DeactivateWatch) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "watcher.deactivate_watch") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "watcher.deactivate_watch") + if reader := instrument.RecordRequestBody(ctx, "watcher.deactivate_watch", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "watcher.deactivate_watch") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeactivateWatch query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeactivateWatch query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deactivatewatch.Response -func (r DeactivateWatch) Do(ctx context.Context) (*Response, error) { +func (r DeactivateWatch) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.deactivate_watch") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -168,6 +218,9 @@ func (r DeactivateWatch) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -177,6 +230,9 @@ func (r DeactivateWatch) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -184,12 +240,25 @@ func (r DeactivateWatch) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeactivateWatch) IsSuccess(ctx context.Context) (bool, error) { +func (r DeactivateWatch) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.deactivate_watch") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -205,6 +274,14 @@ func (r DeactivateWatch) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeactivateWatch query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/deactivatewatch/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/deactivatewatch/response.go index 8784789f8..54fd428a1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/deactivatewatch/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/deactivatewatch/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deactivatewatch @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package deactivatewatch // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/deactivate_watch/DeactivateWatchResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/deactivate_watch/DeactivateWatchResponse.ts#L22-L24 type Response struct { Status types.ActivationStatus `json:"status"` } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/deletewatch/delete_watch.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/deletewatch/delete_watch.go index c68989f15..7296a1c89 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/deletewatch/delete_watch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/deletewatch/delete_watch.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Removes a watch from Watcher. package deletewatch import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type DeleteWatch struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewDeleteWatch type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *DeleteWatch { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *DeleteWatch) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("watch") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodDelete @@ -119,9 +130,9 @@ func (r *DeleteWatch) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -138,27 +149,66 @@ func (r *DeleteWatch) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r DeleteWatch) Perform(ctx context.Context) (*http.Response, error) { +func (r DeleteWatch) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "watcher.delete_watch") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "watcher.delete_watch") + if reader := instrument.RecordRequestBody(ctx, "watcher.delete_watch", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "watcher.delete_watch") + } if err != nil { - return nil, fmt.Errorf("an error happened during the DeleteWatch query execution: %w", err) + localErr := fmt.Errorf("an error happened during the DeleteWatch query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a deletewatch.Response -func (r DeleteWatch) Do(ctx context.Context) (*Response, error) { +func (r DeleteWatch) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.delete_watch") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -166,6 +216,9 @@ func (r DeleteWatch) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,6 +228,9 @@ func (r DeleteWatch) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,12 +238,25 @@ func (r DeleteWatch) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r DeleteWatch) IsSuccess(ctx context.Context) (bool, error) { +func (r DeleteWatch) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.delete_watch") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -203,6 +272,14 @@ func (r DeleteWatch) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the DeleteWatch query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/deletewatch/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/deletewatch/response.go index cef2dca9e..38e43422e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/deletewatch/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/deletewatch/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package deletewatch // Response holds the response body struct for the package deletewatch // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/delete_watch/DeleteWatchResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/delete_watch/DeleteWatchResponse.ts#L22-L24 type Response struct { Found bool `json:"found"` Id_ string `json:"_id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/executewatch/execute_watch.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/executewatch/execute_watch.go index 232275eeb..9788905e5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/executewatch/execute_watch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/executewatch/execute_watch.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Forces the execution of a stored watch. package executewatch @@ -52,15 +52,19 @@ type ExecuteWatch struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewExecuteWatch type alias for index. @@ -84,11 +88,18 @@ func New(tp elastictransport.Interface) *ExecuteWatch { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -125,9 +136,7 @@ func (r *ExecuteWatch) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -139,6 +148,10 @@ func (r *ExecuteWatch) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -149,6 +162,9 @@ func (r *ExecuteWatch) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("watch") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) path.WriteString("/") path.WriteString("_execute") @@ -173,15 +189,15 @@ func (r *ExecuteWatch) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -198,27 +214,66 @@ func (r *ExecuteWatch) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r ExecuteWatch) Perform(ctx context.Context) (*http.Response, error) { +func (r ExecuteWatch) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "watcher.execute_watch") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "watcher.execute_watch") + if reader := instrument.RecordRequestBody(ctx, "watcher.execute_watch", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "watcher.execute_watch") + } if err != nil { - return nil, fmt.Errorf("an error happened during the ExecuteWatch query execution: %w", err) + localErr := fmt.Errorf("an error happened during the ExecuteWatch query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a executewatch.Response -func (r ExecuteWatch) Do(ctx context.Context) (*Response, error) { +func (r ExecuteWatch) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.execute_watch") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -226,6 +281,9 @@ func (r ExecuteWatch) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -235,6 +293,9 @@ func (r ExecuteWatch) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -242,6 +303,9 @@ func (r ExecuteWatch) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/executewatch/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/executewatch/request.go index e42b1bf41..43b32c2b3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/executewatch/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/executewatch/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package executewatch @@ -30,7 +30,7 @@ import ( // Request holds the request body struct for the package executewatch // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/execute_watch/WatcherExecuteWatchRequest.ts#L28-L79 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/execute_watch/WatcherExecuteWatchRequest.ts#L28-L79 type Request struct { // ActionModes Determines how to handle the watch actions as part of the watch execution. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/executewatch/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/executewatch/response.go index e6de36267..d980bf1b0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/executewatch/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/executewatch/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package executewatch @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package executewatch // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/execute_watch/WatcherExecuteWatchResponse.ts#L23-L25 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/execute_watch/WatcherExecuteWatchResponse.ts#L23-L25 type Response struct { Id_ string `json:"_id"` WatchRecord types.WatchRecord `json:"watch_record"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/getsettings/get_settings.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/getsettings/get_settings.go index bf38a463b..00873b7f2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/getsettings/get_settings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/getsettings/get_settings.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieve settings for the watcher system index package getsettings import ( - gobytes "bytes" "context" "errors" "fmt" @@ -45,9 +44,13 @@ type GetSettings struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetSettings type alias for index. @@ -71,7 +74,12 @@ func New(tp elastictransport.Interface) *GetSettings { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,15 +114,15 @@ func (r *GetSettings) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -131,15 +139,42 @@ func (r *GetSettings) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetSettings) Perform(ctx context.Context) (*http.Response, error) { +func (r GetSettings) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "watcher.get_settings") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "watcher.get_settings") + if reader := instrument.RecordRequestBody(ctx, "watcher.get_settings", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "watcher.get_settings") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetSettings query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetSettings query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil @@ -152,7 +187,17 @@ func (r GetSettings) Do(ctx context.Context) (bool, error) { // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetSettings) IsSuccess(ctx context.Context) (bool, error) { +func (r GetSettings) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.get_settings") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -168,6 +213,14 @@ func (r GetSettings) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetSettings query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/getwatch/get_watch.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/getwatch/get_watch.go index c1d7f2a2b..1b3a2e6ef 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/getwatch/get_watch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/getwatch/get_watch.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves a watch by its ID. package getwatch import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -51,11 +50,15 @@ type GetWatch struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewGetWatch type alias for index. @@ -81,7 +84,12 @@ func New(tp elastictransport.Interface) *GetWatch { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,6 +114,9 @@ func (r *GetWatch) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("watch") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodGet @@ -119,9 +130,9 @@ func (r *GetWatch) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -138,27 +149,66 @@ func (r *GetWatch) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r GetWatch) Perform(ctx context.Context) (*http.Response, error) { +func (r GetWatch) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "watcher.get_watch") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "watcher.get_watch") + if reader := instrument.RecordRequestBody(ctx, "watcher.get_watch", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "watcher.get_watch") + } if err != nil { - return nil, fmt.Errorf("an error happened during the GetWatch query execution: %w", err) + localErr := fmt.Errorf("an error happened during the GetWatch query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a getwatch.Response -func (r GetWatch) Do(ctx context.Context) (*Response, error) { +func (r GetWatch) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.get_watch") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -166,6 +216,9 @@ func (r GetWatch) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -175,6 +228,9 @@ func (r GetWatch) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -182,12 +238,25 @@ func (r GetWatch) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r GetWatch) IsSuccess(ctx context.Context) (bool, error) { +func (r GetWatch) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.get_watch") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -203,6 +272,14 @@ func (r GetWatch) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the GetWatch query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/getwatch/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/getwatch/response.go index e7e2c1f36..52be73c4c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/getwatch/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/getwatch/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package getwatch @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package getwatch // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/get_watch/GetWatchResponse.ts#L24-L34 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/get_watch/GetWatchResponse.ts#L24-L34 type Response struct { Found bool `json:"found"` Id_ string `json:"_id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/putwatch/put_watch.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/putwatch/put_watch.go index 228ee24ac..ed5fae29d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/putwatch/put_watch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/putwatch/put_watch.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Creates a new watch, or updates an existing one. package putwatch @@ -51,15 +51,19 @@ type PutWatch struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int id string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewPutWatch type alias for index. @@ -85,11 +89,18 @@ func New(tp elastictransport.Interface) *PutWatch { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -126,9 +137,7 @@ func (r *PutWatch) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -140,6 +149,10 @@ func (r *PutWatch) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -150,6 +163,9 @@ func (r *PutWatch) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("watch") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "id", r.id) + } path.WriteString(r.id) method = http.MethodPut @@ -163,15 +179,15 @@ func (r *PutWatch) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -188,27 +204,66 @@ func (r *PutWatch) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r PutWatch) Perform(ctx context.Context) (*http.Response, error) { +func (r PutWatch) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "watcher.put_watch") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "watcher.put_watch") + if reader := instrument.RecordRequestBody(ctx, "watcher.put_watch", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "watcher.put_watch") + } if err != nil { - return nil, fmt.Errorf("an error happened during the PutWatch query execution: %w", err) + localErr := fmt.Errorf("an error happened during the PutWatch query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a putwatch.Response -func (r PutWatch) Do(ctx context.Context) (*Response, error) { +func (r PutWatch) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.put_watch") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -216,6 +271,9 @@ func (r PutWatch) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -225,6 +283,9 @@ func (r PutWatch) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -232,6 +293,9 @@ func (r PutWatch) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/putwatch/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/putwatch/request.go index 893993a9b..542a33715 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/putwatch/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/putwatch/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putwatch @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package putwatch // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/put_watch/WatcherPutWatchRequest.ts#L30-L53 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/put_watch/WatcherPutWatchRequest.ts#L30-L53 type Request struct { Actions map[string]types.WatcherAction `json:"actions,omitempty"` Condition *types.WatcherCondition `json:"condition,omitempty"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/putwatch/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/putwatch/response.go index 4c5747812..9882b9162 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/putwatch/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/putwatch/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package putwatch // Response holds the response body struct for the package putwatch // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/put_watch/WatcherPutWatchResponse.ts#L23-L31 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/put_watch/WatcherPutWatchResponse.ts#L23-L31 type Response struct { Created bool `json:"created"` Id_ string `json:"_id"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/querywatches/query_watches.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/querywatches/query_watches.go index 14d67910d..617a778d2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/querywatches/query_watches.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/querywatches/query_watches.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves stored watches. package querywatches @@ -46,13 +46,17 @@ type QueryWatches struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader req *Request deferred []func(request *Request) error - raw io.Reader + buf *gobytes.Buffer paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewQueryWatches type alias for index. @@ -76,11 +80,18 @@ func New(tp elastictransport.Interface) *QueryWatches { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + + buf: gobytes.NewBuffer(nil), req: NewRequest(), } + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } + } + return r } @@ -117,9 +128,7 @@ func (r *QueryWatches) HttpRequest(ctx context.Context) (*http.Request, error) { } } - if r.raw != nil { - r.buf.ReadFrom(r.raw) - } else if r.req != nil { + if r.raw == nil && r.req != nil { data, err := json.Marshal(r.req) @@ -131,6 +140,10 @@ func (r *QueryWatches) HttpRequest(ctx context.Context) (*http.Request, error) { } + if r.buf.Len() > 0 { + r.raw = r.buf + } + r.path.Scheme = "http" switch { @@ -153,15 +166,15 @@ func (r *QueryWatches) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -178,27 +191,66 @@ func (r *QueryWatches) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r QueryWatches) Perform(ctx context.Context) (*http.Response, error) { +func (r QueryWatches) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "watcher.query_watches") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "watcher.query_watches") + if reader := instrument.RecordRequestBody(ctx, "watcher.query_watches", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "watcher.query_watches") + } if err != nil { - return nil, fmt.Errorf("an error happened during the QueryWatches query execution: %w", err) + localErr := fmt.Errorf("an error happened during the QueryWatches query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a querywatches.Response -func (r QueryWatches) Do(ctx context.Context) (*Response, error) { +func (r QueryWatches) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.query_watches") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -206,6 +258,9 @@ func (r QueryWatches) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -215,6 +270,9 @@ func (r QueryWatches) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -222,6 +280,9 @@ func (r QueryWatches) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/querywatches/request.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/querywatches/request.go index 4f8c6919b..b816c6d13 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/querywatches/request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/querywatches/request.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package querywatches @@ -29,7 +29,7 @@ import ( // Request holds the request body struct for the package querywatches // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/query_watches/WatcherQueryWatchesRequest.ts#L25-L48 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/query_watches/WatcherQueryWatchesRequest.ts#L25-L48 type Request struct { // From The offset from the first result to fetch. Needs to be non-negative. diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/querywatches/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/querywatches/response.go index ae449bf8b..b65cc74dd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/querywatches/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/querywatches/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package querywatches @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package querywatches // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/query_watches/WatcherQueryWatchesResponse.ts#L23-L28 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/query_watches/WatcherQueryWatchesResponse.ts#L23-L28 type Response struct { Count int `json:"count"` Watches []types.QueryWatch `json:"watches"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/start/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/start/response.go index 598314be4..7a4df3279 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/start/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/start/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package start // Response holds the response body struct for the package start // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/start/WatcherStartResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/start/WatcherStartResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/start/start.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/start/start.go index cb334f748..a183fddfe 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/start/start.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/start/start.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Starts Watcher if it is not already running. package start import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -47,9 +46,13 @@ type Start struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewStart type alias for index. @@ -73,7 +76,12 @@ func New(tp elastictransport.Interface) *Start { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,9 +116,9 @@ func (r *Start) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -127,27 +135,66 @@ func (r *Start) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Start) Perform(ctx context.Context) (*http.Response, error) { +func (r Start) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "watcher.start") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "watcher.start") + if reader := instrument.RecordRequestBody(ctx, "watcher.start", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "watcher.start") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Start query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Start query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a start.Response -func (r Start) Do(ctx context.Context) (*Response, error) { +func (r Start) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.start") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -155,6 +202,9 @@ func (r Start) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -164,6 +214,9 @@ func (r Start) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -171,12 +224,25 @@ func (r Start) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Start) IsSuccess(ctx context.Context) (bool, error) { +func (r Start) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.start") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -192,6 +258,14 @@ func (r Start) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Start query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/stats/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/stats/response.go index 9d6308b5d..331a2d9a9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/stats/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/stats/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package stats @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package stats // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/stats/WatcherStatsResponse.ts#L24-L32 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/stats/WatcherStatsResponse.ts#L24-L32 type Response struct { ClusterName string `json:"cluster_name"` ManuallyStopped bool `json:"manually_stopped"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/stats/stats.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/stats/stats.go index 10dcfe86d..31e1f1bc3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/stats/stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/stats/stats.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves the current Watcher metrics. package stats import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -52,11 +51,15 @@ type Stats struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int metric string + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewStats type alias for index. @@ -80,7 +83,12 @@ func New(tp elastictransport.Interface) *Stats { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -112,6 +120,9 @@ func (r *Stats) HttpRequest(ctx context.Context) (*http.Request, error) { path.WriteString("stats") path.WriteString("/") + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordPathPart(ctx, "metric", r.metric) + } path.WriteString(r.metric) method = http.MethodGet @@ -125,9 +136,9 @@ func (r *Stats) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -144,27 +155,66 @@ func (r *Stats) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Stats) Perform(ctx context.Context) (*http.Response, error) { +func (r Stats) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "watcher.stats") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "watcher.stats") + if reader := instrument.RecordRequestBody(ctx, "watcher.stats", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "watcher.stats") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Stats query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Stats query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a stats.Response -func (r Stats) Do(ctx context.Context) (*Response, error) { +func (r Stats) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -172,6 +222,9 @@ func (r Stats) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -181,6 +234,9 @@ func (r Stats) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -188,12 +244,25 @@ func (r Stats) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Stats) IsSuccess(ctx context.Context) (bool, error) { +func (r Stats) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.stats") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -209,6 +278,14 @@ func (r Stats) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Stats query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/stop/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/stop/response.go index a9685081a..fceadb1cf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/stop/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/stop/response.go @@ -16,13 +16,13 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package stop // Response holds the response body struct for the package stop // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/watcher/stop/WatcherStopResponse.ts#L22-L24 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/watcher/stop/WatcherStopResponse.ts#L22-L24 type Response struct { // Acknowledged For a successful response, this value is always true. On failure, an diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/stop/stop.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/stop/stop.go index 906b41986..8bceaacf5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/stop/stop.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/stop/stop.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Stops Watcher if it is running. package stop import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -47,9 +46,13 @@ type Stop struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewStop type alias for index. @@ -73,7 +76,12 @@ func New(tp elastictransport.Interface) *Stop { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,9 +116,9 @@ func (r *Stop) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -127,27 +135,66 @@ func (r *Stop) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Stop) Perform(ctx context.Context) (*http.Response, error) { +func (r Stop) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "watcher.stop") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "watcher.stop") + if reader := instrument.RecordRequestBody(ctx, "watcher.stop", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "watcher.stop") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Stop query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Stop query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a stop.Response -func (r Stop) Do(ctx context.Context) (*Response, error) { +func (r Stop) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.stop") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -155,6 +202,9 @@ func (r Stop) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -164,6 +214,9 @@ func (r Stop) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -171,12 +224,25 @@ func (r Stop) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Stop) IsSuccess(ctx context.Context) (bool, error) { +func (r Stop) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.stop") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -192,6 +258,14 @@ func (r Stop) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Stop query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/updatesettings/update_settings.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/updatesettings/update_settings.go index 4b514f82f..526717bcf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/updatesettings/update_settings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/watcher/updatesettings/update_settings.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Update settings for the watcher system index package updatesettings import ( - gobytes "bytes" "context" "errors" "fmt" @@ -45,9 +44,13 @@ type UpdateSettings struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewUpdateSettings type alias for index. @@ -71,7 +74,12 @@ func New(tp elastictransport.Interface) *UpdateSettings { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -106,15 +114,15 @@ func (r *UpdateSettings) HttpRequest(ctx context.Context) (*http.Request, error) } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() if req.Header.Get("Content-Type") == "" { - if r.buf.Len() > 0 { + if r.raw != nil { req.Header.Set("Content-Type", "application/vnd.elasticsearch+json;compatible-with=8") } } @@ -131,15 +139,42 @@ func (r *UpdateSettings) HttpRequest(ctx context.Context) (*http.Request, error) } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r UpdateSettings) Perform(ctx context.Context) (*http.Response, error) { +func (r UpdateSettings) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "watcher.update_settings") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "watcher.update_settings") + if reader := instrument.RecordRequestBody(ctx, "watcher.update_settings", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "watcher.update_settings") + } if err != nil { - return nil, fmt.Errorf("an error happened during the UpdateSettings query execution: %w", err) + localErr := fmt.Errorf("an error happened during the UpdateSettings query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil @@ -152,7 +187,17 @@ func (r UpdateSettings) Do(ctx context.Context) (bool, error) { // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r UpdateSettings) IsSuccess(ctx context.Context) (bool, error) { +func (r UpdateSettings) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "watcher.update_settings") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -168,6 +213,14 @@ func (r UpdateSettings) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the UpdateSettings query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/xpack/info/info.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/xpack/info/info.go index df49439fe..22a9e8cf1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/xpack/info/info.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/xpack/info/info.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves information about the installed X-Pack features. package info import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -48,9 +47,13 @@ type Info struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewInfo type alias for index. @@ -74,7 +77,12 @@ func New(tp elastictransport.Interface) *Info { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -107,9 +115,9 @@ func (r *Info) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -126,27 +134,66 @@ func (r *Info) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Info) Perform(ctx context.Context) (*http.Response, error) { +func (r Info) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "xpack.info") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "xpack.info") + if reader := instrument.RecordRequestBody(ctx, "xpack.info", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "xpack.info") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Info query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Info query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a info.Response -func (r Info) Do(ctx context.Context) (*Response, error) { +func (r Info) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "xpack.info") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -154,6 +201,9 @@ func (r Info) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -163,6 +213,9 @@ func (r Info) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -170,12 +223,25 @@ func (r Info) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Info) IsSuccess(ctx context.Context) (bool, error) { +func (r Info) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "xpack.info") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -191,6 +257,14 @@ func (r Info) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Info query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/xpack/info/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/xpack/info/response.go index 00cc7897d..13457c6c8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/xpack/info/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/xpack/info/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package info @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package info // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/info/XPackInfoResponse.ts#L22-L29 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/info/XPackInfoResponse.ts#L22-L29 type Response struct { Build types.BuildInformation `json:"build"` Features types.XpackFeatures `json:"features"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/xpack/usage/response.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/xpack/usage/response.go index abc5d6774..df9391a0f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/xpack/usage/response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/xpack/usage/response.go @@ -16,7 +16,7 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c package usage @@ -26,7 +26,7 @@ import ( // Response holds the response body struct for the package usage // -// https://github.com/elastic/elasticsearch-specification/blob/5fea44e006349579bf3561a82e997002e5716117/specification/xpack/usage/XPackUsageResponse.ts#L43-L79 +// https://github.com/elastic/elasticsearch-specification/blob/17ac39c7f9266bc303baa029f90194aecb1c3b7c/specification/xpack/usage/XPackUsageResponse.ts#L43-L79 type Response struct { AggregateMetric types.Base `json:"aggregate_metric"` Analytics types.Analytics `json:"analytics"` diff --git a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/xpack/usage/usage.go b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/xpack/usage/usage.go index 168ebabc1..03f7a8b80 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/xpack/usage/usage.go +++ b/vendor/github.com/elastic/go-elasticsearch/v8/typedapi/xpack/usage/usage.go @@ -16,13 +16,12 @@ // under the License. // Code generated from the elasticsearch-specification DO NOT EDIT. -// https://github.com/elastic/elasticsearch-specification/tree/5fea44e006349579bf3561a82e997002e5716117 +// https://github.com/elastic/elasticsearch-specification/tree/17ac39c7f9266bc303baa029f90194aecb1c3b7c // Retrieves usage information about the installed X-Pack features. package usage import ( - gobytes "bytes" "context" "encoding/json" "errors" @@ -47,9 +46,13 @@ type Usage struct { values url.Values path url.URL - buf *gobytes.Buffer + raw io.Reader paramSet int + + spanStarted bool + + instrument elastictransport.Instrumentation } // NewUsage type alias for index. @@ -73,7 +76,12 @@ func New(tp elastictransport.Interface) *Usage { transport: tp, values: make(url.Values), headers: make(http.Header), - buf: gobytes.NewBuffer(nil), + } + + if instrumented, ok := r.transport.(elastictransport.Instrumented); ok { + if instrument := instrumented.InstrumentationEnabled(); instrument != nil { + r.instrument = instrument + } } return r @@ -108,9 +116,9 @@ func (r *Usage) HttpRequest(ctx context.Context) (*http.Request, error) { } if ctx != nil { - req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.buf) + req, err = http.NewRequestWithContext(ctx, method, r.path.String(), r.raw) } else { - req, err = http.NewRequest(method, r.path.String(), r.buf) + req, err = http.NewRequest(method, r.path.String(), r.raw) } req.Header = r.headers.Clone() @@ -127,27 +135,66 @@ func (r *Usage) HttpRequest(ctx context.Context) (*http.Request, error) { } // Perform runs the http.Request through the provided transport and returns an http.Response. -func (r Usage) Perform(ctx context.Context) (*http.Response, error) { +func (r Usage) Perform(providedCtx context.Context) (*http.Response, error) { + var ctx context.Context + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + if r.spanStarted == false { + ctx := instrument.Start(providedCtx, "xpack.usage") + defer instrument.Close(ctx) + } + } + if ctx == nil { + ctx = providedCtx + } + req, err := r.HttpRequest(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.BeforeRequest(req, "xpack.usage") + if reader := instrument.RecordRequestBody(ctx, "xpack.usage", r.raw); reader != nil { + req.Body = reader + } + } res, err := r.transport.Perform(req) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "xpack.usage") + } if err != nil { - return nil, fmt.Errorf("an error happened during the Usage query execution: %w", err) + localErr := fmt.Errorf("an error happened during the Usage query execution: %w", err) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, localErr) + } + return nil, localErr } return res, nil } // Do runs the request through the transport, handle the response and returns a usage.Response -func (r Usage) Do(ctx context.Context) (*Response, error) { +func (r Usage) Do(providedCtx context.Context) (*Response, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "xpack.usage") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } response := NewResponse() res, err := r.Perform(ctx) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } defer res.Body.Close() @@ -155,6 +202,9 @@ func (r Usage) Do(ctx context.Context) (*Response, error) { if res.StatusCode < 299 { err = json.NewDecoder(res.Body).Decode(response) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -164,6 +214,9 @@ func (r Usage) Do(ctx context.Context) (*Response, error) { errorResponse := types.NewElasticsearchError() err = json.NewDecoder(res.Body).Decode(errorResponse) if err != nil { + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } return nil, err } @@ -171,12 +224,25 @@ func (r Usage) Do(ctx context.Context) (*Response, error) { errorResponse.Status = res.StatusCode } + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, errorResponse) + } return nil, errorResponse } // IsSuccess allows to run a query with a context and retrieve the result as a boolean. // This only exists for endpoints without a request payload and allows for quick control flow. -func (r Usage) IsSuccess(ctx context.Context) (bool, error) { +func (r Usage) IsSuccess(providedCtx context.Context) (bool, error) { + var ctx context.Context + r.spanStarted = true + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + ctx = instrument.Start(providedCtx, "xpack.usage") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + res, err := r.Perform(ctx) if err != nil { @@ -192,6 +258,14 @@ func (r Usage) IsSuccess(ctx context.Context) (bool, error) { return true, nil } + if res.StatusCode != 404 { + err := fmt.Errorf("an error happened during the Usage query execution, status code: %d", res.StatusCode) + if instrument, ok := r.instrument.(elastictransport.Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return false, err + } + return false, nil } diff --git a/vendor/github.com/go-logr/logr/.golangci.yaml b/vendor/github.com/go-logr/logr/.golangci.yaml new file mode 100644 index 000000000..0cffafa7b --- /dev/null +++ b/vendor/github.com/go-logr/logr/.golangci.yaml @@ -0,0 +1,26 @@ +run: + timeout: 1m + tests: true + +linters: + disable-all: true + enable: + - asciicheck + - errcheck + - forcetypeassert + - gocritic + - gofmt + - goimports + - gosimple + - govet + - ineffassign + - misspell + - revive + - staticcheck + - typecheck + - unused + +issues: + exclude-use-default: false + max-issues-per-linter: 0 + max-same-issues: 10 diff --git a/vendor/github.com/go-logr/logr/CHANGELOG.md b/vendor/github.com/go-logr/logr/CHANGELOG.md new file mode 100644 index 000000000..c35696004 --- /dev/null +++ b/vendor/github.com/go-logr/logr/CHANGELOG.md @@ -0,0 +1,6 @@ +# CHANGELOG + +## v1.0.0-rc1 + +This is the first logged release. Major changes (including breaking changes) +have occurred since earlier tags. diff --git a/vendor/github.com/go-logr/logr/CONTRIBUTING.md b/vendor/github.com/go-logr/logr/CONTRIBUTING.md new file mode 100644 index 000000000..5d37e294c --- /dev/null +++ b/vendor/github.com/go-logr/logr/CONTRIBUTING.md @@ -0,0 +1,17 @@ +# Contributing + +Logr is open to pull-requests, provided they fit within the intended scope of +the project. Specifically, this library aims to be VERY small and minimalist, +with no external dependencies. + +## Compatibility + +This project intends to follow [semantic versioning](http://semver.org) and +is very strict about compatibility. Any proposed changes MUST follow those +rules. + +## Performance + +As a logging library, logr must be as light-weight as possible. Any proposed +code change must include results of running the [benchmark](./benchmark) +before and after the change. diff --git a/vendor/github.com/go-logr/logr/LICENSE b/vendor/github.com/go-logr/logr/LICENSE new file mode 100644 index 000000000..8dada3eda --- /dev/null +++ b/vendor/github.com/go-logr/logr/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/go-logr/logr/README.md b/vendor/github.com/go-logr/logr/README.md new file mode 100644 index 000000000..a8c29bfbd --- /dev/null +++ b/vendor/github.com/go-logr/logr/README.md @@ -0,0 +1,393 @@ +# A minimal logging API for Go + +[![Go Reference](https://pkg.go.dev/badge/github.com/go-logr/logr.svg)](https://pkg.go.dev/github.com/go-logr/logr) +[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/go-logr/logr/badge)](https://securityscorecards.dev/viewer/?platform=github.com&org=go-logr&repo=logr) + +logr offers an(other) opinion on how Go programs and libraries can do logging +without becoming coupled to a particular logging implementation. This is not +an implementation of logging - it is an API. In fact it is two APIs with two +different sets of users. + +The `Logger` type is intended for application and library authors. It provides +a relatively small API which can be used everywhere you want to emit logs. It +defers the actual act of writing logs (to files, to stdout, or whatever) to the +`LogSink` interface. + +The `LogSink` interface is intended for logging library implementers. It is a +pure interface which can be implemented by logging frameworks to provide the actual logging +functionality. + +This decoupling allows application and library developers to write code in +terms of `logr.Logger` (which has very low dependency fan-out) while the +implementation of logging is managed "up stack" (e.g. in or near `main()`.) +Application developers can then switch out implementations as necessary. + +Many people assert that libraries should not be logging, and as such efforts +like this are pointless. Those people are welcome to convince the authors of +the tens-of-thousands of libraries that *DO* write logs that they are all +wrong. In the meantime, logr takes a more practical approach. + +## Typical usage + +Somewhere, early in an application's life, it will make a decision about which +logging library (implementation) it actually wants to use. Something like: + +``` + func main() { + // ... other setup code ... + + // Create the "root" logger. We have chosen the "logimpl" implementation, + // which takes some initial parameters and returns a logr.Logger. + logger := logimpl.New(param1, param2) + + // ... other setup code ... +``` + +Most apps will call into other libraries, create structures to govern the flow, +etc. The `logr.Logger` object can be passed to these other libraries, stored +in structs, or even used as a package-global variable, if needed. For example: + +``` + app := createTheAppObject(logger) + app.Run() +``` + +Outside of this early setup, no other packages need to know about the choice of +implementation. They write logs in terms of the `logr.Logger` that they +received: + +``` + type appObject struct { + // ... other fields ... + logger logr.Logger + // ... other fields ... + } + + func (app *appObject) Run() { + app.logger.Info("starting up", "timestamp", time.Now()) + + // ... app code ... +``` + +## Background + +If the Go standard library had defined an interface for logging, this project +probably would not be needed. Alas, here we are. + +When the Go developers started developing such an interface with +[slog](https://github.com/golang/go/issues/56345), they adopted some of the +logr design but also left out some parts and changed others: + +| Feature | logr | slog | +|---------|------|------| +| High-level API | `Logger` (passed by value) | `Logger` (passed by [pointer](https://github.com/golang/go/issues/59126)) | +| Low-level API | `LogSink` | `Handler` | +| Stack unwinding | done by `LogSink` | done by `Logger` | +| Skipping helper functions | `WithCallDepth`, `WithCallStackHelper` | [not supported by Logger](https://github.com/golang/go/issues/59145) | +| Generating a value for logging on demand | `Marshaler` | `LogValuer` | +| Log levels | >= 0, higher meaning "less important" | positive and negative, with 0 for "info" and higher meaning "more important" | +| Error log entries | always logged, don't have a verbosity level | normal log entries with level >= `LevelError` | +| Passing logger via context | `NewContext`, `FromContext` | no API | +| Adding a name to a logger | `WithName` | no API | +| Modify verbosity of log entries in a call chain | `V` | no API | +| Grouping of key/value pairs | not supported | `WithGroup`, `GroupValue` | + +The high-level slog API is explicitly meant to be one of many different APIs +that can be layered on top of a shared `slog.Handler`. logr is one such +alternative API, with [interoperability](#slog-interoperability) provided by the [`slogr`](slogr) +package. + +### Inspiration + +Before you consider this package, please read [this blog post by the +inimitable Dave Cheney][warning-makes-no-sense]. We really appreciate what +he has to say, and it largely aligns with our own experiences. + +### Differences from Dave's ideas + +The main differences are: + +1. Dave basically proposes doing away with the notion of a logging API in favor +of `fmt.Printf()`. We disagree, especially when you consider things like output +locations, timestamps, file and line decorations, and structured logging. This +package restricts the logging API to just 2 types of logs: info and error. + +Info logs are things you want to tell the user which are not errors. Error +logs are, well, errors. If your code receives an `error` from a subordinate +function call and is logging that `error` *and not returning it*, use error +logs. + +2. Verbosity-levels on info logs. This gives developers a chance to indicate +arbitrary grades of importance for info logs, without assigning names with +semantic meaning such as "warning", "trace", and "debug." Superficially this +may feel very similar, but the primary difference is the lack of semantics. +Because verbosity is a numerical value, it's safe to assume that an app running +with higher verbosity means more (and less important) logs will be generated. + +## Implementations (non-exhaustive) + +There are implementations for the following logging libraries: + +- **a function** (can bridge to non-structured libraries): [funcr](https://github.com/go-logr/logr/tree/master/funcr) +- **a testing.T** (for use in Go tests, with JSON-like output): [testr](https://github.com/go-logr/logr/tree/master/testr) +- **github.com/google/glog**: [glogr](https://github.com/go-logr/glogr) +- **k8s.io/klog** (for Kubernetes): [klogr](https://git.k8s.io/klog/klogr) +- **a testing.T** (with klog-like text output): [ktesting](https://git.k8s.io/klog/ktesting) +- **go.uber.org/zap**: [zapr](https://github.com/go-logr/zapr) +- **log** (the Go standard library logger): [stdr](https://github.com/go-logr/stdr) +- **github.com/sirupsen/logrus**: [logrusr](https://github.com/bombsimon/logrusr) +- **github.com/wojas/genericr**: [genericr](https://github.com/wojas/genericr) (makes it easy to implement your own backend) +- **logfmt** (Heroku style [logging](https://www.brandur.org/logfmt)): [logfmtr](https://github.com/iand/logfmtr) +- **github.com/rs/zerolog**: [zerologr](https://github.com/go-logr/zerologr) +- **github.com/go-kit/log**: [gokitlogr](https://github.com/tonglil/gokitlogr) (also compatible with github.com/go-kit/kit/log since v0.12.0) +- **bytes.Buffer** (writing to a buffer): [bufrlogr](https://github.com/tonglil/buflogr) (useful for ensuring values were logged, like during testing) + +## slog interoperability + +Interoperability goes both ways, using the `logr.Logger` API with a `slog.Handler` +and using the `slog.Logger` API with a `logr.LogSink`. [slogr](./slogr) provides `NewLogr` and +`NewSlogHandler` API calls to convert between a `logr.Logger` and a `slog.Handler`. +As usual, `slog.New` can be used to wrap such a `slog.Handler` in the high-level +slog API. `slogr` itself leaves that to the caller. + +## Using a `logr.Sink` as backend for slog + +Ideally, a logr sink implementation should support both logr and slog by +implementing both the normal logr interface(s) and `slogr.SlogSink`. Because +of a conflict in the parameters of the common `Enabled` method, it is [not +possible to implement both slog.Handler and logr.Sink in the same +type](https://github.com/golang/go/issues/59110). + +If both are supported, log calls can go from the high-level APIs to the backend +without the need to convert parameters. `NewLogr` and `NewSlogHandler` can +convert back and forth without adding additional wrappers, with one exception: +when `Logger.V` was used to adjust the verbosity for a `slog.Handler`, then +`NewSlogHandler` has to use a wrapper which adjusts the verbosity for future +log calls. + +Such an implementation should also support values that implement specific +interfaces from both packages for logging (`logr.Marshaler`, `slog.LogValuer`, +`slog.GroupValue`). logr does not convert those. + +Not supporting slog has several drawbacks: +- Recording source code locations works correctly if the handler gets called + through `slog.Logger`, but may be wrong in other cases. That's because a + `logr.Sink` does its own stack unwinding instead of using the program counter + provided by the high-level API. +- slog levels <= 0 can be mapped to logr levels by negating the level without a + loss of information. But all slog levels > 0 (e.g. `slog.LevelWarning` as + used by `slog.Logger.Warn`) must be mapped to 0 before calling the sink + because logr does not support "more important than info" levels. +- The slog group concept is supported by prefixing each key in a key/value + pair with the group names, separated by a dot. For structured output like + JSON it would be better to group the key/value pairs inside an object. +- Special slog values and interfaces don't work as expected. +- The overhead is likely to be higher. + +These drawbacks are severe enough that applications using a mixture of slog and +logr should switch to a different backend. + +## Using a `slog.Handler` as backend for logr + +Using a plain `slog.Handler` without support for logr works better than the +other direction: +- All logr verbosity levels can be mapped 1:1 to their corresponding slog level + by negating them. +- Stack unwinding is done by the `slogr.SlogSink` and the resulting program + counter is passed to the `slog.Handler`. +- Names added via `Logger.WithName` are gathered and recorded in an additional + attribute with `logger` as key and the names separated by slash as value. +- `Logger.Error` is turned into a log record with `slog.LevelError` as level + and an additional attribute with `err` as key, if an error was provided. + +The main drawback is that `logr.Marshaler` will not be supported. Types should +ideally support both `logr.Marshaler` and `slog.Valuer`. If compatibility +with logr implementations without slog support is not important, then +`slog.Valuer` is sufficient. + +## Context support for slog + +Storing a logger in a `context.Context` is not supported by +slog. `logr.NewContext` and `logr.FromContext` can be used with slog like this +to fill this gap: + + func HandlerFromContext(ctx context.Context) slog.Handler { + logger, err := logr.FromContext(ctx) + if err == nil { + return slogr.NewSlogHandler(logger) + } + return slog.Default().Handler() + } + + func ContextWithHandler(ctx context.Context, handler slog.Handler) context.Context { + return logr.NewContext(ctx, slogr.NewLogr(handler)) + } + +The downside is that storing and retrieving a `slog.Handler` needs more +allocations compared to using a `logr.Logger`. Therefore the recommendation is +to use the `logr.Logger` API in code which uses contextual logging. + +## FAQ + +### Conceptual + +#### Why structured logging? + +- **Structured logs are more easily queryable**: Since you've got + key-value pairs, it's much easier to query your structured logs for + particular values by filtering on the contents of a particular key -- + think searching request logs for error codes, Kubernetes reconcilers for + the name and namespace of the reconciled object, etc. + +- **Structured logging makes it easier to have cross-referenceable logs**: + Similarly to searchability, if you maintain conventions around your + keys, it becomes easy to gather all log lines related to a particular + concept. + +- **Structured logs allow better dimensions of filtering**: if you have + structure to your logs, you've got more precise control over how much + information is logged -- you might choose in a particular configuration + to log certain keys but not others, only log lines where a certain key + matches a certain value, etc., instead of just having v-levels and names + to key off of. + +- **Structured logs better represent structured data**: sometimes, the + data that you want to log is inherently structured (think tuple-link + objects.) Structured logs allow you to preserve that structure when + outputting. + +#### Why V-levels? + +**V-levels give operators an easy way to control the chattiness of log +operations**. V-levels provide a way for a given package to distinguish +the relative importance or verbosity of a given log message. Then, if +a particular logger or package is logging too many messages, the user +of the package can simply change the v-levels for that library. + +#### Why not named levels, like Info/Warning/Error? + +Read [Dave Cheney's post][warning-makes-no-sense]. Then read [Differences +from Dave's ideas](#differences-from-daves-ideas). + +#### Why not allow format strings, too? + +**Format strings negate many of the benefits of structured logs**: + +- They're not easily searchable without resorting to fuzzy searching, + regular expressions, etc. + +- They don't store structured data well, since contents are flattened into + a string. + +- They're not cross-referenceable. + +- They don't compress easily, since the message is not constant. + +(Unless you turn positional parameters into key-value pairs with numerical +keys, at which point you've gotten key-value logging with meaningless +keys.) + +### Practical + +#### Why key-value pairs, and not a map? + +Key-value pairs are *much* easier to optimize, especially around +allocations. Zap (a structured logger that inspired logr's interface) has +[performance measurements](https://github.com/uber-go/zap#performance) +that show this quite nicely. + +While the interface ends up being a little less obvious, you get +potentially better performance, plus avoid making users type +`map[string]string{}` every time they want to log. + +#### What if my V-levels differ between libraries? + +That's fine. Control your V-levels on a per-logger basis, and use the +`WithName` method to pass different loggers to different libraries. + +Generally, you should take care to ensure that you have relatively +consistent V-levels within a given logger, however, as this makes deciding +on what verbosity of logs to request easier. + +#### But I really want to use a format string! + +That's not actually a question. Assuming your question is "how do +I convert my mental model of logging with format strings to logging with +constant messages": + +1. Figure out what the error actually is, as you'd write in a TL;DR style, + and use that as a message. + +2. For every place you'd write a format specifier, look to the word before + it, and add that as a key value pair. + +For instance, consider the following examples (all taken from spots in the +Kubernetes codebase): + +- `klog.V(4).Infof("Client is returning errors: code %v, error %v", + responseCode, err)` becomes `logger.Error(err, "client returned an + error", "code", responseCode)` + +- `klog.V(4).Infof("Got a Retry-After %ds response for attempt %d to %v", + seconds, retries, url)` becomes `logger.V(4).Info("got a retry-after + response when requesting url", "attempt", retries, "after + seconds", seconds, "url", url)` + +If you *really* must use a format string, use it in a key's value, and +call `fmt.Sprintf` yourself. For instance: `log.Printf("unable to +reflect over type %T")` becomes `logger.Info("unable to reflect over +type", "type", fmt.Sprintf("%T"))`. In general though, the cases where +this is necessary should be few and far between. + +#### How do I choose my V-levels? + +This is basically the only hard constraint: increase V-levels to denote +more verbose or more debug-y logs. + +Otherwise, you can start out with `0` as "you always want to see this", +`1` as "common logging that you might *possibly* want to turn off", and +`10` as "I would like to performance-test your log collection stack." + +Then gradually choose levels in between as you need them, working your way +down from 10 (for debug and trace style logs) and up from 1 (for chattier +info-type logs). For reference, slog pre-defines -4 for debug logs +(corresponds to 4 in logr), which matches what is +[recommended for Kubernetes](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md#what-method-to-use). + +#### How do I choose my keys? + +Keys are fairly flexible, and can hold more or less any string +value. For best compatibility with implementations and consistency +with existing code in other projects, there are a few conventions you +should consider. + +- Make your keys human-readable. +- Constant keys are generally a good idea. +- Be consistent across your codebase. +- Keys should naturally match parts of the message string. +- Use lower case for simple keys and + [lowerCamelCase](https://en.wiktionary.org/wiki/lowerCamelCase) for + more complex ones. Kubernetes is one example of a project that has + [adopted that + convention](https://github.com/kubernetes/community/blob/HEAD/contributors/devel/sig-instrumentation/migration-to-structured-logging.md#name-arguments). + +While key names are mostly unrestricted (and spaces are acceptable), +it's generally a good idea to stick to printable ascii characters, or at +least match the general character set of your log lines. + +#### Why should keys be constant values? + +The point of structured logging is to make later log processing easier. Your +keys are, effectively, the schema of each log message. If you use different +keys across instances of the same log line, you will make your structured logs +much harder to use. `Sprintf()` is for values, not for keys! + +#### Why is this not a pure interface? + +The Logger type is implemented as a struct in order to allow the Go compiler to +optimize things like high-V `Info` logs that are not triggered. Not all of +these implementations are implemented yet, but this structure was suggested as +a way to ensure they *can* be implemented. All of the real work is behind the +`LogSink` interface. + +[warning-makes-no-sense]: http://dave.cheney.net/2015/11/05/lets-talk-about-logging diff --git a/vendor/github.com/go-logr/logr/SECURITY.md b/vendor/github.com/go-logr/logr/SECURITY.md new file mode 100644 index 000000000..1ca756fc7 --- /dev/null +++ b/vendor/github.com/go-logr/logr/SECURITY.md @@ -0,0 +1,18 @@ +# Security Policy + +If you have discovered a security vulnerability in this project, please report it +privately. **Do not disclose it as a public issue.** This gives us time to work with you +to fix the issue before public exposure, reducing the chance that the exploit will be +used before a patch is released. + +You may submit the report in the following ways: + +- send an email to go-logr-security@googlegroups.com +- send us a [private vulnerability report](https://github.com/go-logr/logr/security/advisories/new) + +Please provide the following information in your report: + +- A description of the vulnerability and its impact +- How to reproduce the issue + +We ask that you give us 90 days to work on a fix before public exposure. diff --git a/vendor/github.com/go-logr/logr/discard.go b/vendor/github.com/go-logr/logr/discard.go new file mode 100644 index 000000000..99fe8be93 --- /dev/null +++ b/vendor/github.com/go-logr/logr/discard.go @@ -0,0 +1,24 @@ +/* +Copyright 2020 The logr Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package logr + +// Discard returns a Logger that discards all messages logged to it. It can be +// used whenever the caller is not interested in the logs. Logger instances +// produced by this function always compare as equal. +func Discard() Logger { + return New(nil) +} diff --git a/vendor/github.com/go-logr/logr/funcr/funcr.go b/vendor/github.com/go-logr/logr/funcr/funcr.go new file mode 100644 index 000000000..12e5807cc --- /dev/null +++ b/vendor/github.com/go-logr/logr/funcr/funcr.go @@ -0,0 +1,804 @@ +/* +Copyright 2021 The logr Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package funcr implements formatting of structured log messages and +// optionally captures the call site and timestamp. +// +// The simplest way to use it is via its implementation of a +// github.com/go-logr/logr.LogSink with output through an arbitrary +// "write" function. See New and NewJSON for details. +// +// # Custom LogSinks +// +// For users who need more control, a funcr.Formatter can be embedded inside +// your own custom LogSink implementation. This is useful when the LogSink +// needs to implement additional methods, for example. +// +// # Formatting +// +// This will respect logr.Marshaler, fmt.Stringer, and error interfaces for +// values which are being logged. When rendering a struct, funcr will use Go's +// standard JSON tags (all except "string"). +package funcr + +import ( + "bytes" + "encoding" + "encoding/json" + "fmt" + "path/filepath" + "reflect" + "runtime" + "strconv" + "strings" + "time" + + "github.com/go-logr/logr" +) + +// New returns a logr.Logger which is implemented by an arbitrary function. +func New(fn func(prefix, args string), opts Options) logr.Logger { + return logr.New(newSink(fn, NewFormatter(opts))) +} + +// NewJSON returns a logr.Logger which is implemented by an arbitrary function +// and produces JSON output. +func NewJSON(fn func(obj string), opts Options) logr.Logger { + fnWrapper := func(_, obj string) { + fn(obj) + } + return logr.New(newSink(fnWrapper, NewFormatterJSON(opts))) +} + +// Underlier exposes access to the underlying logging function. Since +// callers only have a logr.Logger, they have to know which +// implementation is in use, so this interface is less of an +// abstraction and more of a way to test type conversion. +type Underlier interface { + GetUnderlying() func(prefix, args string) +} + +func newSink(fn func(prefix, args string), formatter Formatter) logr.LogSink { + l := &fnlogger{ + Formatter: formatter, + write: fn, + } + // For skipping fnlogger.Info and fnlogger.Error. + l.Formatter.AddCallDepth(1) + return l +} + +// Options carries parameters which influence the way logs are generated. +type Options struct { + // LogCaller tells funcr to add a "caller" key to some or all log lines. + // This has some overhead, so some users might not want it. + LogCaller MessageClass + + // LogCallerFunc tells funcr to also log the calling function name. This + // has no effect if caller logging is not enabled (see Options.LogCaller). + LogCallerFunc bool + + // LogTimestamp tells funcr to add a "ts" key to log lines. This has some + // overhead, so some users might not want it. + LogTimestamp bool + + // TimestampFormat tells funcr how to render timestamps when LogTimestamp + // is enabled. If not specified, a default format will be used. For more + // details, see docs for Go's time.Layout. + TimestampFormat string + + // Verbosity tells funcr which V logs to produce. Higher values enable + // more logs. Info logs at or below this level will be written, while logs + // above this level will be discarded. + Verbosity int + + // RenderBuiltinsHook allows users to mutate the list of key-value pairs + // while a log line is being rendered. The kvList argument follows logr + // conventions - each pair of slice elements is comprised of a string key + // and an arbitrary value (verified and sanitized before calling this + // hook). The value returned must follow the same conventions. This hook + // can be used to audit or modify logged data. For example, you might want + // to prefix all of funcr's built-in keys with some string. This hook is + // only called for built-in (provided by funcr itself) key-value pairs. + // Equivalent hooks are offered for key-value pairs saved via + // logr.Logger.WithValues or Formatter.AddValues (see RenderValuesHook) and + // for user-provided pairs (see RenderArgsHook). + RenderBuiltinsHook func(kvList []any) []any + + // RenderValuesHook is the same as RenderBuiltinsHook, except that it is + // only called for key-value pairs saved via logr.Logger.WithValues. See + // RenderBuiltinsHook for more details. + RenderValuesHook func(kvList []any) []any + + // RenderArgsHook is the same as RenderBuiltinsHook, except that it is only + // called for key-value pairs passed directly to Info and Error. See + // RenderBuiltinsHook for more details. + RenderArgsHook func(kvList []any) []any + + // MaxLogDepth tells funcr how many levels of nested fields (e.g. a struct + // that contains a struct, etc.) it may log. Every time it finds a struct, + // slice, array, or map the depth is increased by one. When the maximum is + // reached, the value will be converted to a string indicating that the max + // depth has been exceeded. If this field is not specified, a default + // value will be used. + MaxLogDepth int +} + +// MessageClass indicates which category or categories of messages to consider. +type MessageClass int + +const ( + // None ignores all message classes. + None MessageClass = iota + // All considers all message classes. + All + // Info only considers info messages. + Info + // Error only considers error messages. + Error +) + +// fnlogger inherits some of its LogSink implementation from Formatter +// and just needs to add some glue code. +type fnlogger struct { + Formatter + write func(prefix, args string) +} + +func (l fnlogger) WithName(name string) logr.LogSink { + l.Formatter.AddName(name) + return &l +} + +func (l fnlogger) WithValues(kvList ...any) logr.LogSink { + l.Formatter.AddValues(kvList) + return &l +} + +func (l fnlogger) WithCallDepth(depth int) logr.LogSink { + l.Formatter.AddCallDepth(depth) + return &l +} + +func (l fnlogger) Info(level int, msg string, kvList ...any) { + prefix, args := l.FormatInfo(level, msg, kvList) + l.write(prefix, args) +} + +func (l fnlogger) Error(err error, msg string, kvList ...any) { + prefix, args := l.FormatError(err, msg, kvList) + l.write(prefix, args) +} + +func (l fnlogger) GetUnderlying() func(prefix, args string) { + return l.write +} + +// Assert conformance to the interfaces. +var _ logr.LogSink = &fnlogger{} +var _ logr.CallDepthLogSink = &fnlogger{} +var _ Underlier = &fnlogger{} + +// NewFormatter constructs a Formatter which emits a JSON-like key=value format. +func NewFormatter(opts Options) Formatter { + return newFormatter(opts, outputKeyValue) +} + +// NewFormatterJSON constructs a Formatter which emits strict JSON. +func NewFormatterJSON(opts Options) Formatter { + return newFormatter(opts, outputJSON) +} + +// Defaults for Options. +const defaultTimestampFormat = "2006-01-02 15:04:05.000000" +const defaultMaxLogDepth = 16 + +func newFormatter(opts Options, outfmt outputFormat) Formatter { + if opts.TimestampFormat == "" { + opts.TimestampFormat = defaultTimestampFormat + } + if opts.MaxLogDepth == 0 { + opts.MaxLogDepth = defaultMaxLogDepth + } + f := Formatter{ + outputFormat: outfmt, + prefix: "", + values: nil, + depth: 0, + opts: &opts, + } + return f +} + +// Formatter is an opaque struct which can be embedded in a LogSink +// implementation. It should be constructed with NewFormatter. Some of +// its methods directly implement logr.LogSink. +type Formatter struct { + outputFormat outputFormat + prefix string + values []any + valuesStr string + depth int + opts *Options +} + +// outputFormat indicates which outputFormat to use. +type outputFormat int + +const ( + // outputKeyValue emits a JSON-like key=value format, but not strict JSON. + outputKeyValue outputFormat = iota + // outputJSON emits strict JSON. + outputJSON +) + +// PseudoStruct is a list of key-value pairs that gets logged as a struct. +type PseudoStruct []any + +// render produces a log line, ready to use. +func (f Formatter) render(builtins, args []any) string { + // Empirically bytes.Buffer is faster than strings.Builder for this. + buf := bytes.NewBuffer(make([]byte, 0, 1024)) + if f.outputFormat == outputJSON { + buf.WriteByte('{') + } + vals := builtins + if hook := f.opts.RenderBuiltinsHook; hook != nil { + vals = hook(f.sanitize(vals)) + } + f.flatten(buf, vals, false, false) // keys are ours, no need to escape + continuing := len(builtins) > 0 + if len(f.valuesStr) > 0 { + if continuing { + if f.outputFormat == outputJSON { + buf.WriteByte(',') + } else { + buf.WriteByte(' ') + } + } + continuing = true + buf.WriteString(f.valuesStr) + } + vals = args + if hook := f.opts.RenderArgsHook; hook != nil { + vals = hook(f.sanitize(vals)) + } + f.flatten(buf, vals, continuing, true) // escape user-provided keys + if f.outputFormat == outputJSON { + buf.WriteByte('}') + } + return buf.String() +} + +// flatten renders a list of key-value pairs into a buffer. If continuing is +// true, it assumes that the buffer has previous values and will emit a +// separator (which depends on the output format) before the first pair it +// writes. If escapeKeys is true, the keys are assumed to have +// non-JSON-compatible characters in them and must be evaluated for escapes. +// +// This function returns a potentially modified version of kvList, which +// ensures that there is a value for every key (adding a value if needed) and +// that each key is a string (substituting a key if needed). +func (f Formatter) flatten(buf *bytes.Buffer, kvList []any, continuing bool, escapeKeys bool) []any { + // This logic overlaps with sanitize() but saves one type-cast per key, + // which can be measurable. + if len(kvList)%2 != 0 { + kvList = append(kvList, noValue) + } + for i := 0; i < len(kvList); i += 2 { + k, ok := kvList[i].(string) + if !ok { + k = f.nonStringKey(kvList[i]) + kvList[i] = k + } + v := kvList[i+1] + + if i > 0 || continuing { + if f.outputFormat == outputJSON { + buf.WriteByte(',') + } else { + // In theory the format could be something we don't understand. In + // practice, we control it, so it won't be. + buf.WriteByte(' ') + } + } + + if escapeKeys { + buf.WriteString(prettyString(k)) + } else { + // this is faster + buf.WriteByte('"') + buf.WriteString(k) + buf.WriteByte('"') + } + if f.outputFormat == outputJSON { + buf.WriteByte(':') + } else { + buf.WriteByte('=') + } + buf.WriteString(f.pretty(v)) + } + return kvList +} + +func (f Formatter) pretty(value any) string { + return f.prettyWithFlags(value, 0, 0) +} + +const ( + flagRawStruct = 0x1 // do not print braces on structs +) + +// TODO: This is not fast. Most of the overhead goes here. +func (f Formatter) prettyWithFlags(value any, flags uint32, depth int) string { + if depth > f.opts.MaxLogDepth { + return `""` + } + + // Handle types that take full control of logging. + if v, ok := value.(logr.Marshaler); ok { + // Replace the value with what the type wants to get logged. + // That then gets handled below via reflection. + value = invokeMarshaler(v) + } + + // Handle types that want to format themselves. + switch v := value.(type) { + case fmt.Stringer: + value = invokeStringer(v) + case error: + value = invokeError(v) + } + + // Handling the most common types without reflect is a small perf win. + switch v := value.(type) { + case bool: + return strconv.FormatBool(v) + case string: + return prettyString(v) + case int: + return strconv.FormatInt(int64(v), 10) + case int8: + return strconv.FormatInt(int64(v), 10) + case int16: + return strconv.FormatInt(int64(v), 10) + case int32: + return strconv.FormatInt(int64(v), 10) + case int64: + return strconv.FormatInt(int64(v), 10) + case uint: + return strconv.FormatUint(uint64(v), 10) + case uint8: + return strconv.FormatUint(uint64(v), 10) + case uint16: + return strconv.FormatUint(uint64(v), 10) + case uint32: + return strconv.FormatUint(uint64(v), 10) + case uint64: + return strconv.FormatUint(v, 10) + case uintptr: + return strconv.FormatUint(uint64(v), 10) + case float32: + return strconv.FormatFloat(float64(v), 'f', -1, 32) + case float64: + return strconv.FormatFloat(v, 'f', -1, 64) + case complex64: + return `"` + strconv.FormatComplex(complex128(v), 'f', -1, 64) + `"` + case complex128: + return `"` + strconv.FormatComplex(v, 'f', -1, 128) + `"` + case PseudoStruct: + buf := bytes.NewBuffer(make([]byte, 0, 1024)) + v = f.sanitize(v) + if flags&flagRawStruct == 0 { + buf.WriteByte('{') + } + for i := 0; i < len(v); i += 2 { + if i > 0 { + buf.WriteByte(',') + } + k, _ := v[i].(string) // sanitize() above means no need to check success + // arbitrary keys might need escaping + buf.WriteString(prettyString(k)) + buf.WriteByte(':') + buf.WriteString(f.prettyWithFlags(v[i+1], 0, depth+1)) + } + if flags&flagRawStruct == 0 { + buf.WriteByte('}') + } + return buf.String() + } + + buf := bytes.NewBuffer(make([]byte, 0, 256)) + t := reflect.TypeOf(value) + if t == nil { + return "null" + } + v := reflect.ValueOf(value) + switch t.Kind() { + case reflect.Bool: + return strconv.FormatBool(v.Bool()) + case reflect.String: + return prettyString(v.String()) + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return strconv.FormatInt(int64(v.Int()), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + return strconv.FormatUint(uint64(v.Uint()), 10) + case reflect.Float32: + return strconv.FormatFloat(float64(v.Float()), 'f', -1, 32) + case reflect.Float64: + return strconv.FormatFloat(v.Float(), 'f', -1, 64) + case reflect.Complex64: + return `"` + strconv.FormatComplex(complex128(v.Complex()), 'f', -1, 64) + `"` + case reflect.Complex128: + return `"` + strconv.FormatComplex(v.Complex(), 'f', -1, 128) + `"` + case reflect.Struct: + if flags&flagRawStruct == 0 { + buf.WriteByte('{') + } + printComma := false // testing i>0 is not enough because of JSON omitted fields + for i := 0; i < t.NumField(); i++ { + fld := t.Field(i) + if fld.PkgPath != "" { + // reflect says this field is only defined for non-exported fields. + continue + } + if !v.Field(i).CanInterface() { + // reflect isn't clear exactly what this means, but we can't use it. + continue + } + name := "" + omitempty := false + if tag, found := fld.Tag.Lookup("json"); found { + if tag == "-" { + continue + } + if comma := strings.Index(tag, ","); comma != -1 { + if n := tag[:comma]; n != "" { + name = n + } + rest := tag[comma:] + if strings.Contains(rest, ",omitempty,") || strings.HasSuffix(rest, ",omitempty") { + omitempty = true + } + } else { + name = tag + } + } + if omitempty && isEmpty(v.Field(i)) { + continue + } + if printComma { + buf.WriteByte(',') + } + printComma = true // if we got here, we are rendering a field + if fld.Anonymous && fld.Type.Kind() == reflect.Struct && name == "" { + buf.WriteString(f.prettyWithFlags(v.Field(i).Interface(), flags|flagRawStruct, depth+1)) + continue + } + if name == "" { + name = fld.Name + } + // field names can't contain characters which need escaping + buf.WriteByte('"') + buf.WriteString(name) + buf.WriteByte('"') + buf.WriteByte(':') + buf.WriteString(f.prettyWithFlags(v.Field(i).Interface(), 0, depth+1)) + } + if flags&flagRawStruct == 0 { + buf.WriteByte('}') + } + return buf.String() + case reflect.Slice, reflect.Array: + // If this is outputing as JSON make sure this isn't really a json.RawMessage. + // If so just emit "as-is" and don't pretty it as that will just print + // it as [X,Y,Z,...] which isn't terribly useful vs the string form you really want. + if f.outputFormat == outputJSON { + if rm, ok := value.(json.RawMessage); ok { + // If it's empty make sure we emit an empty value as the array style would below. + if len(rm) > 0 { + buf.Write(rm) + } else { + buf.WriteString("null") + } + return buf.String() + } + } + buf.WriteByte('[') + for i := 0; i < v.Len(); i++ { + if i > 0 { + buf.WriteByte(',') + } + e := v.Index(i) + buf.WriteString(f.prettyWithFlags(e.Interface(), 0, depth+1)) + } + buf.WriteByte(']') + return buf.String() + case reflect.Map: + buf.WriteByte('{') + // This does not sort the map keys, for best perf. + it := v.MapRange() + i := 0 + for it.Next() { + if i > 0 { + buf.WriteByte(',') + } + // If a map key supports TextMarshaler, use it. + keystr := "" + if m, ok := it.Key().Interface().(encoding.TextMarshaler); ok { + txt, err := m.MarshalText() + if err != nil { + keystr = fmt.Sprintf("", err.Error()) + } else { + keystr = string(txt) + } + keystr = prettyString(keystr) + } else { + // prettyWithFlags will produce already-escaped values + keystr = f.prettyWithFlags(it.Key().Interface(), 0, depth+1) + if t.Key().Kind() != reflect.String { + // JSON only does string keys. Unlike Go's standard JSON, we'll + // convert just about anything to a string. + keystr = prettyString(keystr) + } + } + buf.WriteString(keystr) + buf.WriteByte(':') + buf.WriteString(f.prettyWithFlags(it.Value().Interface(), 0, depth+1)) + i++ + } + buf.WriteByte('}') + return buf.String() + case reflect.Ptr, reflect.Interface: + if v.IsNil() { + return "null" + } + return f.prettyWithFlags(v.Elem().Interface(), 0, depth) + } + return fmt.Sprintf(`""`, t.Kind().String()) +} + +func prettyString(s string) string { + // Avoid escaping (which does allocations) if we can. + if needsEscape(s) { + return strconv.Quote(s) + } + b := bytes.NewBuffer(make([]byte, 0, 1024)) + b.WriteByte('"') + b.WriteString(s) + b.WriteByte('"') + return b.String() +} + +// needsEscape determines whether the input string needs to be escaped or not, +// without doing any allocations. +func needsEscape(s string) bool { + for _, r := range s { + if !strconv.IsPrint(r) || r == '\\' || r == '"' { + return true + } + } + return false +} + +func isEmpty(v reflect.Value) bool { + switch v.Kind() { + case reflect.Array, reflect.Map, reflect.Slice, reflect.String: + return v.Len() == 0 + case reflect.Bool: + return !v.Bool() + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return v.Int() == 0 + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + return v.Uint() == 0 + case reflect.Float32, reflect.Float64: + return v.Float() == 0 + case reflect.Complex64, reflect.Complex128: + return v.Complex() == 0 + case reflect.Interface, reflect.Ptr: + return v.IsNil() + } + return false +} + +func invokeMarshaler(m logr.Marshaler) (ret any) { + defer func() { + if r := recover(); r != nil { + ret = fmt.Sprintf("", r) + } + }() + return m.MarshalLog() +} + +func invokeStringer(s fmt.Stringer) (ret string) { + defer func() { + if r := recover(); r != nil { + ret = fmt.Sprintf("", r) + } + }() + return s.String() +} + +func invokeError(e error) (ret string) { + defer func() { + if r := recover(); r != nil { + ret = fmt.Sprintf("", r) + } + }() + return e.Error() +} + +// Caller represents the original call site for a log line, after considering +// logr.Logger.WithCallDepth and logr.Logger.WithCallStackHelper. The File and +// Line fields will always be provided, while the Func field is optional. +// Users can set the render hook fields in Options to examine logged key-value +// pairs, one of which will be {"caller", Caller} if the Options.LogCaller +// field is enabled for the given MessageClass. +type Caller struct { + // File is the basename of the file for this call site. + File string `json:"file"` + // Line is the line number in the file for this call site. + Line int `json:"line"` + // Func is the function name for this call site, or empty if + // Options.LogCallerFunc is not enabled. + Func string `json:"function,omitempty"` +} + +func (f Formatter) caller() Caller { + // +1 for this frame, +1 for Info/Error. + pc, file, line, ok := runtime.Caller(f.depth + 2) + if !ok { + return Caller{"", 0, ""} + } + fn := "" + if f.opts.LogCallerFunc { + if fp := runtime.FuncForPC(pc); fp != nil { + fn = fp.Name() + } + } + + return Caller{filepath.Base(file), line, fn} +} + +const noValue = "" + +func (f Formatter) nonStringKey(v any) string { + return fmt.Sprintf("", f.snippet(v)) +} + +// snippet produces a short snippet string of an arbitrary value. +func (f Formatter) snippet(v any) string { + const snipLen = 16 + + snip := f.pretty(v) + if len(snip) > snipLen { + snip = snip[:snipLen] + } + return snip +} + +// sanitize ensures that a list of key-value pairs has a value for every key +// (adding a value if needed) and that each key is a string (substituting a key +// if needed). +func (f Formatter) sanitize(kvList []any) []any { + if len(kvList)%2 != 0 { + kvList = append(kvList, noValue) + } + for i := 0; i < len(kvList); i += 2 { + _, ok := kvList[i].(string) + if !ok { + kvList[i] = f.nonStringKey(kvList[i]) + } + } + return kvList +} + +// Init configures this Formatter from runtime info, such as the call depth +// imposed by logr itself. +// Note that this receiver is a pointer, so depth can be saved. +func (f *Formatter) Init(info logr.RuntimeInfo) { + f.depth += info.CallDepth +} + +// Enabled checks whether an info message at the given level should be logged. +func (f Formatter) Enabled(level int) bool { + return level <= f.opts.Verbosity +} + +// GetDepth returns the current depth of this Formatter. This is useful for +// implementations which do their own caller attribution. +func (f Formatter) GetDepth() int { + return f.depth +} + +// FormatInfo renders an Info log message into strings. The prefix will be +// empty when no names were set (via AddNames), or when the output is +// configured for JSON. +func (f Formatter) FormatInfo(level int, msg string, kvList []any) (prefix, argsStr string) { + args := make([]any, 0, 64) // using a constant here impacts perf + prefix = f.prefix + if f.outputFormat == outputJSON { + args = append(args, "logger", prefix) + prefix = "" + } + if f.opts.LogTimestamp { + args = append(args, "ts", time.Now().Format(f.opts.TimestampFormat)) + } + if policy := f.opts.LogCaller; policy == All || policy == Info { + args = append(args, "caller", f.caller()) + } + args = append(args, "level", level, "msg", msg) + return prefix, f.render(args, kvList) +} + +// FormatError renders an Error log message into strings. The prefix will be +// empty when no names were set (via AddNames), or when the output is +// configured for JSON. +func (f Formatter) FormatError(err error, msg string, kvList []any) (prefix, argsStr string) { + args := make([]any, 0, 64) // using a constant here impacts perf + prefix = f.prefix + if f.outputFormat == outputJSON { + args = append(args, "logger", prefix) + prefix = "" + } + if f.opts.LogTimestamp { + args = append(args, "ts", time.Now().Format(f.opts.TimestampFormat)) + } + if policy := f.opts.LogCaller; policy == All || policy == Error { + args = append(args, "caller", f.caller()) + } + args = append(args, "msg", msg) + var loggableErr any + if err != nil { + loggableErr = err.Error() + } + args = append(args, "error", loggableErr) + return prefix, f.render(args, kvList) +} + +// AddName appends the specified name. funcr uses '/' characters to separate +// name elements. Callers should not pass '/' in the provided name string, but +// this library does not actually enforce that. +func (f *Formatter) AddName(name string) { + if len(f.prefix) > 0 { + f.prefix += "/" + } + f.prefix += name +} + +// AddValues adds key-value pairs to the set of saved values to be logged with +// each log line. +func (f *Formatter) AddValues(kvList []any) { + // Three slice args forces a copy. + n := len(f.values) + f.values = append(f.values[:n:n], kvList...) + + vals := f.values + if hook := f.opts.RenderValuesHook; hook != nil { + vals = hook(f.sanitize(vals)) + } + + // Pre-render values, so we don't have to do it on each Info/Error call. + buf := bytes.NewBuffer(make([]byte, 0, 1024)) + f.flatten(buf, vals, false, true) // escape user-provided keys + f.valuesStr = buf.String() +} + +// AddCallDepth increases the number of stack-frames to skip when attributing +// the log line to a file and line. +func (f *Formatter) AddCallDepth(depth int) { + f.depth += depth +} diff --git a/vendor/github.com/go-logr/logr/logr.go b/vendor/github.com/go-logr/logr/logr.go new file mode 100644 index 000000000..2a5075a18 --- /dev/null +++ b/vendor/github.com/go-logr/logr/logr.go @@ -0,0 +1,563 @@ +/* +Copyright 2019 The logr Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// This design derives from Dave Cheney's blog: +// http://dave.cheney.net/2015/11/05/lets-talk-about-logging + +// Package logr defines a general-purpose logging API and abstract interfaces +// to back that API. Packages in the Go ecosystem can depend on this package, +// while callers can implement logging with whatever backend is appropriate. +// +// # Usage +// +// Logging is done using a Logger instance. Logger is a concrete type with +// methods, which defers the actual logging to a LogSink interface. The main +// methods of Logger are Info() and Error(). Arguments to Info() and Error() +// are key/value pairs rather than printf-style formatted strings, emphasizing +// "structured logging". +// +// With Go's standard log package, we might write: +// +// log.Printf("setting target value %s", targetValue) +// +// With logr's structured logging, we'd write: +// +// logger.Info("setting target", "value", targetValue) +// +// Errors are much the same. Instead of: +// +// log.Printf("failed to open the pod bay door for user %s: %v", user, err) +// +// We'd write: +// +// logger.Error(err, "failed to open the pod bay door", "user", user) +// +// Info() and Error() are very similar, but they are separate methods so that +// LogSink implementations can choose to do things like attach additional +// information (such as stack traces) on calls to Error(). Error() messages are +// always logged, regardless of the current verbosity. If there is no error +// instance available, passing nil is valid. +// +// # Verbosity +// +// Often we want to log information only when the application in "verbose +// mode". To write log lines that are more verbose, Logger has a V() method. +// The higher the V-level of a log line, the less critical it is considered. +// Log-lines with V-levels that are not enabled (as per the LogSink) will not +// be written. Level V(0) is the default, and logger.V(0).Info() has the same +// meaning as logger.Info(). Negative V-levels have the same meaning as V(0). +// Error messages do not have a verbosity level and are always logged. +// +// Where we might have written: +// +// if flVerbose >= 2 { +// log.Printf("an unusual thing happened") +// } +// +// We can write: +// +// logger.V(2).Info("an unusual thing happened") +// +// # Logger Names +// +// Logger instances can have name strings so that all messages logged through +// that instance have additional context. For example, you might want to add +// a subsystem name: +// +// logger.WithName("compactor").Info("started", "time", time.Now()) +// +// The WithName() method returns a new Logger, which can be passed to +// constructors or other functions for further use. Repeated use of WithName() +// will accumulate name "segments". These name segments will be joined in some +// way by the LogSink implementation. It is strongly recommended that name +// segments contain simple identifiers (letters, digits, and hyphen), and do +// not contain characters that could muddle the log output or confuse the +// joining operation (e.g. whitespace, commas, periods, slashes, brackets, +// quotes, etc). +// +// # Saved Values +// +// Logger instances can store any number of key/value pairs, which will be +// logged alongside all messages logged through that instance. For example, +// you might want to create a Logger instance per managed object: +// +// With the standard log package, we might write: +// +// log.Printf("decided to set field foo to value %q for object %s/%s", +// targetValue, object.Namespace, object.Name) +// +// With logr we'd write: +// +// // Elsewhere: set up the logger to log the object name. +// obj.logger = mainLogger.WithValues( +// "name", obj.name, "namespace", obj.namespace) +// +// // later on... +// obj.logger.Info("setting foo", "value", targetValue) +// +// # Best Practices +// +// Logger has very few hard rules, with the goal that LogSink implementations +// might have a lot of freedom to differentiate. There are, however, some +// things to consider. +// +// The log message consists of a constant message attached to the log line. +// This should generally be a simple description of what's occurring, and should +// never be a format string. Variable information can then be attached using +// named values. +// +// Keys are arbitrary strings, but should generally be constant values. Values +// may be any Go value, but how the value is formatted is determined by the +// LogSink implementation. +// +// Logger instances are meant to be passed around by value. Code that receives +// such a value can call its methods without having to check whether the +// instance is ready for use. +// +// The zero logger (= Logger{}) is identical to Discard() and discards all log +// entries. Code that receives a Logger by value can simply call it, the methods +// will never crash. For cases where passing a logger is optional, a pointer to Logger +// should be used. +// +// # Key Naming Conventions +// +// Keys are not strictly required to conform to any specification or regex, but +// it is recommended that they: +// - be human-readable and meaningful (not auto-generated or simple ordinals) +// - be constant (not dependent on input data) +// - contain only printable characters +// - not contain whitespace or punctuation +// - use lower case for simple keys and lowerCamelCase for more complex ones +// +// These guidelines help ensure that log data is processed properly regardless +// of the log implementation. For example, log implementations will try to +// output JSON data or will store data for later database (e.g. SQL) queries. +// +// While users are generally free to use key names of their choice, it's +// generally best to avoid using the following keys, as they're frequently used +// by implementations: +// - "caller": the calling information (file/line) of a particular log line +// - "error": the underlying error value in the `Error` method +// - "level": the log level +// - "logger": the name of the associated logger +// - "msg": the log message +// - "stacktrace": the stack trace associated with a particular log line or +// error (often from the `Error` message) +// - "ts": the timestamp for a log line +// +// Implementations are encouraged to make use of these keys to represent the +// above concepts, when necessary (for example, in a pure-JSON output form, it +// would be necessary to represent at least message and timestamp as ordinary +// named values). +// +// # Break Glass +// +// Implementations may choose to give callers access to the underlying +// logging implementation. The recommended pattern for this is: +// +// // Underlier exposes access to the underlying logging implementation. +// // Since callers only have a logr.Logger, they have to know which +// // implementation is in use, so this interface is less of an abstraction +// // and more of way to test type conversion. +// type Underlier interface { +// GetUnderlying() +// } +// +// Logger grants access to the sink to enable type assertions like this: +// +// func DoSomethingWithImpl(log logr.Logger) { +// if underlier, ok := log.GetSink().(impl.Underlier); ok { +// implLogger := underlier.GetUnderlying() +// ... +// } +// } +// +// Custom `With*` functions can be implemented by copying the complete +// Logger struct and replacing the sink in the copy: +// +// // WithFooBar changes the foobar parameter in the log sink and returns a +// // new logger with that modified sink. It does nothing for loggers where +// // the sink doesn't support that parameter. +// func WithFoobar(log logr.Logger, foobar int) logr.Logger { +// if foobarLogSink, ok := log.GetSink().(FoobarSink); ok { +// log = log.WithSink(foobarLogSink.WithFooBar(foobar)) +// } +// return log +// } +// +// Don't use New to construct a new Logger with a LogSink retrieved from an +// existing Logger. Source code attribution might not work correctly and +// unexported fields in Logger get lost. +// +// Beware that the same LogSink instance may be shared by different logger +// instances. Calling functions that modify the LogSink will affect all of +// those. +package logr + +import ( + "context" +) + +// New returns a new Logger instance. This is primarily used by libraries +// implementing LogSink, rather than end users. Passing a nil sink will create +// a Logger which discards all log lines. +func New(sink LogSink) Logger { + logger := Logger{} + logger.setSink(sink) + if sink != nil { + sink.Init(runtimeInfo) + } + return logger +} + +// setSink stores the sink and updates any related fields. It mutates the +// logger and thus is only safe to use for loggers that are not currently being +// used concurrently. +func (l *Logger) setSink(sink LogSink) { + l.sink = sink +} + +// GetSink returns the stored sink. +func (l Logger) GetSink() LogSink { + return l.sink +} + +// WithSink returns a copy of the logger with the new sink. +func (l Logger) WithSink(sink LogSink) Logger { + l.setSink(sink) + return l +} + +// Logger is an interface to an abstract logging implementation. This is a +// concrete type for performance reasons, but all the real work is passed on to +// a LogSink. Implementations of LogSink should provide their own constructors +// that return Logger, not LogSink. +// +// The underlying sink can be accessed through GetSink and be modified through +// WithSink. This enables the implementation of custom extensions (see "Break +// Glass" in the package documentation). Normally the sink should be used only +// indirectly. +type Logger struct { + sink LogSink + level int +} + +// Enabled tests whether this Logger is enabled. For example, commandline +// flags might be used to set the logging verbosity and disable some info logs. +func (l Logger) Enabled() bool { + // Some implementations of LogSink look at the caller in Enabled (e.g. + // different verbosity levels per package or file), but we only pass one + // CallDepth in (via Init). This means that all calls from Logger to the + // LogSink's Enabled, Info, and Error methods must have the same number of + // frames. In other words, Logger methods can't call other Logger methods + // which call these LogSink methods unless we do it the same in all paths. + return l.sink != nil && l.sink.Enabled(l.level) +} + +// Info logs a non-error message with the given key/value pairs as context. +// +// The msg argument should be used to add some constant description to the log +// line. The key/value pairs can then be used to add additional variable +// information. The key/value pairs must alternate string keys and arbitrary +// values. +func (l Logger) Info(msg string, keysAndValues ...any) { + if l.sink == nil { + return + } + if l.sink.Enabled(l.level) { // see comment in Enabled + if withHelper, ok := l.sink.(CallStackHelperLogSink); ok { + withHelper.GetCallStackHelper()() + } + l.sink.Info(l.level, msg, keysAndValues...) + } +} + +// Error logs an error, with the given message and key/value pairs as context. +// It functions similarly to Info, but may have unique behavior, and should be +// preferred for logging errors (see the package documentations for more +// information). The log message will always be emitted, regardless of +// verbosity level. +// +// The msg argument should be used to add context to any underlying error, +// while the err argument should be used to attach the actual error that +// triggered this log line, if present. The err parameter is optional +// and nil may be passed instead of an error instance. +func (l Logger) Error(err error, msg string, keysAndValues ...any) { + if l.sink == nil { + return + } + if withHelper, ok := l.sink.(CallStackHelperLogSink); ok { + withHelper.GetCallStackHelper()() + } + l.sink.Error(err, msg, keysAndValues...) +} + +// V returns a new Logger instance for a specific verbosity level, relative to +// this Logger. In other words, V-levels are additive. A higher verbosity +// level means a log message is less important. Negative V-levels are treated +// as 0. +func (l Logger) V(level int) Logger { + if l.sink == nil { + return l + } + if level < 0 { + level = 0 + } + l.level += level + return l +} + +// GetV returns the verbosity level of the logger. If the logger's LogSink is +// nil as in the Discard logger, this will always return 0. +func (l Logger) GetV() int { + // 0 if l.sink nil because of the if check in V above. + return l.level +} + +// WithValues returns a new Logger instance with additional key/value pairs. +// See Info for documentation on how key/value pairs work. +func (l Logger) WithValues(keysAndValues ...any) Logger { + if l.sink == nil { + return l + } + l.setSink(l.sink.WithValues(keysAndValues...)) + return l +} + +// WithName returns a new Logger instance with the specified name element added +// to the Logger's name. Successive calls with WithName append additional +// suffixes to the Logger's name. It's strongly recommended that name segments +// contain only letters, digits, and hyphens (see the package documentation for +// more information). +func (l Logger) WithName(name string) Logger { + if l.sink == nil { + return l + } + l.setSink(l.sink.WithName(name)) + return l +} + +// WithCallDepth returns a Logger instance that offsets the call stack by the +// specified number of frames when logging call site information, if possible. +// This is useful for users who have helper functions between the "real" call +// site and the actual calls to Logger methods. If depth is 0 the attribution +// should be to the direct caller of this function. If depth is 1 the +// attribution should skip 1 call frame, and so on. Successive calls to this +// are additive. +// +// If the underlying log implementation supports a WithCallDepth(int) method, +// it will be called and the result returned. If the implementation does not +// support CallDepthLogSink, the original Logger will be returned. +// +// To skip one level, WithCallStackHelper() should be used instead of +// WithCallDepth(1) because it works with implementions that support the +// CallDepthLogSink and/or CallStackHelperLogSink interfaces. +func (l Logger) WithCallDepth(depth int) Logger { + if l.sink == nil { + return l + } + if withCallDepth, ok := l.sink.(CallDepthLogSink); ok { + l.setSink(withCallDepth.WithCallDepth(depth)) + } + return l +} + +// WithCallStackHelper returns a new Logger instance that skips the direct +// caller when logging call site information, if possible. This is useful for +// users who have helper functions between the "real" call site and the actual +// calls to Logger methods and want to support loggers which depend on marking +// each individual helper function, like loggers based on testing.T. +// +// In addition to using that new logger instance, callers also must call the +// returned function. +// +// If the underlying log implementation supports a WithCallDepth(int) method, +// WithCallDepth(1) will be called to produce a new logger. If it supports a +// WithCallStackHelper() method, that will be also called. If the +// implementation does not support either of these, the original Logger will be +// returned. +func (l Logger) WithCallStackHelper() (func(), Logger) { + if l.sink == nil { + return func() {}, l + } + var helper func() + if withCallDepth, ok := l.sink.(CallDepthLogSink); ok { + l.setSink(withCallDepth.WithCallDepth(1)) + } + if withHelper, ok := l.sink.(CallStackHelperLogSink); ok { + helper = withHelper.GetCallStackHelper() + } else { + helper = func() {} + } + return helper, l +} + +// IsZero returns true if this logger is an uninitialized zero value +func (l Logger) IsZero() bool { + return l.sink == nil +} + +// contextKey is how we find Loggers in a context.Context. +type contextKey struct{} + +// FromContext returns a Logger from ctx or an error if no Logger is found. +func FromContext(ctx context.Context) (Logger, error) { + if v, ok := ctx.Value(contextKey{}).(Logger); ok { + return v, nil + } + + return Logger{}, notFoundError{} +} + +// notFoundError exists to carry an IsNotFound method. +type notFoundError struct{} + +func (notFoundError) Error() string { + return "no logr.Logger was present" +} + +func (notFoundError) IsNotFound() bool { + return true +} + +// FromContextOrDiscard returns a Logger from ctx. If no Logger is found, this +// returns a Logger that discards all log messages. +func FromContextOrDiscard(ctx context.Context) Logger { + if v, ok := ctx.Value(contextKey{}).(Logger); ok { + return v + } + + return Discard() +} + +// NewContext returns a new Context, derived from ctx, which carries the +// provided Logger. +func NewContext(ctx context.Context, logger Logger) context.Context { + return context.WithValue(ctx, contextKey{}, logger) +} + +// RuntimeInfo holds information that the logr "core" library knows which +// LogSinks might want to know. +type RuntimeInfo struct { + // CallDepth is the number of call frames the logr library adds between the + // end-user and the LogSink. LogSink implementations which choose to print + // the original logging site (e.g. file & line) should climb this many + // additional frames to find it. + CallDepth int +} + +// runtimeInfo is a static global. It must not be changed at run time. +var runtimeInfo = RuntimeInfo{ + CallDepth: 1, +} + +// LogSink represents a logging implementation. End-users will generally not +// interact with this type. +type LogSink interface { + // Init receives optional information about the logr library for LogSink + // implementations that need it. + Init(info RuntimeInfo) + + // Enabled tests whether this LogSink is enabled at the specified V-level. + // For example, commandline flags might be used to set the logging + // verbosity and disable some info logs. + Enabled(level int) bool + + // Info logs a non-error message with the given key/value pairs as context. + // The level argument is provided for optional logging. This method will + // only be called when Enabled(level) is true. See Logger.Info for more + // details. + Info(level int, msg string, keysAndValues ...any) + + // Error logs an error, with the given message and key/value pairs as + // context. See Logger.Error for more details. + Error(err error, msg string, keysAndValues ...any) + + // WithValues returns a new LogSink with additional key/value pairs. See + // Logger.WithValues for more details. + WithValues(keysAndValues ...any) LogSink + + // WithName returns a new LogSink with the specified name appended. See + // Logger.WithName for more details. + WithName(name string) LogSink +} + +// CallDepthLogSink represents a LogSink that knows how to climb the call stack +// to identify the original call site and can offset the depth by a specified +// number of frames. This is useful for users who have helper functions +// between the "real" call site and the actual calls to Logger methods. +// Implementations that log information about the call site (such as file, +// function, or line) would otherwise log information about the intermediate +// helper functions. +// +// This is an optional interface and implementations are not required to +// support it. +type CallDepthLogSink interface { + // WithCallDepth returns a LogSink that will offset the call + // stack by the specified number of frames when logging call + // site information. + // + // If depth is 0, the LogSink should skip exactly the number + // of call frames defined in RuntimeInfo.CallDepth when Info + // or Error are called, i.e. the attribution should be to the + // direct caller of Logger.Info or Logger.Error. + // + // If depth is 1 the attribution should skip 1 call frame, and so on. + // Successive calls to this are additive. + WithCallDepth(depth int) LogSink +} + +// CallStackHelperLogSink represents a LogSink that knows how to climb +// the call stack to identify the original call site and can skip +// intermediate helper functions if they mark themselves as +// helper. Go's testing package uses that approach. +// +// This is useful for users who have helper functions between the +// "real" call site and the actual calls to Logger methods. +// Implementations that log information about the call site (such as +// file, function, or line) would otherwise log information about the +// intermediate helper functions. +// +// This is an optional interface and implementations are not required +// to support it. Implementations that choose to support this must not +// simply implement it as WithCallDepth(1), because +// Logger.WithCallStackHelper will call both methods if they are +// present. This should only be implemented for LogSinks that actually +// need it, as with testing.T. +type CallStackHelperLogSink interface { + // GetCallStackHelper returns a function that must be called + // to mark the direct caller as helper function when logging + // call site information. + GetCallStackHelper() func() +} + +// Marshaler is an optional interface that logged values may choose to +// implement. Loggers with structured output, such as JSON, should +// log the object return by the MarshalLog method instead of the +// original value. +type Marshaler interface { + // MarshalLog can be used to: + // - ensure that structs are not logged as strings when the original + // value has a String method: return a different type without a + // String method + // - select which fields of a complex type should get logged: + // return a simpler struct with fewer fields + // - log unexported fields: return a different struct + // with exported fields + // + // It may return any value of any type. + MarshalLog() any +} diff --git a/vendor/github.com/go-logr/stdr/LICENSE b/vendor/github.com/go-logr/stdr/LICENSE new file mode 100644 index 000000000..261eeb9e9 --- /dev/null +++ b/vendor/github.com/go-logr/stdr/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/go-logr/stdr/README.md b/vendor/github.com/go-logr/stdr/README.md new file mode 100644 index 000000000..515866789 --- /dev/null +++ b/vendor/github.com/go-logr/stdr/README.md @@ -0,0 +1,6 @@ +# Minimal Go logging using logr and Go's standard library + +[![Go Reference](https://pkg.go.dev/badge/github.com/go-logr/stdr.svg)](https://pkg.go.dev/github.com/go-logr/stdr) + +This package implements the [logr interface](https://github.com/go-logr/logr) +in terms of Go's standard log package(https://pkg.go.dev/log). diff --git a/vendor/github.com/go-logr/stdr/stdr.go b/vendor/github.com/go-logr/stdr/stdr.go new file mode 100644 index 000000000..93a8aab51 --- /dev/null +++ b/vendor/github.com/go-logr/stdr/stdr.go @@ -0,0 +1,170 @@ +/* +Copyright 2019 The logr Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package stdr implements github.com/go-logr/logr.Logger in terms of +// Go's standard log package. +package stdr + +import ( + "log" + "os" + + "github.com/go-logr/logr" + "github.com/go-logr/logr/funcr" +) + +// The global verbosity level. See SetVerbosity(). +var globalVerbosity int + +// SetVerbosity sets the global level against which all info logs will be +// compared. If this is greater than or equal to the "V" of the logger, the +// message will be logged. A higher value here means more logs will be written. +// The previous verbosity value is returned. This is not concurrent-safe - +// callers must be sure to call it from only one goroutine. +func SetVerbosity(v int) int { + old := globalVerbosity + globalVerbosity = v + return old +} + +// New returns a logr.Logger which is implemented by Go's standard log package, +// or something like it. If std is nil, this will use a default logger +// instead. +// +// Example: stdr.New(log.New(os.Stderr, "", log.LstdFlags|log.Lshortfile))) +func New(std StdLogger) logr.Logger { + return NewWithOptions(std, Options{}) +} + +// NewWithOptions returns a logr.Logger which is implemented by Go's standard +// log package, or something like it. See New for details. +func NewWithOptions(std StdLogger, opts Options) logr.Logger { + if std == nil { + // Go's log.Default() is only available in 1.16 and higher. + std = log.New(os.Stderr, "", log.LstdFlags) + } + + if opts.Depth < 0 { + opts.Depth = 0 + } + + fopts := funcr.Options{ + LogCaller: funcr.MessageClass(opts.LogCaller), + } + + sl := &logger{ + Formatter: funcr.NewFormatter(fopts), + std: std, + } + + // For skipping our own logger.Info/Error. + sl.Formatter.AddCallDepth(1 + opts.Depth) + + return logr.New(sl) +} + +// Options carries parameters which influence the way logs are generated. +type Options struct { + // Depth biases the assumed number of call frames to the "true" caller. + // This is useful when the calling code calls a function which then calls + // stdr (e.g. a logging shim to another API). Values less than zero will + // be treated as zero. + Depth int + + // LogCaller tells stdr to add a "caller" key to some or all log lines. + // Go's log package has options to log this natively, too. + LogCaller MessageClass + + // TODO: add an option to log the date/time +} + +// MessageClass indicates which category or categories of messages to consider. +type MessageClass int + +const ( + // None ignores all message classes. + None MessageClass = iota + // All considers all message classes. + All + // Info only considers info messages. + Info + // Error only considers error messages. + Error +) + +// StdLogger is the subset of the Go stdlib log.Logger API that is needed for +// this adapter. +type StdLogger interface { + // Output is the same as log.Output and log.Logger.Output. + Output(calldepth int, logline string) error +} + +type logger struct { + funcr.Formatter + std StdLogger +} + +var _ logr.LogSink = &logger{} +var _ logr.CallDepthLogSink = &logger{} + +func (l logger) Enabled(level int) bool { + return globalVerbosity >= level +} + +func (l logger) Info(level int, msg string, kvList ...interface{}) { + prefix, args := l.FormatInfo(level, msg, kvList) + if prefix != "" { + args = prefix + ": " + args + } + _ = l.std.Output(l.Formatter.GetDepth()+1, args) +} + +func (l logger) Error(err error, msg string, kvList ...interface{}) { + prefix, args := l.FormatError(err, msg, kvList) + if prefix != "" { + args = prefix + ": " + args + } + _ = l.std.Output(l.Formatter.GetDepth()+1, args) +} + +func (l logger) WithName(name string) logr.LogSink { + l.Formatter.AddName(name) + return &l +} + +func (l logger) WithValues(kvList ...interface{}) logr.LogSink { + l.Formatter.AddValues(kvList) + return &l +} + +func (l logger) WithCallDepth(depth int) logr.LogSink { + l.Formatter.AddCallDepth(depth) + return &l +} + +// Underlier exposes access to the underlying logging implementation. Since +// callers only have a logr.Logger, they have to know which implementation is +// in use, so this interface is less of an abstraction and more of way to test +// type conversion. +type Underlier interface { + GetUnderlying() StdLogger +} + +// GetUnderlying returns the StdLogger underneath this logger. Since StdLogger +// is itself an interface, the result may or may not be a Go log.Logger. +func (l logger) GetUnderlying() StdLogger { + return l.std +} diff --git a/vendor/github.com/google/uuid/CHANGELOG.md b/vendor/github.com/google/uuid/CHANGELOG.md index c9fb829dc..7ec5ac7ea 100644 --- a/vendor/github.com/google/uuid/CHANGELOG.md +++ b/vendor/github.com/google/uuid/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [1.6.0](https://github.com/google/uuid/compare/v1.5.0...v1.6.0) (2024-01-16) + + +### Features + +* add Max UUID constant ([#149](https://github.com/google/uuid/issues/149)) ([c58770e](https://github.com/google/uuid/commit/c58770eb495f55fe2ced6284f93c5158a62e53e3)) + + +### Bug Fixes + +* fix typo in version 7 uuid documentation ([#153](https://github.com/google/uuid/issues/153)) ([016b199](https://github.com/google/uuid/commit/016b199544692f745ffc8867b914129ecb47ef06)) +* Monotonicity in UUIDv7 ([#150](https://github.com/google/uuid/issues/150)) ([a2b2b32](https://github.com/google/uuid/commit/a2b2b32373ff0b1a312b7fdf6d38a977099698a6)) + ## [1.5.0](https://github.com/google/uuid/compare/v1.4.0...v1.5.0) (2023-12-12) diff --git a/vendor/github.com/google/uuid/hash.go b/vendor/github.com/google/uuid/hash.go index b404f4bec..dc60082d3 100644 --- a/vendor/github.com/google/uuid/hash.go +++ b/vendor/github.com/google/uuid/hash.go @@ -17,6 +17,12 @@ var ( NameSpaceOID = Must(Parse("6ba7b812-9dad-11d1-80b4-00c04fd430c8")) NameSpaceX500 = Must(Parse("6ba7b814-9dad-11d1-80b4-00c04fd430c8")) Nil UUID // empty UUID, all zeros + + // The Max UUID is special form of UUID that is specified to have all 128 bits set to 1. + Max = UUID{ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + } ) // NewHash returns a new UUID derived from the hash of space concatenated with diff --git a/vendor/github.com/google/uuid/version7.go b/vendor/github.com/google/uuid/version7.go index ba9dd5eb6..3167b643d 100644 --- a/vendor/github.com/google/uuid/version7.go +++ b/vendor/github.com/google/uuid/version7.go @@ -44,7 +44,7 @@ func NewV7FromReader(r io.Reader) (UUID, error) { // makeV7 fill 48 bits time (uuid[0] - uuid[5]), set version b0111 (uuid[6]) // uuid[8] already has the right version number (Variant is 10) -// see function NewV7 and NewV7FromReader +// see function NewV7 and NewV7FromReader func makeV7(uuid []byte) { /* 0 1 2 3 @@ -52,7 +52,7 @@ func makeV7(uuid []byte) { +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | unix_ts_ms | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | unix_ts_ms | ver | rand_a | + | unix_ts_ms | ver | rand_a (12 bit seq) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |var| rand_b | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ @@ -61,7 +61,7 @@ func makeV7(uuid []byte) { */ _ = uuid[15] // bounds check - t := timeNow().UnixMilli() + t, s := getV7Time() uuid[0] = byte(t >> 40) uuid[1] = byte(t >> 32) @@ -70,6 +70,35 @@ func makeV7(uuid []byte) { uuid[4] = byte(t >> 8) uuid[5] = byte(t) - uuid[6] = 0x70 | (uuid[6] & 0x0F) - // uuid[8] has already has right version + uuid[6] = 0x70 | (0x0F & byte(s>>8)) + uuid[7] = byte(s) +} + +// lastV7time is the last time we returned stored as: +// +// 52 bits of time in milliseconds since epoch +// 12 bits of (fractional nanoseconds) >> 8 +var lastV7time int64 + +const nanoPerMilli = 1000000 + +// getV7Time returns the time in milliseconds and nanoseconds / 256. +// The returned (milli << 12 + seq) is guarenteed to be greater than +// (milli << 12 + seq) returned by any previous call to getV7Time. +func getV7Time() (milli, seq int64) { + timeMu.Lock() + defer timeMu.Unlock() + + nano := timeNow().UnixNano() + milli = nano / nanoPerMilli + // Sequence number is between 0 and 3906 (nanoPerMilli>>8) + seq = (nano - milli*nanoPerMilli) >> 8 + now := milli<<12 + seq + if now <= lastV7time { + now = lastV7time + 1 + milli = now >> 12 + seq = now & 0xfff + } + lastV7time = now + return milli, seq } diff --git a/vendor/go.opentelemetry.io/otel/.codespellignore b/vendor/go.opentelemetry.io/otel/.codespellignore new file mode 100644 index 000000000..ae6a3bcf1 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/.codespellignore @@ -0,0 +1,5 @@ +ot +fo +te +collison +consequentially diff --git a/vendor/go.opentelemetry.io/otel/.codespellrc b/vendor/go.opentelemetry.io/otel/.codespellrc new file mode 100644 index 000000000..4afbb1fb3 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/.codespellrc @@ -0,0 +1,10 @@ +# https://github.com/codespell-project/codespell +[codespell] +builtin = clear,rare,informal +check-filenames = +check-hidden = +ignore-words = .codespellignore +interactive = 1 +skip = .git,go.mod,go.sum,semconv,venv,.tools +uri-ignore-words-list = * +write = diff --git a/vendor/go.opentelemetry.io/otel/.gitattributes b/vendor/go.opentelemetry.io/otel/.gitattributes new file mode 100644 index 000000000..314766e91 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/.gitattributes @@ -0,0 +1,3 @@ +* text=auto eol=lf +*.{cmd,[cC][mM][dD]} text eol=crlf +*.{bat,[bB][aA][tT]} text eol=crlf diff --git a/vendor/go.opentelemetry.io/otel/.gitignore b/vendor/go.opentelemetry.io/otel/.gitignore new file mode 100644 index 000000000..895c7664b --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/.gitignore @@ -0,0 +1,22 @@ +.DS_Store +Thumbs.db + +.tools/ +venv/ +.idea/ +.vscode/ +*.iml +*.so +coverage.* +go.work +go.work.sum + +gen/ + +/example/dice/dice +/example/namedtracer/namedtracer +/example/otel-collector/otel-collector +/example/opencensus/opencensus +/example/passthrough/passthrough +/example/prometheus/prometheus +/example/zipkin/zipkin diff --git a/vendor/go.opentelemetry.io/otel/.gitmodules b/vendor/go.opentelemetry.io/otel/.gitmodules new file mode 100644 index 000000000..38a1f5698 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/.gitmodules @@ -0,0 +1,3 @@ +[submodule "opentelemetry-proto"] + path = exporters/otlp/internal/opentelemetry-proto + url = https://github.com/open-telemetry/opentelemetry-proto diff --git a/vendor/go.opentelemetry.io/otel/.golangci.yml b/vendor/go.opentelemetry.io/otel/.golangci.yml new file mode 100644 index 000000000..a62511f38 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/.golangci.yml @@ -0,0 +1,296 @@ +# See https://github.com/golangci/golangci-lint#config-file +run: + issues-exit-code: 1 #Default + tests: true #Default + +linters: + # Disable everything by default so upgrades to not include new "default + # enabled" linters. + disable-all: true + # Specifically enable linters we want to use. + enable: + - depguard + - errcheck + - godot + - gofumpt + - goimports + - gosec + - gosimple + - govet + - ineffassign + - misspell + - revive + - staticcheck + - typecheck + - unused + +issues: + # Maximum issues count per one linter. + # Set to 0 to disable. + # Default: 50 + # Setting to unlimited so the linter only is run once to debug all issues. + max-issues-per-linter: 0 + # Maximum count of issues with the same text. + # Set to 0 to disable. + # Default: 3 + # Setting to unlimited so the linter only is run once to debug all issues. + max-same-issues: 0 + # Excluding configuration per-path, per-linter, per-text and per-source. + exclude-rules: + # TODO: Having appropriate comments for exported objects helps development, + # even for objects in internal packages. Appropriate comments for all + # exported objects should be added and this exclusion removed. + - path: '.*internal/.*' + text: "exported (method|function|type|const) (.+) should have comment or be unexported" + linters: + - revive + # Yes, they are, but it's okay in a test. + - path: _test\.go + text: "exported func.*returns unexported type.*which can be annoying to use" + linters: + - revive + # Example test functions should be treated like main. + - path: example.*_test\.go + text: "calls to (.+) only in main[(][)] or init[(][)] functions" + linters: + - revive + # It's okay to not run gosec in a test. + - path: _test\.go + linters: + - gosec + # Igonoring gosec G404: Use of weak random number generator (math/rand instead of crypto/rand) + # as we commonly use it in tests and examples. + - text: "G404:" + linters: + - gosec + # Igonoring gosec G402: TLS MinVersion too low + # as the https://pkg.go.dev/crypto/tls#Config handles MinVersion default well. + - text: "G402: TLS MinVersion too low." + linters: + - gosec + include: + # revive exported should have comment or be unexported. + - EXC0012 + # revive package comment should be of the form ... + - EXC0013 + +linters-settings: + depguard: + rules: + non-tests: + files: + - "!$test" + - "!**/*test/*.go" + - "!**/internal/matchers/*.go" + deny: + - pkg: "testing" + - pkg: "github.com/stretchr/testify" + - pkg: "crypto/md5" + - pkg: "crypto/sha1" + - pkg: "crypto/**/pkix" + otlp-internal: + files: + - "!**/exporters/otlp/internal/**/*.go" + deny: + - pkg: "go.opentelemetry.io/otel/exporters/otlp/internal" + desc: Do not use cross-module internal packages. + otlptrace-internal: + files: + - "!**/exporters/otlp/otlptrace/*.go" + - "!**/exporters/otlp/otlptrace/internal/**.go" + deny: + - pkg: "go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal" + desc: Do not use cross-module internal packages. + otlpmetric-internal: + files: + - "!**/exporters/otlp/otlpmetric/internal/*.go" + - "!**/exporters/otlp/otlpmetric/internal/**/*.go" + deny: + - pkg: "go.opentelemetry.io/otel/exporters/otlp/otlpmetric/internal" + desc: Do not use cross-module internal packages. + otel-internal: + files: + - "**/sdk/*.go" + - "**/sdk/**/*.go" + - "**/exporters/*.go" + - "**/exporters/**/*.go" + - "**/schema/*.go" + - "**/schema/**/*.go" + - "**/metric/*.go" + - "**/metric/**/*.go" + - "**/bridge/*.go" + - "**/bridge/**/*.go" + - "**/example/*.go" + - "**/example/**/*.go" + - "**/trace/*.go" + - "**/trace/**/*.go" + deny: + - pkg: "go.opentelemetry.io/otel/internal$" + desc: Do not use cross-module internal packages. + - pkg: "go.opentelemetry.io/otel/internal/attribute" + desc: Do not use cross-module internal packages. + - pkg: "go.opentelemetry.io/otel/internal/internaltest" + desc: Do not use cross-module internal packages. + - pkg: "go.opentelemetry.io/otel/internal/matchers" + desc: Do not use cross-module internal packages. + godot: + exclude: + # Exclude links. + - '^ *\[[^]]+\]:' + # Exclude sentence fragments for lists. + - '^[ ]*[-•]' + # Exclude sentences prefixing a list. + - ':$' + goimports: + local-prefixes: go.opentelemetry.io + misspell: + locale: US + ignore-words: + - cancelled + revive: + # Sets the default failure confidence. + # This means that linting errors with less than 0.8 confidence will be ignored. + # Default: 0.8 + confidence: 0.01 + rules: + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#blank-imports + - name: blank-imports + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#bool-literal-in-expr + - name: bool-literal-in-expr + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#constant-logical-expr + - name: constant-logical-expr + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#context-as-argument + # TODO (#3372) re-enable linter when it is compatible. https://github.com/golangci/golangci-lint/issues/3280 + - name: context-as-argument + disabled: true + arguments: + allowTypesBefore: "*testing.T" + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#context-keys-type + - name: context-keys-type + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#deep-exit + - name: deep-exit + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#defer + - name: defer + disabled: false + arguments: + - ["call-chain", "loop"] + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#dot-imports + - name: dot-imports + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#duplicated-imports + - name: duplicated-imports + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#early-return + - name: early-return + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#empty-block + - name: empty-block + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#empty-lines + - name: empty-lines + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#error-naming + - name: error-naming + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#error-return + - name: error-return + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#error-strings + - name: error-strings + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#errorf + - name: errorf + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#exported + - name: exported + disabled: false + arguments: + - "sayRepetitiveInsteadOfStutters" + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#flag-parameter + - name: flag-parameter + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#identical-branches + - name: identical-branches + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#if-return + - name: if-return + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#increment-decrement + - name: increment-decrement + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#indent-error-flow + - name: indent-error-flow + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#import-shadowing + - name: import-shadowing + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#package-comments + - name: package-comments + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#range + - name: range + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#range-val-in-closure + - name: range-val-in-closure + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#range-val-address + - name: range-val-address + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#redefines-builtin-id + - name: redefines-builtin-id + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#string-format + - name: string-format + disabled: false + arguments: + - - panic + - '/^[^\n]*$/' + - must not contain line breaks + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#struct-tag + - name: struct-tag + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#superfluous-else + - name: superfluous-else + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#time-equal + - name: time-equal + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#var-naming + - name: var-naming + disabled: false + arguments: + - ["ID"] # AllowList + - ["Otel", "Aws", "Gcp"] # DenyList + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#var-declaration + - name: var-declaration + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unconditional-recursion + - name: unconditional-recursion + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unexported-return + - name: unexported-return + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unhandled-error + - name: unhandled-error + disabled: false + arguments: + - "fmt.Fprint" + - "fmt.Fprintf" + - "fmt.Fprintln" + - "fmt.Print" + - "fmt.Printf" + - "fmt.Println" + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unnecessary-stmt + - name: unnecessary-stmt + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#useless-break + - name: useless-break + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#waitgroup-by-value + - name: waitgroup-by-value + disabled: false diff --git a/vendor/go.opentelemetry.io/otel/.lycheeignore b/vendor/go.opentelemetry.io/otel/.lycheeignore new file mode 100644 index 000000000..40d62fa2e --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/.lycheeignore @@ -0,0 +1,6 @@ +http://localhost +http://jaeger-collector +https://github.com/open-telemetry/opentelemetry-go/milestone/ +https://github.com/open-telemetry/opentelemetry-go/projects +file:///home/runner/work/opentelemetry-go/opentelemetry-go/libraries +file:///home/runner/work/opentelemetry-go/opentelemetry-go/manual diff --git a/vendor/go.opentelemetry.io/otel/.markdownlint.yaml b/vendor/go.opentelemetry.io/otel/.markdownlint.yaml new file mode 100644 index 000000000..3202496c3 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/.markdownlint.yaml @@ -0,0 +1,29 @@ +# Default state for all rules +default: true + +# ul-style +MD004: false + +# hard-tabs +MD010: false + +# line-length +MD013: false + +# no-duplicate-header +MD024: + siblings_only: true + +#single-title +MD025: false + +# ol-prefix +MD029: + style: ordered + +# no-inline-html +MD033: false + +# fenced-code-language +MD040: false + diff --git a/vendor/go.opentelemetry.io/otel/CHANGELOG.md b/vendor/go.opentelemetry.io/otel/CHANGELOG.md new file mode 100644 index 000000000..24874f856 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/CHANGELOG.md @@ -0,0 +1,2818 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). + +This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [1.21.0/0.44.0] 2023-11-16 + +### Removed + +- Remove the deprecated `go.opentelemetry.io/otel/bridge/opencensus.NewTracer`. (#4706) +- Remove the deprecated `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` module. (#4707) +- Remove the deprecated `go.opentelemetry.io/otel/example/view` module. (#4708) +- Remove the deprecated `go.opentelemetry.io/otel/example/fib` module. (#4723) + +### Fixed + +- Do not parse non-protobuf responses in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4719) +- Do not parse non-protobuf responses in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#4719) + +## [1.20.0/0.43.0] 2023-11-10 + +This release brings a breaking change for custom trace API implementations. Some interfaces (`TracerProvider`, `Tracer`, `Span`) now embed the `go.opentelemetry.io/otel/trace/embedded` types. Implementors need to update their implementations based on what they want the default behavior to be. See the "API Implementations" section of the [trace API] package documentation for more information about how to accomplish this. + +### Added + +- Add `go.opentelemetry.io/otel/bridge/opencensus.InstallTraceBridge`, which installs the OpenCensus trace bridge, and replaces `opencensus.NewTracer`. (#4567) +- Add scope version to trace and metric bridges in `go.opentelemetry.io/otel/bridge/opencensus`. (#4584) +- Add the `go.opentelemetry.io/otel/trace/embedded` package to be embedded in the exported trace API interfaces. (#4620) +- Add the `go.opentelemetry.io/otel/trace/noop` package as a default no-op implementation of the trace API. (#4620) +- Add context propagation in `go.opentelemetry.io/otel/example/dice`. (#4644) +- Add view configuration to `go.opentelemetry.io/otel/example/prometheus`. (#4649) +- Add `go.opentelemetry.io/otel/metric.WithExplicitBucketBoundaries`, which allows defining default explicit bucket boundaries when creating histogram instruments. (#4603) +- Add `Version` function in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`. (#4660) +- Add `Version` function in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4660) +- Add Summary, SummaryDataPoint, and QuantileValue to `go.opentelemetry.io/sdk/metric/metricdata`. (#4622) +- `go.opentelemetry.io/otel/bridge/opencensus.NewMetricProducer` now supports exemplars from OpenCensus. (#4585) +- Add support for `WithExplicitBucketBoundaries` in `go.opentelemetry.io/otel/sdk/metric`. (#4605) +- Add support for Summary metrics in `go.opentelemetry.io/otel/bridge/opencensus`. (#4668) + +### Deprecated + +- Deprecate `go.opentelemetry.io/otel/bridge/opencensus.NewTracer` in favor of `opencensus.InstallTraceBridge`. (#4567) +- Deprecate `go.opentelemetry.io/otel/example/fib` package is in favor of `go.opentelemetry.io/otel/example/dice`. (#4618) +- Deprecate `go.opentelemetry.io/otel/trace.NewNoopTracerProvider`. + Use the added `NewTracerProvider` function in `go.opentelemetry.io/otel/trace/noop` instead. (#4620) +- Deprecate `go.opentelemetry.io/otel/example/view` package in favor of `go.opentelemetry.io/otel/example/prometheus`. (#4649) +- Deprecate `go.opentelemetry.io/otel/exporters/otlp/otlpmetric`. (#4693) + +### Changed + +- `go.opentelemetry.io/otel/bridge/opencensus.NewMetricProducer` returns a `*MetricProducer` struct instead of the metric.Producer interface. (#4583) +- The `TracerProvider` in `go.opentelemetry.io/otel/trace` now embeds the `go.opentelemetry.io/otel/trace/embedded.TracerProvider` type. + This extends the `TracerProvider` interface and is is a breaking change for any existing implementation. + Implementors need to update their implementations based on what they want the default behavior of the interface to be. + See the "API Implementations" section of the `go.opentelemetry.io/otel/trace` package documentation for more information about how to accomplish this. (#4620) +- The `Tracer` in `go.opentelemetry.io/otel/trace` now embeds the `go.opentelemetry.io/otel/trace/embedded.Tracer` type. + This extends the `Tracer` interface and is is a breaking change for any existing implementation. + Implementors need to update their implementations based on what they want the default behavior of the interface to be. + See the "API Implementations" section of the `go.opentelemetry.io/otel/trace` package documentation for more information about how to accomplish this. (#4620) +- The `Span` in `go.opentelemetry.io/otel/trace` now embeds the `go.opentelemetry.io/otel/trace/embedded.Span` type. + This extends the `Span` interface and is is a breaking change for any existing implementation. + Implementors need to update their implementations based on what they want the default behavior of the interface to be. + See the "API Implementations" section of the `go.opentelemetry.io/otel/trace` package documentation for more information about how to accomplish this. (#4620) +- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` does no longer depend on `go.opentelemetry.io/otel/exporters/otlp/otlpmetric`. (#4660) +- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` does no longer depend on `go.opentelemetry.io/otel/exporters/otlp/otlpmetric`. (#4660) +- Retry for `502 Bad Gateway` and `504 Gateway Timeout` HTTP statuses in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4670) +- Retry for `502 Bad Gateway` and `504 Gateway Timeout` HTTP statuses in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#4670) +- Retry for `RESOURCE_EXHAUSTED` only if RetryInfo is returned in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`. (#4669) +- Retry for `RESOURCE_EXHAUSTED` only if RetryInfo is returned in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`. (#4669) +- Retry temporary HTTP request failures in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4679) +- Retry temporary HTTP request failures in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#4679) + +### Fixed + +- Fix improper parsing of characters such us `+`, `/` by `Parse` in `go.opentelemetry.io/otel/baggage` as they were rendered as a whitespace. (#4667) +- Fix improper parsing of characters such us `+`, `/` passed via `OTEL_RESOURCE_ATTRIBUTES` in `go.opentelemetry.io/otel/sdk/resource` as they were rendered as a whitespace. (#4699) +- Fix improper parsing of characters such us `+`, `/` passed via `OTEL_EXPORTER_OTLP_HEADERS` and `OTEL_EXPORTER_OTLP_METRICS_HEADERS` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` as they were rendered as a whitespace. (#4699) +- Fix improper parsing of characters such us `+`, `/` passed via `OTEL_EXPORTER_OTLP_HEADERS` and `OTEL_EXPORTER_OTLP_METRICS_HEADERS` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` as they were rendered as a whitespace. (#4699) +- Fix improper parsing of characters such us `+`, `/` passed via `OTEL_EXPORTER_OTLP_HEADERS` and `OTEL_EXPORTER_OTLP_TRACES_HEADERS` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlptracegrpc` as they were rendered as a whitespace. (#4699) +- Fix improper parsing of characters such us `+`, `/` passed via `OTEL_EXPORTER_OTLP_HEADERS` and `OTEL_EXPORTER_OTLP_TRACES_HEADERS` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlptracehttp` as they were rendered as a whitespace. (#4699) +- In `go.opentelemetry.op/otel/exporters/prometheus`, the exporter no longer `Collect`s metrics after `Shutdown` is invoked. (#4648) +- Fix documentation for `WithCompressor` in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`. (#4695) +- Fix documentation for `WithCompressor` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`. (#4695) + +## [1.19.0/0.42.0/0.0.7] 2023-09-28 + +This release contains the first stable release of the OpenTelemetry Go [metric SDK]. +Our project stability guarantees now apply to the `go.opentelemetry.io/otel/sdk/metric` package. +See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. + +### Added + +- Add the "Roll the dice" getting started application example in `go.opentelemetry.io/otel/example/dice`. (#4539) +- The `WithWriter` and `WithPrettyPrint` options to `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` to set a custom `io.Writer`, and allow displaying the output in human-readable JSON. (#4507) + +### Changed + +- Allow '/' characters in metric instrument names. (#4501) +- The exporter in `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` does not prettify its output by default anymore. (#4507) +- Upgrade `gopkg.io/yaml` from `v2` to `v3` in `go.opentelemetry.io/otel/schema`. (#4535) + +### Fixed + +- In `go.opentelemetry.op/otel/exporters/prometheus`, don't try to create the Prometheus metric on every `Collect` if we know the scope is invalid. (#4499) + +### Removed + +- Remove `"go.opentelemetry.io/otel/bridge/opencensus".NewMetricExporter`, which is replaced by `NewMetricProducer`. (#4566) + +## [1.19.0-rc.1/0.42.0-rc.1] 2023-09-14 + +This is a release candidate for the v1.19.0/v0.42.0 release. +That release is expected to include the `v1` release of the OpenTelemetry Go metric SDK and will provide stability guarantees of that SDK. +See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. + +### Changed + +- Allow '/' characters in metric instrument names. (#4501) + +### Fixed + +- In `go.opentelemetry.op/otel/exporters/prometheus`, don't try to create the prometheus metric on every `Collect` if we know the scope is invalid. (#4499) + +## [1.18.0/0.41.0/0.0.6] 2023-09-12 + +This release drops the compatibility guarantee of [Go 1.19]. + +### Added + +- Add `WithProducer` option in `go.opentelemetry.op/otel/exporters/prometheus` to restore the ability to register producers on the prometheus exporter's manual reader. (#4473) +- Add `IgnoreValue` option in `go.opentelemetry.io/otel/sdk/metric/metricdata/metricdatatest` to allow ignoring values when comparing metrics. (#4447) + +### Changed + +- Use a `TestingT` interface instead of `*testing.T` struct in `go.opentelemetry.io/otel/sdk/metric/metricdata/metricdatatest`. (#4483) + +### Deprecated + +- The `NewMetricExporter` in `go.opentelemetry.io/otel/bridge/opencensus` was deprecated in `v0.35.0` (#3541). + The deprecation notice format for the function has been corrected to trigger Go documentation and build tooling. (#4470) + +### Removed + +- Removed the deprecated `go.opentelemetry.io/otel/exporters/jaeger` package. (#4467) +- Removed the deprecated `go.opentelemetry.io/otel/example/jaeger` package. (#4467) +- Removed the deprecated `go.opentelemetry.io/otel/sdk/metric/aggregation` package. (#4468) +- Removed the deprecated internal packages in `go.opentelemetry.io/otel/exporters/otlp` and its sub-packages. (#4469) +- Dropped guaranteed support for versions of Go less than 1.20. (#4481) + +## [1.17.0/0.40.0/0.0.5] 2023-08-28 + +### Added + +- Export the `ManualReader` struct in `go.opentelemetry.io/otel/sdk/metric`. (#4244) +- Export the `PeriodicReader` struct in `go.opentelemetry.io/otel/sdk/metric`. (#4244) +- Add support for exponential histogram aggregations. + A histogram can be configured as an exponential histogram using a view with `"go.opentelemetry.io/otel/sdk/metric".ExponentialHistogram` as the aggregation. (#4245) +- Export the `Exporter` struct in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`. (#4272) +- Export the `Exporter` struct in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4272) +- The exporters in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` now support the `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE` environment variable. (#4287) +- Add `WithoutCounterSuffixes` option in `go.opentelemetry.io/otel/exporters/prometheus` to disable addition of `_total` suffixes. (#4306) +- Add info and debug logging to the metric SDK in `go.opentelemetry.io/otel/sdk/metric`. (#4315) +- The `go.opentelemetry.io/otel/semconv/v1.21.0` package. + The package contains semantic conventions from the `v1.21.0` version of the OpenTelemetry Semantic Conventions. (#4362) +- Accept 201 to 299 HTTP status as success in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` and `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#4365) +- Document the `Temporality` and `Aggregation` methods of the `"go.opentelemetry.io/otel/sdk/metric".Exporter"` need to be concurrent safe. (#4381) +- Expand the set of units supported by the Prometheus exporter, and don't add unit suffixes if they are already present in `go.opentelemetry.op/otel/exporters/prometheus` (#4374) +- Move the `Aggregation` interface and its implementations from `go.opentelemetry.io/otel/sdk/metric/aggregation` to `go.opentelemetry.io/otel/sdk/metric`. (#4435) +- The exporters in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` now support the `OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION` environment variable. (#4437) +- Add the `NewAllowKeysFilter` and `NewDenyKeysFilter` functions to `go.opentelemetry.io/otel/attribute` to allow convenient creation of allow-keys and deny-keys filters. (#4444) +- Support Go 1.21. (#4463) + +### Changed + +- Starting from `v1.21.0` of semantic conventions, `go.opentelemetry.io/otel/semconv/{version}/httpconv` and `go.opentelemetry.io/otel/semconv/{version}/netconv` packages will no longer be published. (#4145) +- Log duplicate instrument conflict at a warning level instead of info in `go.opentelemetry.io/otel/sdk/metric`. (#4202) +- Return an error on the creation of new instruments in `go.opentelemetry.io/otel/sdk/metric` if their name doesn't pass regexp validation. (#4210) +- `NewManualReader` in `go.opentelemetry.io/otel/sdk/metric` returns `*ManualReader` instead of `Reader`. (#4244) +- `NewPeriodicReader` in `go.opentelemetry.io/otel/sdk/metric` returns `*PeriodicReader` instead of `Reader`. (#4244) +- Count the Collect time in the `PeriodicReader` timeout in `go.opentelemetry.io/otel/sdk/metric`. (#4221) +- The function `New` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` returns `*Exporter` instead of `"go.opentelemetry.io/otel/sdk/metric".Exporter`. (#4272) +- The function `New` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` returns `*Exporter` instead of `"go.opentelemetry.io/otel/sdk/metric".Exporter`. (#4272) +- If an attribute set is omitted from an async callback, the previous value will no longer be exported in `go.opentelemetry.io/otel/sdk/metric`. (#4290) +- If an attribute set is observed multiple times in an async callback in `go.opentelemetry.io/otel/sdk/metric`, the values will be summed instead of the last observation winning. (#4289) +- Allow the explicit bucket histogram aggregation to be used for the up-down counter, observable counter, observable up-down counter, and observable gauge in the `go.opentelemetry.io/otel/sdk/metric` package. (#4332) +- Restrict `Meter`s in `go.opentelemetry.io/otel/sdk/metric` to only register and collect instruments it created. (#4333) +- `PeriodicReader.Shutdown` and `PeriodicReader.ForceFlush` in `go.opentelemetry.io/otel/sdk/metric` now apply the periodic reader's timeout to the operation if the user provided context does not contain a deadline. (#4356, #4377) +- Upgrade all use of `go.opentelemetry.io/otel/semconv` to use `v1.21.0`. (#4408) +- Increase instrument name maximum length from 63 to 255 characters in `go.opentelemetry.io/otel/sdk/metric`. (#4434) +- Add `go.opentelemetry.op/otel/sdk/metric.WithProducer` as an `Option` for `"go.opentelemetry.io/otel/sdk/metric".NewManualReader` and `"go.opentelemetry.io/otel/sdk/metric".NewPeriodicReader`. (#4346) + +### Removed + +- Remove `Reader.RegisterProducer` in `go.opentelemetry.io/otel/metric`. + Use the added `WithProducer` option instead. (#4346) +- Remove `Reader.ForceFlush` in `go.opentelemetry.io/otel/metric`. + Notice that `PeriodicReader.ForceFlush` is still available. (#4375) + +### Fixed + +- Correctly format log messages from the `go.opentelemetry.io/otel/exporters/zipkin` exporter. (#4143) +- Log an error for calls to `NewView` in `go.opentelemetry.io/otel/sdk/metric` that have empty criteria. (#4307) +- Fix `"go.opentelemetry.io/otel/sdk/resource".WithHostID()` to not set an empty `host.id`. (#4317) +- Use the instrument identifying fields to cache aggregators and determine duplicate instrument registrations in `go.opentelemetry.io/otel/sdk/metric`. (#4337) +- Detect duplicate instruments for case-insensitive names in `go.opentelemetry.io/otel/sdk/metric`. (#4338) +- The `ManualReader` will not panic if `AggregationSelector` returns `nil` in `go.opentelemetry.io/otel/sdk/metric`. (#4350) +- If a `Reader`'s `AggregationSelector` returns `nil` or `DefaultAggregation` the pipeline will use the default aggregation. (#4350) +- Log a suggested view that fixes instrument conflicts in `go.opentelemetry.io/otel/sdk/metric`. (#4349) +- Fix possible panic, deadlock and race condition in batch span processor in `go.opentelemetry.io/otel/sdk/trace`. (#4353) +- Improve context cancellation handling in batch span processor's `ForceFlush` in `go.opentelemetry.io/otel/sdk/trace`. (#4369) +- Decouple `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal` from `go.opentelemetry.io/otel/exporters/otlp/internal` using gotmpl. (#4397, #3846) +- Decouple `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/internal` from `go.opentelemetry.io/otel/exporters/otlp/internal` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/internal` using gotmpl. (#4404, #3846) +- Decouple `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp/internal` from `go.opentelemetry.io/otel/exporters/otlp/internal` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/internal` using gotmpl. (#4407, #3846) +- Decouple `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal` from `go.opentelemetry.io/otel/exporters/otlp/internal` and `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal` using gotmpl. (#4400, #3846) +- Decouple `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal` from `go.opentelemetry.io/otel/exporters/otlp/internal` and `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal` using gotmpl. (#4401, #3846) +- Do not block the metric SDK when OTLP metric exports are blocked in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#3925, #4395) +- Do not append `_total` if the counter already has that suffix for the Prometheus exproter in `go.opentelemetry.io/otel/exporter/prometheus`. (#4373) +- Fix resource detection data race in `go.opentelemetry.io/otel/sdk/resource`. (#4409) +- Use the first-seen instrument name during instrument name conflicts in `go.opentelemetry.io/otel/sdk/metric`. (#4428) + +### Deprecated + +- The `go.opentelemetry.io/otel/exporters/jaeger` package is deprecated. + OpenTelemetry dropped support for Jaeger exporter in July 2023. + Use `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp` + or `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc` instead. (#4423) +- The `go.opentelemetry.io/otel/example/jaeger` package is deprecated. (#4423) +- The `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/internal` package is deprecated. (#4420) +- The `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/internal/oconf` package is deprecated. (#4420) +- The `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/internal/otest` package is deprecated. (#4420) +- The `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/internal/transform` package is deprecated. (#4420) +- The `go.opentelemetry.io/otel/exporters/otlp/internal` package is deprecated. (#4421) +- The `go.opentelemetry.io/otel/exporters/otlp/internal/envconfig` package is deprecated. (#4421) +- The `go.opentelemetry.io/otel/exporters/otlp/internal/retry` package is deprecated. (#4421) +- The `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal` package is deprecated. (#4425) +- The `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/envconfig` package is deprecated. (#4425) +- The `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/otlpconfig` package is deprecated. (#4425) +- The `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/otlptracetest` package is deprecated. (#4425) +- The `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/retry` package is deprecated. (#4425) +- The `go.opentelemetry.io/otel/sdk/metric/aggregation` package is deprecated. + Use the aggregation types added to `go.opentelemetry.io/otel/sdk/metric` instead. (#4435) + +## [1.16.0/0.39.0] 2023-05-18 + +This release contains the first stable release of the OpenTelemetry Go [metric API]. +Our project stability guarantees now apply to the `go.opentelemetry.io/otel/metric` package. +See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. + +### Added + +- The `go.opentelemetry.io/otel/semconv/v1.19.0` package. + The package contains semantic conventions from the `v1.19.0` version of the OpenTelemetry specification. (#3848) +- The `go.opentelemetry.io/otel/semconv/v1.20.0` package. + The package contains semantic conventions from the `v1.20.0` version of the OpenTelemetry specification. (#4078) +- The Exponential Histogram data types in `go.opentelemetry.io/otel/sdk/metric/metricdata`. (#4165) +- OTLP metrics exporter now supports the Exponential Histogram Data Type. (#4222) +- Fix serialization of `time.Time` zero values in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` packages. (#4271) + +### Changed + +- Use `strings.Cut()` instead of `string.SplitN()` for better readability and memory use. (#4049) +- `MeterProvider` returns noop meters once it has been shutdown. (#4154) + +### Removed + +- The deprecated `go.opentelemetry.io/otel/metric/instrument` package is removed. + Use `go.opentelemetry.io/otel/metric` instead. (#4055) + +### Fixed + +- Fix build for BSD based systems in `go.opentelemetry.io/otel/sdk/resource`. (#4077) + +## [1.16.0-rc.1/0.39.0-rc.1] 2023-05-03 + +This is a release candidate for the v1.16.0/v0.39.0 release. +That release is expected to include the `v1` release of the OpenTelemetry Go metric API and will provide stability guarantees of that API. +See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. + +### Added + +- Support global `MeterProvider` in `go.opentelemetry.io/otel`. (#4039) + - Use `Meter` for a `metric.Meter` from the global `metric.MeterProvider`. + - Use `GetMeterProivder` for a global `metric.MeterProvider`. + - Use `SetMeterProivder` to set the global `metric.MeterProvider`. + +### Changed + +- Move the `go.opentelemetry.io/otel/metric` module to the `stable-v1` module set. + This stages the metric API to be released as a stable module. (#4038) + +### Removed + +- The `go.opentelemetry.io/otel/metric/global` package is removed. + Use `go.opentelemetry.io/otel` instead. (#4039) + +## [1.15.1/0.38.1] 2023-05-02 + +### Fixed + +- Remove unused imports from `sdk/resource/host_id_bsd.go` which caused build failures. (#4040, #4041) + +## [1.15.0/0.38.0] 2023-04-27 + +### Added + +- The `go.opentelemetry.io/otel/metric/embedded` package. (#3916) +- The `Version` function to `go.opentelemetry.io/otel/sdk` to return the SDK version. (#3949) +- Add a `WithNamespace` option to `go.opentelemetry.io/otel/exporters/prometheus` to allow users to prefix metrics with a namespace. (#3970) +- The following configuration types were added to `go.opentelemetry.io/otel/metric/instrument` to be used in the configuration of measurement methods. (#3971) + - The `AddConfig` used to hold configuration for addition measurements + - `NewAddConfig` used to create a new `AddConfig` + - `AddOption` used to configure an `AddConfig` + - The `RecordConfig` used to hold configuration for recorded measurements + - `NewRecordConfig` used to create a new `RecordConfig` + - `RecordOption` used to configure a `RecordConfig` + - The `ObserveConfig` used to hold configuration for observed measurements + - `NewObserveConfig` used to create a new `ObserveConfig` + - `ObserveOption` used to configure an `ObserveConfig` +- `WithAttributeSet` and `WithAttributes` are added to `go.opentelemetry.io/otel/metric/instrument`. + They return an option used during a measurement that defines the attribute Set associated with the measurement. (#3971) +- The `Version` function to `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` to return the OTLP metrics client version. (#3956) +- The `Version` function to `go.opentelemetry.io/otel/exporters/otlp/otlptrace` to return the OTLP trace client version. (#3956) + +### Changed + +- The `Extrema` in `go.opentelemetry.io/otel/sdk/metric/metricdata` is redefined with a generic argument of `[N int64 | float64]`. (#3870) +- Update all exported interfaces from `go.opentelemetry.io/otel/metric` to embed their corresponding interface from `go.opentelemetry.io/otel/metric/embedded`. + This adds an implementation requirement to set the interface default behavior for unimplemented methods. (#3916) +- Move No-Op implementation from `go.opentelemetry.io/otel/metric` into its own package `go.opentelemetry.io/otel/metric/noop`. (#3941) + - `metric.NewNoopMeterProvider` is replaced with `noop.NewMeterProvider` +- Add all the methods from `"go.opentelemetry.io/otel/trace".SpanContext` to `bridgeSpanContext` by embedding `otel.SpanContext` in `bridgeSpanContext`. (#3966) +- Wrap `UploadMetrics` error in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/` to improve error message when encountering generic grpc errors. (#3974) +- The measurement methods for all instruments in `go.opentelemetry.io/otel/metric/instrument` accept an option instead of the variadic `"go.opentelemetry.io/otel/attribute".KeyValue`. (#3971) + - The `Int64Counter.Add` method now accepts `...AddOption` + - The `Float64Counter.Add` method now accepts `...AddOption` + - The `Int64UpDownCounter.Add` method now accepts `...AddOption` + - The `Float64UpDownCounter.Add` method now accepts `...AddOption` + - The `Int64Histogram.Record` method now accepts `...RecordOption` + - The `Float64Histogram.Record` method now accepts `...RecordOption` + - The `Int64Observer.Observe` method now accepts `...ObserveOption` + - The `Float64Observer.Observe` method now accepts `...ObserveOption` +- The `Observer` methods in `go.opentelemetry.io/otel/metric` accept an option instead of the variadic `"go.opentelemetry.io/otel/attribute".KeyValue`. (#3971) + - The `Observer.ObserveInt64` method now accepts `...ObserveOption` + - The `Observer.ObserveFloat64` method now accepts `...ObserveOption` +- Move global metric back to `go.opentelemetry.io/otel/metric/global` from `go.opentelemetry.io/otel`. (#3986) + +### Fixed + +- `TracerProvider` allows calling `Tracer()` while it's shutting down. + It used to deadlock. (#3924) +- Use the SDK version for the Telemetry SDK resource detector in `go.opentelemetry.io/otel/sdk/resource`. (#3949) +- Fix a data race in `SpanProcessor` returned by `NewSimpleSpanProcessor` in `go.opentelemetry.io/otel/sdk/trace`. (#3951) +- Automatically figure out the default aggregation with `aggregation.Default`. (#3967) + +### Deprecated + +- The `go.opentelemetry.io/otel/metric/instrument` package is deprecated. + Use the equivalent types added to `go.opentelemetry.io/otel/metric` instead. (#4018) + +## [1.15.0-rc.2/0.38.0-rc.2] 2023-03-23 + +This is a release candidate for the v1.15.0/v0.38.0 release. +That release will include the `v1` release of the OpenTelemetry Go metric API and will provide stability guarantees of that API. +See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. + +### Added + +- The `WithHostID` option to `go.opentelemetry.io/otel/sdk/resource`. (#3812) +- The `WithoutTimestamps` option to `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` to sets all timestamps to zero. (#3828) +- The new `Exemplar` type is added to `go.opentelemetry.io/otel/sdk/metric/metricdata`. + Both the `DataPoint` and `HistogramDataPoint` types from that package have a new field of `Exemplars` containing the sampled exemplars for their timeseries. (#3849) +- Configuration for each metric instrument in `go.opentelemetry.io/otel/sdk/metric/instrument`. (#3895) +- The internal logging introduces a warning level verbosity equal to `V(1)`. (#3900) +- Added a log message warning about usage of `SimpleSpanProcessor` in production environments. (#3854) + +### Changed + +- Optimize memory allocation when creation a new `Set` using `NewSet` or `NewSetWithFiltered` in `go.opentelemetry.io/otel/attribute`. (#3832) +- Optimize memory allocation when creation new metric instruments in `go.opentelemetry.io/otel/sdk/metric`. (#3832) +- Avoid creating new objects on all calls to `WithDeferredSetup` and `SkipContextSetup` in OpenTracing bridge. (#3833) +- The `New` and `Detect` functions from `go.opentelemetry.io/otel/sdk/resource` return errors that wrap underlying errors instead of just containing the underlying error strings. (#3844) +- Both the `Histogram` and `HistogramDataPoint` are redefined with a generic argument of `[N int64 | float64]` in `go.opentelemetry.io/otel/sdk/metric/metricdata`. (#3849) +- The metric `Export` interface from `go.opentelemetry.io/otel/sdk/metric` accepts a `*ResourceMetrics` instead of `ResourceMetrics`. (#3853) +- Rename `Asynchronous` to `Observable` in `go.opentelemetry.io/otel/metric/instrument`. (#3892) +- Rename `Int64ObserverOption` to `Int64ObservableOption` in `go.opentelemetry.io/otel/metric/instrument`. (#3895) +- Rename `Float64ObserverOption` to `Float64ObservableOption` in `go.opentelemetry.io/otel/metric/instrument`. (#3895) +- The internal logging changes the verbosity level of info to `V(4)`, the verbosity level of debug to `V(8)`. (#3900) + +### Fixed + +- `TracerProvider` consistently doesn't allow to register a `SpanProcessor` after shutdown. (#3845) + +### Removed + +- The deprecated `go.opentelemetry.io/otel/metric/global` package is removed. (#3829) +- The unneeded `Synchronous` interface in `go.opentelemetry.io/otel/metric/instrument` was removed. (#3892) +- The `Float64ObserverConfig` and `NewFloat64ObserverConfig` in `go.opentelemetry.io/otel/sdk/metric/instrument`. + Use the added `float64` instrument configuration instead. (#3895) +- The `Int64ObserverConfig` and `NewInt64ObserverConfig` in `go.opentelemetry.io/otel/sdk/metric/instrument`. + Use the added `int64` instrument configuration instead. (#3895) +- The `NewNoopMeter` function in `go.opentelemetry.io/otel/metric`, use `NewMeterProvider().Meter("")` instead. (#3893) + +## [1.15.0-rc.1/0.38.0-rc.1] 2023-03-01 + +This is a release candidate for the v1.15.0/v0.38.0 release. +That release will include the `v1` release of the OpenTelemetry Go metric API and will provide stability guarantees of that API. +See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. + +This release drops the compatibility guarantee of [Go 1.18]. + +### Added + +- Support global `MeterProvider` in `go.opentelemetry.io/otel`. (#3818) + - Use `Meter` for a `metric.Meter` from the global `metric.MeterProvider`. + - Use `GetMeterProivder` for a global `metric.MeterProvider`. + - Use `SetMeterProivder` to set the global `metric.MeterProvider`. + +### Changed + +- Dropped compatibility testing for [Go 1.18]. + The project no longer guarantees support for this version of Go. (#3813) + +### Fixed + +- Handle empty environment variable as it they were not set. (#3764) +- Clarify the `httpconv` and `netconv` packages in `go.opentelemetry.io/otel/semconv/*` provide tracing semantic conventions. (#3823) +- Fix race conditions in `go.opentelemetry.io/otel/exporters/metric/prometheus` that could cause a panic. (#3899) +- Fix sending nil `scopeInfo` to metrics channel in `go.opentelemetry.io/otel/exporters/metric/prometheus` that could cause a panic in `github.com/prometheus/client_golang/prometheus`. (#3899) + +### Deprecated + +- The `go.opentelemetry.io/otel/metric/global` package is deprecated. + Use `go.opentelemetry.io/otel` instead. (#3818) + +### Removed + +- The deprecated `go.opentelemetry.io/otel/metric/unit` package is removed. (#3814) + +## [1.14.0/0.37.0/0.0.4] 2023-02-27 + +This release is the last to support [Go 1.18]. +The next release will require at least [Go 1.19]. + +### Added + +- The `event` type semantic conventions are added to `go.opentelemetry.io/otel/semconv/v1.17.0`. (#3697) +- Support [Go 1.20]. (#3693) +- The `go.opentelemetry.io/otel/semconv/v1.18.0` package. + The package contains semantic conventions from the `v1.18.0` version of the OpenTelemetry specification. (#3719) + - The following `const` renames from `go.opentelemetry.io/otel/semconv/v1.17.0` are included: + - `OtelScopeNameKey` -> `OTelScopeNameKey` + - `OtelScopeVersionKey` -> `OTelScopeVersionKey` + - `OtelLibraryNameKey` -> `OTelLibraryNameKey` + - `OtelLibraryVersionKey` -> `OTelLibraryVersionKey` + - `OtelStatusCodeKey` -> `OTelStatusCodeKey` + - `OtelStatusDescriptionKey` -> `OTelStatusDescriptionKey` + - `OtelStatusCodeOk` -> `OTelStatusCodeOk` + - `OtelStatusCodeError` -> `OTelStatusCodeError` + - The following `func` renames from `go.opentelemetry.io/otel/semconv/v1.17.0` are included: + - `OtelScopeName` -> `OTelScopeName` + - `OtelScopeVersion` -> `OTelScopeVersion` + - `OtelLibraryName` -> `OTelLibraryName` + - `OtelLibraryVersion` -> `OTelLibraryVersion` + - `OtelStatusDescription` -> `OTelStatusDescription` +- A `IsSampled` method is added to the `SpanContext` implementation in `go.opentelemetry.io/otel/bridge/opentracing` to expose the span sampled state. + See the [README](./bridge/opentracing/README.md) for more information. (#3570) +- The `WithInstrumentationAttributes` option to `go.opentelemetry.io/otel/metric`. (#3738) +- The `WithInstrumentationAttributes` option to `go.opentelemetry.io/otel/trace`. (#3739) +- The following environment variables are supported by the periodic `Reader` in `go.opentelemetry.io/otel/sdk/metric`. (#3763) + - `OTEL_METRIC_EXPORT_INTERVAL` sets the time between collections and exports. + - `OTEL_METRIC_EXPORT_TIMEOUT` sets the timeout an export is attempted. + +### Changed + +- Fall-back to `TextMapCarrier` when it's not `HttpHeader`s in `go.opentelemetry.io/otel/bridge/opentracing`. (#3679) +- The `Collect` method of the `"go.opentelemetry.io/otel/sdk/metric".Reader` interface is updated to accept the `metricdata.ResourceMetrics` value the collection will be made into. + This change is made to enable memory reuse by SDK users. (#3732) +- The `WithUnit` option in `go.opentelemetry.io/otel/sdk/metric/instrument` is updated to accept a `string` for the unit value. (#3776) + +### Fixed + +- Ensure `go.opentelemetry.io/otel` does not use generics. (#3723, #3725) +- Multi-reader `MeterProvider`s now export metrics for all readers, instead of just the first reader. (#3720, #3724) +- Remove use of deprecated `"math/rand".Seed` in `go.opentelemetry.io/otel/example/prometheus`. (#3733) +- Do not silently drop unknown schema data with `Parse` in `go.opentelemetry.io/otel/schema/v1.1`. (#3743) +- Data race issue in OTLP exporter retry mechanism. (#3755, #3756) +- Wrapping empty errors when exporting in `go.opentelemetry.io/otel/sdk/metric`. (#3698, #3772) +- Incorrect "all" and "resource" definition for schema files in `go.opentelemetry.io/otel/schema/v1.1`. (#3777) + +### Deprecated + +- The `go.opentelemetry.io/otel/metric/unit` package is deprecated. + Use the equivalent unit string instead. (#3776) + - Use `"1"` instead of `unit.Dimensionless` + - Use `"By"` instead of `unit.Bytes` + - Use `"ms"` instead of `unit.Milliseconds` + +## [1.13.0/0.36.0] 2023-02-07 + +### Added + +- Attribute `KeyValue` creations functions to `go.opentelemetry.io/otel/semconv/v1.17.0` for all non-enum semantic conventions. + These functions ensure semantic convention type correctness. (#3675) + +### Fixed + +- Removed the `http.target` attribute from being added by `ServerRequest` in the following packages. (#3687) + - `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv` + - `go.opentelemetry.io/otel/semconv/v1.14.0/httpconv` + - `go.opentelemetry.io/otel/semconv/v1.15.0/httpconv` + - `go.opentelemetry.io/otel/semconv/v1.16.0/httpconv` + - `go.opentelemetry.io/otel/semconv/v1.17.0/httpconv` + +### Removed + +- The deprecated `go.opentelemetry.io/otel/metric/instrument/asyncfloat64` package is removed. (#3631) +- The deprecated `go.opentelemetry.io/otel/metric/instrument/asyncint64` package is removed. (#3631) +- The deprecated `go.opentelemetry.io/otel/metric/instrument/syncfloat64` package is removed. (#3631) +- The deprecated `go.opentelemetry.io/otel/metric/instrument/syncint64` package is removed. (#3631) + +## [1.12.0/0.35.0] 2023-01-28 + +### Added + +- The `WithInt64Callback` option to `go.opentelemetry.io/otel/metric/instrument`. + This options is used to configure `int64` Observer callbacks during their creation. (#3507) +- The `WithFloat64Callback` option to `go.opentelemetry.io/otel/metric/instrument`. + This options is used to configure `float64` Observer callbacks during their creation. (#3507) +- The `Producer` interface and `Reader.RegisterProducer(Producer)` to `go.opentelemetry.io/otel/sdk/metric`. + These additions are used to enable external metric Producers. (#3524) +- The `Callback` function type to `go.opentelemetry.io/otel/metric`. + This new named function type is registered with a `Meter`. (#3564) +- The `go.opentelemetry.io/otel/semconv/v1.13.0` package. + The package contains semantic conventions from the `v1.13.0` version of the OpenTelemetry specification. (#3499) + - The `EndUserAttributesFromHTTPRequest` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is merged into `ClientRequest` and `ServerRequest` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`. + - The `HTTPAttributesFromHTTPStatusCode` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is merged into `ClientResponse` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`. + - The `HTTPClientAttributesFromHTTPRequest` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is replaced by `ClientRequest` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`. + - The `HTTPServerAttributesFromHTTPRequest` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is replaced by `ServerRequest` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`. + - The `HTTPServerMetricAttributesFromHTTPRequest` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is replaced by `ServerRequest` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`. + - The `NetAttributesFromHTTPRequest` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is split into `Transport` in `go.opentelemetry.io/otel/semconv/v1.13.0/netconv` and `ClientRequest` or `ServerRequest` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`. + - The `SpanStatusFromHTTPStatusCode` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is replaced by `ClientStatus` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`. + - The `SpanStatusFromHTTPStatusCodeAndSpanKind` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is split into `ClientStatus` and `ServerStatus` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`. + - The `Client` function is included in `go.opentelemetry.io/otel/semconv/v1.13.0/netconv` to generate attributes for a `net.Conn`. + - The `Server` function is included in `go.opentelemetry.io/otel/semconv/v1.13.0/netconv` to generate attributes for a `net.Listener`. +- The `go.opentelemetry.io/otel/semconv/v1.14.0` package. + The package contains semantic conventions from the `v1.14.0` version of the OpenTelemetry specification. (#3566) +- The `go.opentelemetry.io/otel/semconv/v1.15.0` package. + The package contains semantic conventions from the `v1.15.0` version of the OpenTelemetry specification. (#3578) +- The `go.opentelemetry.io/otel/semconv/v1.16.0` package. + The package contains semantic conventions from the `v1.16.0` version of the OpenTelemetry specification. (#3579) +- Metric instruments to `go.opentelemetry.io/otel/metric/instrument`. + These instruments are use as replacements of the deprecated `go.opentelemetry.io/otel/metric/instrument/{asyncfloat64,asyncint64,syncfloat64,syncint64}` packages.(#3575, #3586) + - `Float64ObservableCounter` replaces the `asyncfloat64.Counter` + - `Float64ObservableUpDownCounter` replaces the `asyncfloat64.UpDownCounter` + - `Float64ObservableGauge` replaces the `asyncfloat64.Gauge` + - `Int64ObservableCounter` replaces the `asyncint64.Counter` + - `Int64ObservableUpDownCounter` replaces the `asyncint64.UpDownCounter` + - `Int64ObservableGauge` replaces the `asyncint64.Gauge` + - `Float64Counter` replaces the `syncfloat64.Counter` + - `Float64UpDownCounter` replaces the `syncfloat64.UpDownCounter` + - `Float64Histogram` replaces the `syncfloat64.Histogram` + - `Int64Counter` replaces the `syncint64.Counter` + - `Int64UpDownCounter` replaces the `syncint64.UpDownCounter` + - `Int64Histogram` replaces the `syncint64.Histogram` +- `NewTracerProvider` to `go.opentelemetry.io/otel/bridge/opentracing`. + This is used to create `WrapperTracer` instances from a `TracerProvider`. (#3116) +- The `Extrema` type to `go.opentelemetry.io/otel/sdk/metric/metricdata`. + This type is used to represent min/max values and still be able to distinguish unset and zero values. (#3487) +- The `go.opentelemetry.io/otel/semconv/v1.17.0` package. + The package contains semantic conventions from the `v1.17.0` version of the OpenTelemetry specification. (#3599) + +### Changed + +- Jaeger and Zipkin exporter use `github.com/go-logr/logr` as the logging interface, and add the `WithLogr` option. (#3497, #3500) +- Instrument configuration in `go.opentelemetry.io/otel/metric/instrument` is split into specific options and configuration based on the instrument type. (#3507) + - Use the added `Int64Option` type to configure instruments from `go.opentelemetry.io/otel/metric/instrument/syncint64`. + - Use the added `Float64Option` type to configure instruments from `go.opentelemetry.io/otel/metric/instrument/syncfloat64`. + - Use the added `Int64ObserverOption` type to configure instruments from `go.opentelemetry.io/otel/metric/instrument/asyncint64`. + - Use the added `Float64ObserverOption` type to configure instruments from `go.opentelemetry.io/otel/metric/instrument/asyncfloat64`. +- Return a `Registration` from the `RegisterCallback` method of a `Meter` in the `go.opentelemetry.io/otel/metric` package. + This `Registration` can be used to unregister callbacks. (#3522) +- Global error handler uses an atomic value instead of a mutex. (#3543) +- Add `NewMetricProducer` to `go.opentelemetry.io/otel/bridge/opencensus`, which can be used to pass OpenCensus metrics to an OpenTelemetry Reader. (#3541) +- Global logger uses an atomic value instead of a mutex. (#3545) +- The `Shutdown` method of the `"go.opentelemetry.io/otel/sdk/trace".TracerProvider` releases all computational resources when called the first time. (#3551) +- The `Sampler` returned from `TraceIDRatioBased` `go.opentelemetry.io/otel/sdk/trace` now uses the rightmost bits for sampling decisions. + This fixes random sampling when using ID generators like `xray.IDGenerator` and increasing parity with other language implementations. (#3557) +- Errors from `go.opentelemetry.io/otel/exporters/otlp/otlptrace` exporters are wrapped in errors identifying their signal name. + Existing users of the exporters attempting to identify specific errors will need to use `errors.Unwrap()` to get the underlying error. (#3516) +- Exporters from `go.opentelemetry.io/otel/exporters/otlp` will print the final retryable error message when attempts to retry time out. (#3514) +- The instrument kind names in `go.opentelemetry.io/otel/sdk/metric` are updated to match the API. (#3562) + - `InstrumentKindSyncCounter` is renamed to `InstrumentKindCounter` + - `InstrumentKindSyncUpDownCounter` is renamed to `InstrumentKindUpDownCounter` + - `InstrumentKindSyncHistogram` is renamed to `InstrumentKindHistogram` + - `InstrumentKindAsyncCounter` is renamed to `InstrumentKindObservableCounter` + - `InstrumentKindAsyncUpDownCounter` is renamed to `InstrumentKindObservableUpDownCounter` + - `InstrumentKindAsyncGauge` is renamed to `InstrumentKindObservableGauge` +- The `RegisterCallback` method of the `Meter` in `go.opentelemetry.io/otel/metric` changed. + - The named `Callback` replaces the inline function parameter. (#3564) + - `Callback` is required to return an error. (#3576) + - `Callback` accepts the added `Observer` parameter added. + This new parameter is used by `Callback` implementations to observe values for asynchronous instruments instead of calling the `Observe` method of the instrument directly. (#3584) + - The slice of `instrument.Asynchronous` is now passed as a variadic argument. (#3587) +- The exporter from `go.opentelemetry.io/otel/exporters/zipkin` is updated to use the `v1.16.0` version of semantic conventions. + This means it no longer uses the removed `net.peer.ip` or `http.host` attributes to determine the remote endpoint. + Instead it uses the `net.sock.peer` attributes. (#3581) +- The `Min` and `Max` fields of the `HistogramDataPoint` in `go.opentelemetry.io/otel/sdk/metric/metricdata` are now defined with the added `Extrema` type instead of a `*float64`. (#3487) + +### Fixed + +- Asynchronous instruments that use sum aggregators and attribute filters correctly add values from equivalent attribute sets that have been filtered. (#3439, #3549) +- The `RegisterCallback` method of the `Meter` from `go.opentelemetry.io/otel/sdk/metric` only registers a callback for instruments created by that meter. + Trying to register a callback with instruments from a different meter will result in an error being returned. (#3584) + +### Deprecated + +- The `NewMetricExporter` in `go.opentelemetry.io/otel/bridge/opencensus` is deprecated. + Use `NewMetricProducer` instead. (#3541) +- The `go.opentelemetry.io/otel/metric/instrument/asyncfloat64` package is deprecated. + Use the instruments from `go.opentelemetry.io/otel/metric/instrument` instead. (#3575) +- The `go.opentelemetry.io/otel/metric/instrument/asyncint64` package is deprecated. + Use the instruments from `go.opentelemetry.io/otel/metric/instrument` instead. (#3575) +- The `go.opentelemetry.io/otel/metric/instrument/syncfloat64` package is deprecated. + Use the instruments from `go.opentelemetry.io/otel/metric/instrument` instead. (#3575) +- The `go.opentelemetry.io/otel/metric/instrument/syncint64` package is deprecated. + Use the instruments from `go.opentelemetry.io/otel/metric/instrument` instead. (#3575) +- The `NewWrappedTracerProvider` in `go.opentelemetry.io/otel/bridge/opentracing` is now deprecated. + Use `NewTracerProvider` instead. (#3116) + +### Removed + +- The deprecated `go.opentelemetry.io/otel/sdk/metric/view` package is removed. (#3520) +- The `InstrumentProvider` from `go.opentelemetry.io/otel/sdk/metric/asyncint64` is removed. + Use the new creation methods of the `Meter` in `go.opentelemetry.io/otel/sdk/metric` instead. (#3530) + - The `Counter` method is replaced by `Meter.Int64ObservableCounter` + - The `UpDownCounter` method is replaced by `Meter.Int64ObservableUpDownCounter` + - The `Gauge` method is replaced by `Meter.Int64ObservableGauge` +- The `InstrumentProvider` from `go.opentelemetry.io/otel/sdk/metric/asyncfloat64` is removed. + Use the new creation methods of the `Meter` in `go.opentelemetry.io/otel/sdk/metric` instead. (#3530) + - The `Counter` method is replaced by `Meter.Float64ObservableCounter` + - The `UpDownCounter` method is replaced by `Meter.Float64ObservableUpDownCounter` + - The `Gauge` method is replaced by `Meter.Float64ObservableGauge` +- The `InstrumentProvider` from `go.opentelemetry.io/otel/sdk/metric/syncint64` is removed. + Use the new creation methods of the `Meter` in `go.opentelemetry.io/otel/sdk/metric` instead. (#3530) + - The `Counter` method is replaced by `Meter.Int64Counter` + - The `UpDownCounter` method is replaced by `Meter.Int64UpDownCounter` + - The `Histogram` method is replaced by `Meter.Int64Histogram` +- The `InstrumentProvider` from `go.opentelemetry.io/otel/sdk/metric/syncfloat64` is removed. + Use the new creation methods of the `Meter` in `go.opentelemetry.io/otel/sdk/metric` instead. (#3530) + - The `Counter` method is replaced by `Meter.Float64Counter` + - The `UpDownCounter` method is replaced by `Meter.Float64UpDownCounter` + - The `Histogram` method is replaced by `Meter.Float64Histogram` + +## [1.11.2/0.34.0] 2022-12-05 + +### Added + +- The `WithView` `Option` is added to the `go.opentelemetry.io/otel/sdk/metric` package. + This option is used to configure the view(s) a `MeterProvider` will use for all `Reader`s that are registered with it. (#3387) +- Add Instrumentation Scope and Version as info metric and label in Prometheus exporter. + This can be disabled using the `WithoutScopeInfo()` option added to that package.(#3273, #3357) +- OTLP exporters now recognize: (#3363) + - `OTEL_EXPORTER_OTLP_INSECURE` + - `OTEL_EXPORTER_OTLP_TRACES_INSECURE` + - `OTEL_EXPORTER_OTLP_METRICS_INSECURE` + - `OTEL_EXPORTER_OTLP_CLIENT_KEY` + - `OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY` + - `OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY` + - `OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE` + - `OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE` + - `OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE` +- The `View` type and related `NewView` function to create a view according to the OpenTelemetry specification are added to `go.opentelemetry.io/otel/sdk/metric`. + These additions are replacements for the `View` type and `New` function from `go.opentelemetry.io/otel/sdk/metric/view`. (#3459) +- The `Instrument` and `InstrumentKind` type are added to `go.opentelemetry.io/otel/sdk/metric`. + These additions are replacements for the `Instrument` and `InstrumentKind` types from `go.opentelemetry.io/otel/sdk/metric/view`. (#3459) +- The `Stream` type is added to `go.opentelemetry.io/otel/sdk/metric` to define a metric data stream a view will produce. (#3459) +- The `AssertHasAttributes` allows instrument authors to test that datapoints returned have appropriate attributes. (#3487) + +### Changed + +- The `"go.opentelemetry.io/otel/sdk/metric".WithReader` option no longer accepts views to associate with the `Reader`. + Instead, views are now registered directly with the `MeterProvider` via the new `WithView` option. + The views registered with the `MeterProvider` apply to all `Reader`s. (#3387) +- The `Temporality(view.InstrumentKind) metricdata.Temporality` and `Aggregation(view.InstrumentKind) aggregation.Aggregation` methods are added to the `"go.opentelemetry.io/otel/sdk/metric".Exporter` interface. (#3260) +- The `Temporality(view.InstrumentKind) metricdata.Temporality` and `Aggregation(view.InstrumentKind) aggregation.Aggregation` methods are added to the `"go.opentelemetry.io/otel/exporters/otlp/otlpmetric".Client` interface. (#3260) +- The `WithTemporalitySelector` and `WithAggregationSelector` `ReaderOption`s have been changed to `ManualReaderOption`s in the `go.opentelemetry.io/otel/sdk/metric` package. (#3260) +- The periodic reader in the `go.opentelemetry.io/otel/sdk/metric` package now uses the temporality and aggregation selectors from its configured exporter instead of accepting them as options. (#3260) + +### Fixed + +- The `go.opentelemetry.io/otel/exporters/prometheus` exporter fixes duplicated `_total` suffixes. (#3369) +- Remove comparable requirement for `Reader`s. (#3387) +- Cumulative metrics from the OpenCensus bridge (`go.opentelemetry.io/otel/bridge/opencensus`) are defined as monotonic sums, instead of non-monotonic. (#3389) +- Asynchronous counters (`Counter` and `UpDownCounter`) from the metric SDK now produce delta sums when configured with delta temporality. (#3398) +- Exported `Status` codes in the `go.opentelemetry.io/otel/exporters/zipkin` exporter are now exported as all upper case values. (#3340) +- `Aggregation`s from `go.opentelemetry.io/otel/sdk/metric` with no data are not exported. (#3394, #3436) +- Re-enabled Attribute Filters in the Metric SDK. (#3396) +- Asynchronous callbacks are only called if they are registered with at least one instrument that does not use drop aggragation. (#3408) +- Do not report empty partial-success responses in the `go.opentelemetry.io/otel/exporters/otlp` exporters. (#3438, #3432) +- Handle partial success responses in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` exporters. (#3162, #3440) +- Prevent duplicate Prometheus description, unit, and type. (#3469) +- Prevents panic when using incorrect `attribute.Value.As[Type]Slice()`. (#3489) + +### Removed + +- The `go.opentelemetry.io/otel/exporters/otlp/otlpmetric.Client` interface is removed. (#3486) +- The `go.opentelemetry.io/otel/exporters/otlp/otlpmetric.New` function is removed. Use the `otlpmetric[http|grpc].New` directly. (#3486) + +### Deprecated + +- The `go.opentelemetry.io/otel/sdk/metric/view` package is deprecated. + Use `Instrument`, `InstrumentKind`, `View`, and `NewView` in `go.opentelemetry.io/otel/sdk/metric` instead. (#3476) + +## [1.11.1/0.33.0] 2022-10-19 + +### Added + +- The Prometheus exporter in `go.opentelemetry.io/otel/exporters/prometheus` registers with a Prometheus registerer on creation. + By default, it will register with the default Prometheus registerer. + A non-default registerer can be used by passing the `WithRegisterer` option. (#3239) +- Added the `WithAggregationSelector` option to the `go.opentelemetry.io/otel/exporters/prometheus` package to change the default `AggregationSelector` used. (#3341) +- The Prometheus exporter in `go.opentelemetry.io/otel/exporters/prometheus` converts the `Resource` associated with metric exports into a `target_info` metric. (#3285) + +### Changed + +- The `"go.opentelemetry.io/otel/exporters/prometheus".New` function is updated to return an error. + It will return an error if the exporter fails to register with Prometheus. (#3239) + +### Fixed + +- The URL-encoded values from the `OTEL_RESOURCE_ATTRIBUTES` environment variable are decoded. (#2963) +- The `baggage.NewMember` function decodes the `value` parameter instead of directly using it. + This fixes the implementation to be compliant with the W3C specification. (#3226) +- Slice attributes of the `attribute` package are now comparable based on their value, not instance. (#3108 #3252) +- The `Shutdown` and `ForceFlush` methods of the `"go.opentelemetry.io/otel/sdk/trace".TraceProvider` no longer return an error when no processor is registered. (#3268) +- The Prometheus exporter in `go.opentelemetry.io/otel/exporters/prometheus` cumulatively sums histogram buckets. (#3281) +- The sum of each histogram data point is now uniquely exported by the `go.opentelemetry.io/otel/exporters/otlpmetric` exporters. (#3284, #3293) +- Recorded values for asynchronous counters (`Counter` and `UpDownCounter`) are interpreted as exact, not incremental, sum values by the metric SDK. (#3350, #3278) +- `UpDownCounters` are now correctly output as Prometheus gauges in the `go.opentelemetry.io/otel/exporters/prometheus` exporter. (#3358) +- The Prometheus exporter in `go.opentelemetry.io/otel/exporters/prometheus` no longer describes the metrics it will send to Prometheus on startup. + Instead the exporter is defined as an "unchecked" collector for Prometheus. + This fixes the `reader is not registered` warning currently emitted on startup. (#3291 #3342) +- The `go.opentelemetry.io/otel/exporters/prometheus` exporter now correctly adds `_total` suffixes to counter metrics. (#3360) +- The `go.opentelemetry.io/otel/exporters/prometheus` exporter now adds a unit suffix to metric names. + This can be disabled using the `WithoutUnits()` option added to that package. (#3352) + +## [1.11.0/0.32.3] 2022-10-12 + +### Added + +- Add default User-Agent header to OTLP exporter requests (`go.opentelemetry.io/otel/exporters/otlptrace/otlptracegrpc` and `go.opentelemetry.io/otel/exporters/otlptrace/otlptracehttp`). (#3261) + +### Changed + +- `span.SetStatus` has been updated such that calls that lower the status are now no-ops. (#3214) +- Upgrade `golang.org/x/sys/unix` from `v0.0.0-20210423185535-09eb48e85fd7` to `v0.0.0-20220919091848-fb04ddd9f9c8`. + This addresses [GO-2022-0493](https://pkg.go.dev/vuln/GO-2022-0493). (#3235) + +## [0.32.2] Metric SDK (Alpha) - 2022-10-11 + +### Added + +- Added an example of using metric views to customize instruments. (#3177) +- Add default User-Agent header to OTLP exporter requests (`go.opentelemetry.io/otel/exporters/otlpmetric/otlpmetricgrpc` and `go.opentelemetry.io/otel/exporters/otlpmetric/otlpmetrichttp`). (#3261) + +### Changed + +- Flush pending measurements with the `PeriodicReader` in the `go.opentelemetry.io/otel/sdk/metric` when `ForceFlush` or `Shutdown` are called. (#3220) +- Update histogram default bounds to match the requirements of the latest specification. (#3222) +- Encode the HTTP status code in the OpenTracing bridge (`go.opentelemetry.io/otel/bridge/opentracing`) as an integer. (#3265) + +### Fixed + +- Use default view if instrument does not match any registered view of a reader. (#3224, #3237) +- Return the same instrument every time a user makes the exact same instrument creation call. (#3229, #3251) +- Return the existing instrument when a view transforms a creation call to match an existing instrument. (#3240, #3251) +- Log a warning when a conflicting instrument (e.g. description, unit, data-type) is created instead of returning an error. (#3251) +- The OpenCensus bridge no longer sends empty batches of metrics. (#3263) + +## [0.32.1] Metric SDK (Alpha) - 2022-09-22 + +### Changed + +- The Prometheus exporter sanitizes OpenTelemetry instrument names when exporting. + Invalid characters are replaced with `_`. (#3212) + +### Added + +- The metric portion of the OpenCensus bridge (`go.opentelemetry.io/otel/bridge/opencensus`) has been reintroduced. (#3192) +- The OpenCensus bridge example (`go.opentelemetry.io/otel/example/opencensus`) has been reintroduced. (#3206) + +### Fixed + +- Updated go.mods to point to valid versions of the sdk. (#3216) +- Set the `MeterProvider` resource on all exported metric data. (#3218) + +## [0.32.0] Revised Metric SDK (Alpha) - 2022-09-18 + +### Changed + +- The metric SDK in `go.opentelemetry.io/otel/sdk/metric` is completely refactored to comply with the OpenTelemetry specification. + Please see the package documentation for how the new SDK is initialized and configured. (#3175) +- Update the minimum supported go version to go1.18. Removes support for go1.17 (#3179) + +### Removed + +- The metric portion of the OpenCensus bridge (`go.opentelemetry.io/otel/bridge/opencensus`) has been removed. + A new bridge compliant with the revised metric SDK will be added back in a future release. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/aggregator/aggregatortest` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/aggregator/histogram` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/aggregator/lastvalue` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/aggregator/sum` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/aggregator` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/controller/basic` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/controller/controllertest` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/controller/time` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/export/aggregation` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/export` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/metrictest` package is removed. + A replacement package that supports the new metric SDK will be added back in a future release. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/number` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/processor/basic` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/processor/processortest` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/processor/reducer` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/registry` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/sdkapi` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/selector/simple` package is removed, see the new metric SDK. (#3175) +- The `"go.opentelemetry.io/otel/sdk/metric".ErrUninitializedInstrument` variable was removed. (#3175) +- The `"go.opentelemetry.io/otel/sdk/metric".ErrBadInstrument` variable was removed. (#3175) +- The `"go.opentelemetry.io/otel/sdk/metric".Accumulator` type was removed, see the `MeterProvider`in the new metric SDK. (#3175) +- The `"go.opentelemetry.io/otel/sdk/metric".NewAccumulator` function was removed, see `NewMeterProvider`in the new metric SDK. (#3175) +- The deprecated `"go.opentelemetry.io/otel/sdk/metric".AtomicFieldOffsets` function was removed. (#3175) + +## [1.10.0] - 2022-09-09 + +### Added + +- Support Go 1.19. (#3077) + Include compatibility testing and document support. (#3077) +- Support the OTLP ExportTracePartialSuccess response; these are passed to the registered error handler. (#3106) +- Upgrade go.opentelemetry.io/proto/otlp from v0.18.0 to v0.19.0 (#3107) + +### Changed + +- Fix misidentification of OpenTelemetry `SpanKind` in OpenTracing bridge (`go.opentelemetry.io/otel/bridge/opentracing`). (#3096) +- Attempting to start a span with a nil `context` will no longer cause a panic. (#3110) +- All exporters will be shutdown even if one reports an error (#3091) +- Ensure valid UTF-8 when truncating over-length attribute values. (#3156) + +## [1.9.0/0.0.3] - 2022-08-01 + +### Added + +- Add support for Schema Files format 1.1.x (metric "split" transform) with the new `go.opentelemetry.io/otel/schema/v1.1` package. (#2999) +- Add the `go.opentelemetry.io/otel/semconv/v1.11.0` package. + The package contains semantic conventions from the `v1.11.0` version of the OpenTelemetry specification. (#3009) +- Add the `go.opentelemetry.io/otel/semconv/v1.12.0` package. + The package contains semantic conventions from the `v1.12.0` version of the OpenTelemetry specification. (#3010) +- Add the `http.method` attribute to HTTP server metric from all `go.opentelemetry.io/otel/semconv/*` packages. (#3018) + +### Fixed + +- Invalid warning for context setup being deferred in `go.opentelemetry.io/otel/bridge/opentracing` package. (#3029) + +## [1.8.0/0.31.0] - 2022-07-08 + +### Added + +- Add support for `opentracing.TextMap` format in the `Inject` and `Extract` methods +of the `"go.opentelemetry.io/otel/bridge/opentracing".BridgeTracer` type. (#2911) + +### Changed + +- The `crosslink` make target has been updated to use the `go.opentelemetry.io/build-tools/crosslink` package. (#2886) +- In the `go.opentelemetry.io/otel/sdk/instrumentation` package rename `Library` to `Scope` and alias `Library` as `Scope` (#2976) +- Move metric no-op implementation form `nonrecording` to `metric` package. (#2866) + +### Removed + +- Support for go1.16. Support is now only for go1.17 and go1.18 (#2917) + +### Deprecated + +- The `Library` struct in the `go.opentelemetry.io/otel/sdk/instrumentation` package is deprecated. + Use the equivalent `Scope` struct instead. (#2977) +- The `ReadOnlySpan.InstrumentationLibrary` method from the `go.opentelemetry.io/otel/sdk/trace` package is deprecated. + Use the equivalent `ReadOnlySpan.InstrumentationScope` method instead. (#2977) + +## [1.7.0/0.30.0] - 2022-04-28 + +### Added + +- Add the `go.opentelemetry.io/otel/semconv/v1.8.0` package. + The package contains semantic conventions from the `v1.8.0` version of the OpenTelemetry specification. (#2763) +- Add the `go.opentelemetry.io/otel/semconv/v1.9.0` package. + The package contains semantic conventions from the `v1.9.0` version of the OpenTelemetry specification. (#2792) +- Add the `go.opentelemetry.io/otel/semconv/v1.10.0` package. + The package contains semantic conventions from the `v1.10.0` version of the OpenTelemetry specification. (#2842) +- Added an in-memory exporter to metrictest to aid testing with a full SDK. (#2776) + +### Fixed + +- Globally delegated instruments are unwrapped before delegating asynchronous callbacks. (#2784) +- Remove import of `testing` package in non-tests builds of the `go.opentelemetry.io/otel` package. (#2786) + +### Changed + +- The `WithLabelEncoder` option from the `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` package is renamed to `WithAttributeEncoder`. (#2790) +- The `LabelFilterSelector` interface from `go.opentelemetry.io/otel/sdk/metric/processor/reducer` is renamed to `AttributeFilterSelector`. + The method included in the renamed interface also changed from `LabelFilterFor` to `AttributeFilterFor`. (#2790) +- The `Metadata.Labels` method from the `go.opentelemetry.io/otel/sdk/metric/export` package is renamed to `Metadata.Attributes`. + Consequentially, the `Record` type from the same package also has had the embedded method renamed. (#2790) + +### Deprecated + +- The `Iterator.Label` method in the `go.opentelemetry.io/otel/attribute` package is deprecated. + Use the equivalent `Iterator.Attribute` method instead. (#2790) +- The `Iterator.IndexedLabel` method in the `go.opentelemetry.io/otel/attribute` package is deprecated. + Use the equivalent `Iterator.IndexedAttribute` method instead. (#2790) +- The `MergeIterator.Label` method in the `go.opentelemetry.io/otel/attribute` package is deprecated. + Use the equivalent `MergeIterator.Attribute` method instead. (#2790) + +### Removed + +- Removed the `Batch` type from the `go.opentelemetry.io/otel/sdk/metric/metrictest` package. (#2864) +- Removed the `Measurement` type from the `go.opentelemetry.io/otel/sdk/metric/metrictest` package. (#2864) + +## [0.29.0] - 2022-04-11 + +### Added + +- The metrics global package was added back into several test files. (#2764) +- The `Meter` function is added back to the `go.opentelemetry.io/otel/metric/global` package. + This function is a convenience function equivalent to calling `global.MeterProvider().Meter(...)`. (#2750) + +### Removed + +- Removed module the `go.opentelemetry.io/otel/sdk/export/metric`. + Use the `go.opentelemetry.io/otel/sdk/metric` module instead. (#2720) + +### Changed + +- Don't panic anymore when setting a global MeterProvider to itself. (#2749) +- Upgrade `go.opentelemetry.io/proto/otlp` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` from `v0.12.1` to `v0.15.0`. + This replaces the use of the now deprecated `InstrumentationLibrary` and `InstrumentationLibraryMetrics` types and fields in the proto library with the equivalent `InstrumentationScope` and `ScopeMetrics`. (#2748) + +## [1.6.3] - 2022-04-07 + +### Fixed + +- Allow non-comparable global `MeterProvider`, `TracerProvider`, and `TextMapPropagator` types to be set. (#2772, #2773) + +## [1.6.2] - 2022-04-06 + +### Changed + +- Don't panic anymore when setting a global TracerProvider or TextMapPropagator to itself. (#2749) +- Upgrade `go.opentelemetry.io/proto/otlp` in `go.opentelemetry.io/otel/exporters/otlp/otlptrace` from `v0.12.1` to `v0.15.0`. + This replaces the use of the now deprecated `InstrumentationLibrary` and `InstrumentationLibrarySpans` types and fields in the proto library with the equivalent `InstrumentationScope` and `ScopeSpans`. (#2748) + +## [1.6.1] - 2022-03-28 + +### Fixed + +- The `go.opentelemetry.io/otel/schema/*` packages now use the correct schema URL for their `SchemaURL` constant. + Instead of using `"https://opentelemetry.io/schemas/v"` they now use the correct URL without a `v` prefix, `"https://opentelemetry.io/schemas/"`. (#2743, #2744) + +### Security + +- Upgrade `go.opentelemetry.io/proto/otlp` from `v0.12.0` to `v0.12.1`. + This includes an indirect upgrade of `github.com/grpc-ecosystem/grpc-gateway` which resolves [a vulnerability](https://nvd.nist.gov/vuln/detail/CVE-2019-11254) from `gopkg.in/yaml.v2` in version `v2.2.3`. (#2724, #2728) + +## [1.6.0/0.28.0] - 2022-03-23 + +### ⚠️ Notice ⚠️ + +This update is a breaking change of the unstable Metrics API. +Code instrumented with the `go.opentelemetry.io/otel/metric` will need to be modified. + +### Added + +- Add metrics exponential histogram support. + New mapping functions have been made available in `sdk/metric/aggregator/exponential/mapping` for other OpenTelemetry projects to take dependencies on. (#2502) +- Add Go 1.18 to our compatibility tests. (#2679) +- Allow configuring the Sampler with the `OTEL_TRACES_SAMPLER` and `OTEL_TRACES_SAMPLER_ARG` environment variables. (#2305, #2517) +- Add the `metric/global` for obtaining and setting the global `MeterProvider`. (#2660) + +### Changed + +- The metrics API has been significantly changed to match the revised OpenTelemetry specification. + High-level changes include: + + - Synchronous and asynchronous instruments are now handled by independent `InstrumentProvider`s. + These `InstrumentProvider`s are managed with a `Meter`. + - Synchronous and asynchronous instruments are grouped into their own packages based on value types. + - Asynchronous callbacks can now be registered with a `Meter`. + + Be sure to check out the metric module documentation for more information on how to use the revised API. (#2587, #2660) + +### Fixed + +- Fallback to general attribute limits when span specific ones are not set in the environment. (#2675, #2677) + +## [1.5.0] - 2022-03-16 + +### Added + +- Log the Exporters configuration in the TracerProviders message. (#2578) +- Added support to configure the span limits with environment variables. + The following environment variables are supported. (#2606, #2637) + - `OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT` + - `OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT` + - `OTEL_SPAN_EVENT_COUNT_LIMIT` + - `OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT` + - `OTEL_SPAN_LINK_COUNT_LIMIT` + - `OTEL_LINK_ATTRIBUTE_COUNT_LIMIT` + + If the provided environment variables are invalid (negative), the default values would be used. +- Rename the `gc` runtime name to `go` (#2560) +- Add resource container ID detection. (#2418) +- Add span attribute value length limit. + The new `AttributeValueLengthLimit` field is added to the `"go.opentelemetry.io/otel/sdk/trace".SpanLimits` type to configure this limit for a `TracerProvider`. + The default limit for this resource is "unlimited". (#2637) +- Add the `WithRawSpanLimits` option to `go.opentelemetry.io/otel/sdk/trace`. + This option replaces the `WithSpanLimits` option. + Zero or negative values will not be changed to the default value like `WithSpanLimits` does. + Setting a limit to zero will effectively disable the related resource it limits and setting to a negative value will mean that resource is unlimited. + Consequentially, limits should be constructed using `NewSpanLimits` and updated accordingly. (#2637) + +### Changed + +- Drop oldest tracestate `Member` when capacity is reached. (#2592) +- Add event and link drop counts to the exported data from the `oltptrace` exporter. (#2601) +- Unify path cleaning functionally in the `otlpmetric` and `otlptrace` configuration. (#2639) +- Change the debug message from the `sdk/trace.BatchSpanProcessor` to reflect the count is cumulative. (#2640) +- Introduce new internal `envconfig` package for OTLP exporters. (#2608) +- If `http.Request.Host` is empty, fall back to use `URL.Host` when populating `http.host` in the `semconv` packages. (#2661) + +### Fixed + +- Remove the OTLP trace exporter limit of SpanEvents when exporting. (#2616) +- Default to port `4318` instead of `4317` for the `otlpmetrichttp` and `otlptracehttp` client. (#2614, #2625) +- Unlimited span limits are now supported (negative values). (#2636, #2637) + +### Deprecated + +- Deprecated `"go.opentelemetry.io/otel/sdk/trace".WithSpanLimits`. + Use `WithRawSpanLimits` instead. + That option allows setting unlimited and zero limits, this option does not. + This option will be kept until the next major version incremented release. (#2637) + +## [1.4.1] - 2022-02-16 + +### Fixed + +- Fix race condition in reading the dropped spans number for the `BatchSpanProcessor`. (#2615) + +## [1.4.0] - 2022-02-11 + +### Added + +- Use `OTEL_EXPORTER_ZIPKIN_ENDPOINT` environment variable to specify zipkin collector endpoint. (#2490) +- Log the configuration of `TracerProvider`s, and `Tracer`s for debugging. + To enable use a logger with Verbosity (V level) `>=1`. (#2500) +- Added support to configure the batch span-processor with environment variables. + The following environment variables are used. (#2515) + - `OTEL_BSP_SCHEDULE_DELAY` + - `OTEL_BSP_EXPORT_TIMEOUT` + - `OTEL_BSP_MAX_QUEUE_SIZE`. + - `OTEL_BSP_MAX_EXPORT_BATCH_SIZE` + +### Changed + +- Zipkin exporter exports `Resource` attributes in the `Tags` field. (#2589) + +### Deprecated + +- Deprecate module the `go.opentelemetry.io/otel/sdk/export/metric`. + Use the `go.opentelemetry.io/otel/sdk/metric` module instead. (#2382) +- Deprecate `"go.opentelemetry.io/otel/sdk/metric".AtomicFieldOffsets`. (#2445) + +### Fixed + +- Fixed the instrument kind for noop async instruments to correctly report an implementation. (#2461) +- Fix UDP packets overflowing with Jaeger payloads. (#2489, #2512) +- Change the `otlpmetric.Client` interface's `UploadMetrics` method to accept a single `ResourceMetrics` instead of a slice of them. (#2491) +- Specify explicit buckets in Prometheus example, fixing issue where example only has `+inf` bucket. (#2419, #2493) +- W3C baggage will now decode urlescaped values. (#2529) +- Baggage members are now only validated once, when calling `NewMember` and not also when adding it to the baggage itself. (#2522) +- The order attributes are dropped from spans in the `go.opentelemetry.io/otel/sdk/trace` package when capacity is reached is fixed to be in compliance with the OpenTelemetry specification. + Instead of dropping the least-recently-used attribute, the last added attribute is dropped. + This drop order still only applies to attributes with unique keys not already contained in the span. + If an attribute is added with a key already contained in the span, that attribute is updated to the new value being added. (#2576) + +### Removed + +- Updated `go.opentelemetry.io/proto/otlp` from `v0.11.0` to `v0.12.0`. This version removes a number of deprecated methods. (#2546) + - [`Metric.GetIntGauge()`](https://pkg.go.dev/go.opentelemetry.io/proto/otlp@v0.11.0/metrics/v1#Metric.GetIntGauge) + - [`Metric.GetIntHistogram()`](https://pkg.go.dev/go.opentelemetry.io/proto/otlp@v0.11.0/metrics/v1#Metric.GetIntHistogram) + - [`Metric.GetIntSum()`](https://pkg.go.dev/go.opentelemetry.io/proto/otlp@v0.11.0/metrics/v1#Metric.GetIntSum) + +## [1.3.0] - 2021-12-10 + +### ⚠️ Notice ⚠️ + +We have updated the project minimum supported Go version to 1.16 + +### Added + +- Added an internal Logger. + This can be used by the SDK and API to provide users with feedback of the internal state. + To enable verbose logs configure the logger which will print V(1) logs. For debugging information configure to print V(5) logs. (#2343) +- Add the `WithRetry` `Option` and the `RetryConfig` type to the `go.opentelemetry.io/otel/exporter/otel/otlpmetric/otlpmetrichttp` package to specify retry behavior consistently. (#2425) +- Add `SpanStatusFromHTTPStatusCodeAndSpanKind` to all `semconv` packages to return a span status code similar to `SpanStatusFromHTTPStatusCode`, but exclude `4XX` HTTP errors as span errors if the span is of server kind. (#2296) + +### Changed + +- The `"go.opentelemetry.io/otel/exporter/otel/otlptrace/otlptracegrpc".Client` now uses the underlying gRPC `ClientConn` to handle name resolution, TCP connection establishment (with retries and backoff) and TLS handshakes, and handling errors on established connections by re-resolving the name and reconnecting. (#2329) +- The `"go.opentelemetry.io/otel/exporter/otel/otlpmetric/otlpmetricgrpc".Client` now uses the underlying gRPC `ClientConn` to handle name resolution, TCP connection establishment (with retries and backoff) and TLS handshakes, and handling errors on established connections by re-resolving the name and reconnecting. (#2425) +- The `"go.opentelemetry.io/otel/exporter/otel/otlpmetric/otlpmetricgrpc".RetrySettings` type is renamed to `RetryConfig`. (#2425) +- The `go.opentelemetry.io/otel/exporter/otel/*` gRPC exporters now default to using the host's root CA set if none are provided by the user and `WithInsecure` is not specified. (#2432) +- Change `resource.Default` to be evaluated the first time it is called, rather than on import. This allows the caller the option to update `OTEL_RESOURCE_ATTRIBUTES` first, such as with `os.Setenv`. (#2371) + +### Fixed + +- The `go.opentelemetry.io/otel/exporter/otel/*` exporters are updated to handle per-signal and universal endpoints according to the OpenTelemetry specification. + Any per-signal endpoint set via an `OTEL_EXPORTER_OTLP__ENDPOINT` environment variable is now used without modification of the path. + When `OTEL_EXPORTER_OTLP_ENDPOINT` is set, if it contains a path, that path is used as a base path which per-signal paths are appended to. (#2433) +- Basic metric controller updated to use sync.Map to avoid blocking calls (#2381) +- The `go.opentelemetry.io/otel/exporter/jaeger` correctly sets the `otel.status_code` value to be a string of `ERROR` or `OK` instead of an integer code. (#2439, #2440) + +### Deprecated + +- Deprecated the `"go.opentelemetry.io/otel/exporter/otel/otlpmetric/otlpmetrichttp".WithMaxAttempts` `Option`, use the new `WithRetry` `Option` instead. (#2425) +- Deprecated the `"go.opentelemetry.io/otel/exporter/otel/otlpmetric/otlpmetrichttp".WithBackoff` `Option`, use the new `WithRetry` `Option` instead. (#2425) + +### Removed + +- Remove the metric Processor's ability to convert cumulative to delta aggregation temporality. (#2350) +- Remove the metric Bound Instruments interface and implementations. (#2399) +- Remove the metric MinMaxSumCount kind aggregation and the corresponding OTLP export path. (#2423) +- Metric SDK removes the "exact" aggregator for histogram instruments, as it performed a non-standard aggregation for OTLP export (creating repeated Gauge points) and worked its way into a number of confusing examples. (#2348) + +## [1.2.0] - 2021-11-12 + +### Changed + +- Metric SDK `export.ExportKind`, `export.ExportKindSelector` types have been renamed to `aggregation.Temporality` and `aggregation.TemporalitySelector` respectively to keep in line with current specification and protocol along with built-in selectors (e.g., `aggregation.CumulativeTemporalitySelector`, ...). (#2274) +- The Metric `Exporter` interface now requires a `TemporalitySelector` method instead of an `ExportKindSelector`. (#2274) +- Metrics API cleanup. The `metric/sdkapi` package has been created to relocate the API-to-SDK interface: + - The following interface types simply moved from `metric` to `metric/sdkapi`: `Descriptor`, `MeterImpl`, `InstrumentImpl`, `SyncImpl`, `BoundSyncImpl`, `AsyncImpl`, `AsyncRunner`, `AsyncSingleRunner`, and `AsyncBatchRunner` + - The following struct types moved and are replaced with type aliases, since they are exposed to the user: `Observation`, `Measurement`. + - The No-op implementations of sync and async instruments are no longer exported, new functions `sdkapi.NewNoopAsyncInstrument()` and `sdkapi.NewNoopSyncInstrument()` are provided instead. (#2271) +- Update the SDK `BatchSpanProcessor` to export all queued spans when `ForceFlush` is called. (#2080, #2335) + +### Added + +- Add the `"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc".WithGRPCConn` option so the exporter can reuse an existing gRPC connection. (#2002) +- Added a new `schema` module to help parse Schema Files in OTEP 0152 format. (#2267) +- Added a new `MapCarrier` to the `go.opentelemetry.io/otel/propagation` package to hold propagated cross-cutting concerns as a `map[string]string` held in memory. (#2334) + +## [1.1.0] - 2021-10-27 + +### Added + +- Add the `"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc".WithGRPCConn` option so the exporter can reuse an existing gRPC connection. (#2002) +- Add the `go.opentelemetry.io/otel/semconv/v1.7.0` package. + The package contains semantic conventions from the `v1.7.0` version of the OpenTelemetry specification. (#2320) +- Add the `go.opentelemetry.io/otel/semconv/v1.6.1` package. + The package contains semantic conventions from the `v1.6.1` version of the OpenTelemetry specification. (#2321) +- Add the `go.opentelemetry.io/otel/semconv/v1.5.0` package. + The package contains semantic conventions from the `v1.5.0` version of the OpenTelemetry specification. (#2322) + - When upgrading from the `semconv/v1.4.0` package note the following name changes: + - `K8SReplicasetUIDKey` -> `K8SReplicaSetUIDKey` + - `K8SReplicasetNameKey` -> `K8SReplicaSetNameKey` + - `K8SStatefulsetUIDKey` -> `K8SStatefulSetUIDKey` + - `k8SStatefulsetNameKey` -> `K8SStatefulSetNameKey` + - `K8SDaemonsetUIDKey` -> `K8SDaemonSetUIDKey` + - `K8SDaemonsetNameKey` -> `K8SDaemonSetNameKey` + +### Changed + +- Links added to a span will be dropped by the SDK if they contain an invalid span context (#2275). + +### Fixed + +- The `"go.opentelemetry.io/otel/semconv/v1.4.0".HTTPServerAttributesFromHTTPRequest` now correctly only sets the HTTP client IP attribute even if the connection was routed with proxies and there are multiple addresses in the `X-Forwarded-For` header. (#2282, #2284) +- The `"go.opentelemetry.io/otel/semconv/v1.4.0".NetAttributesFromHTTPRequest` function correctly handles IPv6 addresses as IP addresses and sets the correct net peer IP instead of the net peer hostname attribute. (#2283, #2285) +- The simple span processor shutdown method deterministically returns the exporter error status if it simultaneously finishes when the deadline is reached. (#2290, #2289) + +## [1.0.1] - 2021-10-01 + +### Fixed + +- json stdout exporter no longer crashes due to concurrency bug. (#2265) + +## [Metrics 0.24.0] - 2021-10-01 + +### Changed + +- NoopMeterProvider is now private and NewNoopMeterProvider must be used to obtain a noopMeterProvider. (#2237) +- The Metric SDK `Export()` function takes a new two-level reader interface for iterating over results one instrumentation library at a time. (#2197) + - The former `"go.opentelemetry.io/otel/sdk/export/metric".CheckpointSet` is renamed `Reader`. + - The new interface is named `"go.opentelemetry.io/otel/sdk/export/metric".InstrumentationLibraryReader`. + +## [1.0.0] - 2021-09-20 + +This is the first stable release for the project. +This release includes an API and SDK for the tracing signal that will comply with the stability guarantees defined by the projects [versioning policy](./VERSIONING.md). + +### Added + +- OTLP trace exporter now sets the `SchemaURL` field in the exported telemetry if the Tracer has `WithSchemaURL` option. (#2242) + +### Fixed + +- Slice-valued attributes can correctly be used as map keys. (#2223) + +### Removed + +- Removed the `"go.opentelemetry.io/otel/exporters/zipkin".WithSDKOptions` function. (#2248) +- Removed the deprecated package `go.opentelemetry.io/otel/oteltest`. (#2234) +- Removed the deprecated package `go.opentelemetry.io/otel/bridge/opencensus/utils`. (#2233) +- Removed deprecated functions, types, and methods from `go.opentelemetry.io/otel/attribute` package. + Use the typed functions and methods added to the package instead. (#2235) + - The `Key.Array` method is removed. + - The `Array` function is removed. + - The `Any` function is removed. + - The `ArrayValue` function is removed. + - The `AsArray` function is removed. + +## [1.0.0-RC3] - 2021-09-02 + +### Added + +- Added `ErrorHandlerFunc` to use a function as an `"go.opentelemetry.io/otel".ErrorHandler`. (#2149) +- Added `"go.opentelemetry.io/otel/trace".WithStackTrace` option to add a stack trace when using `span.RecordError` or when panic is handled in `span.End`. (#2163) +- Added typed slice attribute types and functionality to the `go.opentelemetry.io/otel/attribute` package to replace the existing array type and functions. (#2162) + - `BoolSlice`, `IntSlice`, `Int64Slice`, `Float64Slice`, and `StringSlice` replace the use of the `Array` function in the package. +- Added the `go.opentelemetry.io/otel/example/fib` example package. + Included is an example application that computes Fibonacci numbers. (#2203) + +### Changed + +- Metric instruments have been renamed to match the (feature-frozen) metric API specification: + - ValueRecorder becomes Histogram + - ValueObserver becomes Gauge + - SumObserver becomes CounterObserver + - UpDownSumObserver becomes UpDownCounterObserver + The API exported from this project is still considered experimental. (#2202) +- Metric SDK/API implementation type `InstrumentKind` moves into `sdkapi` sub-package. (#2091) +- The Metrics SDK export record no longer contains a Resource pointer, the SDK `"go.opentelemetry.io/otel/sdk/trace/export/metric".Exporter.Export()` function for push-based exporters now takes a single Resource argument, pull-based exporters use `"go.opentelemetry.io/otel/sdk/metric/controller/basic".Controller.Resource()`. (#2120) +- The JSON output of the `go.opentelemetry.io/otel/exporters/stdout/stdouttrace` is harmonized now such that the output is "plain" JSON objects after each other of the form `{ ... } { ... } { ... }`. Earlier the JSON objects describing a span were wrapped in a slice for each `Exporter.ExportSpans` call, like `[ { ... } ][ { ... } { ... } ]`. Outputting JSON object directly after each other is consistent with JSON loggers, and a bit easier to parse and read. (#2196) +- Update the `NewTracerConfig`, `NewSpanStartConfig`, `NewSpanEndConfig`, and `NewEventConfig` function in the `go.opentelemetry.io/otel/trace` package to return their respective configurations as structs instead of pointers to the struct. (#2212) + +### Deprecated + +- The `go.opentelemetry.io/otel/bridge/opencensus/utils` package is deprecated. + All functionality from this package now exists in the `go.opentelemetry.io/otel/bridge/opencensus` package. + The functions from that package should be used instead. (#2166) +- The `"go.opentelemetry.io/otel/attribute".Array` function and the related `ARRAY` value type is deprecated. + Use the typed `*Slice` functions and types added to the package instead. (#2162) +- The `"go.opentelemetry.io/otel/attribute".Any` function is deprecated. + Use the typed functions instead. (#2181) +- The `go.opentelemetry.io/otel/oteltest` package is deprecated. + The `"go.opentelemetry.io/otel/sdk/trace/tracetest".SpanRecorder` can be registered with the default SDK (`go.opentelemetry.io/otel/sdk/trace`) as a `SpanProcessor` and used as a replacement for this deprecated package. (#2188) + +### Removed + +- Removed metrics test package `go.opentelemetry.io/otel/sdk/export/metric/metrictest`. (#2105) + +### Fixed + +- The `fromEnv` detector no longer throws an error when `OTEL_RESOURCE_ATTRIBUTES` environment variable is not set or empty. (#2138) +- Setting the global `ErrorHandler` with `"go.opentelemetry.io/otel".SetErrorHandler` multiple times is now supported. (#2160, #2140) +- The `"go.opentelemetry.io/otel/attribute".Any` function now supports `int32` values. (#2169) +- Multiple calls to `"go.opentelemetry.io/otel/sdk/metric/controller/basic".WithResource()` are handled correctly, and when no resources are provided `"go.opentelemetry.io/otel/sdk/resource".Default()` is used. (#2120) +- The `WithoutTimestamps` option for the `go.opentelemetry.io/otel/exporters/stdout/stdouttrace` exporter causes the exporter to correctly omit timestamps. (#2195) +- Fixed typos in resources.go. (#2201) + +## [1.0.0-RC2] - 2021-07-26 + +### Added + +- Added `WithOSDescription` resource configuration option to set OS (Operating System) description resource attribute (`os.description`). (#1840) +- Added `WithOS` resource configuration option to set all OS (Operating System) resource attributes at once. (#1840) +- Added the `WithRetry` option to the `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp` package. + This option is a replacement for the removed `WithMaxAttempts` and `WithBackoff` options. (#2095) +- Added API `LinkFromContext` to return Link which encapsulates SpanContext from provided context and also encapsulates attributes. (#2115) +- Added a new `Link` type under the SDK `otel/sdk/trace` package that counts the number of attributes that were dropped for surpassing the `AttributePerLinkCountLimit` configured in the Span's `SpanLimits`. + This new type replaces the equal-named API `Link` type found in the `otel/trace` package for most usages within the SDK. + For example, instances of this type are now returned by the `Links()` function of `ReadOnlySpan`s provided in places like the `OnEnd` function of `SpanProcessor` implementations. (#2118) +- Added the `SpanRecorder` type to the `go.opentelemetry.io/otel/skd/trace/tracetest` package. + This type can be used with the default SDK as a `SpanProcessor` during testing. (#2132) + +### Changed + +- The `SpanModels` function is now exported from the `go.opentelemetry.io/otel/exporters/zipkin` package to convert OpenTelemetry spans into Zipkin model spans. (#2027) +- Rename the `"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc".RetrySettings` to `RetryConfig`. (#2095) + +### Deprecated + +- The `TextMapCarrier` and `TextMapPropagator` from the `go.opentelemetry.io/otel/oteltest` package and their associated creation functions (`TextMapCarrier`, `NewTextMapPropagator`) are deprecated. (#2114) +- The `Harness` type from the `go.opentelemetry.io/otel/oteltest` package and its associated creation function, `NewHarness` are deprecated and will be removed in the next release. (#2123) +- The `TraceStateFromKeyValues` function from the `go.opentelemetry.io/otel/oteltest` package is deprecated. + Use the `trace.ParseTraceState` function instead. (#2122) + +### Removed + +- Removed the deprecated package `go.opentelemetry.io/otel/exporters/trace/jaeger`. (#2020) +- Removed the deprecated package `go.opentelemetry.io/otel/exporters/trace/zipkin`. (#2020) +- Removed the `"go.opentelemetry.io/otel/sdk/resource".WithBuiltinDetectors` function. + The explicit `With*` options for every built-in detector should be used instead. (#2026 #2097) +- Removed the `WithMaxAttempts` and `WithBackoff` options from the `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp` package. + The retry logic of the package has been updated to match the `otlptracegrpc` package and accordingly a `WithRetry` option is added that should be used instead. (#2095) +- Removed `DroppedAttributeCount` field from `otel/trace.Link` struct. (#2118) + +### Fixed + +- When using WithNewRoot, don't use the parent context for making sampling decisions. (#2032) +- `oteltest.Tracer` now creates a valid `SpanContext` when using `WithNewRoot`. (#2073) +- OS type detector now sets the correct `dragonflybsd` value for DragonFly BSD. (#2092) +- The OTel span status is correctly transformed into the OTLP status in the `go.opentelemetry.io/otel/exporters/otlp/otlptrace` package. + This fix will by default set the status to `Unset` if it is not explicitly set to `Ok` or `Error`. (#2099 #2102) +- The `Inject` method for the `"go.opentelemetry.io/otel/propagation".TraceContext` type no longer injects empty `tracestate` values. (#2108) +- Use `6831` as default Jaeger agent port instead of `6832`. (#2131) + +## [Experimental Metrics v0.22.0] - 2021-07-19 + +### Added + +- Adds HTTP support for OTLP metrics exporter. (#2022) + +### Removed + +- Removed the deprecated package `go.opentelemetry.io/otel/exporters/metric/prometheus`. (#2020) + +## [1.0.0-RC1] / 0.21.0 - 2021-06-18 + +With this release we are introducing a split in module versions. The tracing API and SDK are entering the `v1.0.0` Release Candidate phase with `v1.0.0-RC1` +while the experimental metrics API and SDK continue with `v0.x` releases at `v0.21.0`. Modules at major version 1 or greater will not depend on modules +with major version 0. + +### Added + +- Adds `otlpgrpc.WithRetry`option for configuring the retry policy for transient errors on the otlp/gRPC exporter. (#1832) + - The following status codes are defined as transient errors: + | gRPC Status Code | Description | + | ---------------- | ----------- | + | 1 | Cancelled | + | 4 | Deadline Exceeded | + | 8 | Resource Exhausted | + | 10 | Aborted | + | 10 | Out of Range | + | 14 | Unavailable | + | 15 | Data Loss | +- Added `Status` type to the `go.opentelemetry.io/otel/sdk/trace` package to represent the status of a span. (#1874) +- Added `SpanStub` type and its associated functions to the `go.opentelemetry.io/otel/sdk/trace/tracetest` package. + This type can be used as a testing replacement for the `SpanSnapshot` that was removed from the `go.opentelemetry.io/otel/sdk/trace` package. (#1873) +- Adds support for scheme in `OTEL_EXPORTER_OTLP_ENDPOINT` according to the spec. (#1886) +- Adds `trace.WithSchemaURL` option for configuring the tracer with a Schema URL. (#1889) +- Added an example of using OpenTelemetry Go as a trace context forwarder. (#1912) +- `ParseTraceState` is added to the `go.opentelemetry.io/otel/trace` package. + It can be used to decode a `TraceState` from a `tracestate` header string value. (#1937) +- Added `Len` method to the `TraceState` type in the `go.opentelemetry.io/otel/trace` package. + This method returns the number of list-members the `TraceState` holds. (#1937) +- Creates package `go.opentelemetry.io/otel/exporters/otlp/otlptrace` that defines a trace exporter that uses a `otlptrace.Client` to send data. + Creates package `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc` implementing a gRPC `otlptrace.Client` and offers convenience functions, `NewExportPipeline` and `InstallNewPipeline`, to setup and install a `otlptrace.Exporter` in tracing .(#1922) +- Added `Baggage`, `Member`, and `Property` types to the `go.opentelemetry.io/otel/baggage` package along with their related functions. (#1967) +- Added `ContextWithBaggage`, `ContextWithoutBaggage`, and `FromContext` functions to the `go.opentelemetry.io/otel/baggage` package. + These functions replace the `Set`, `Value`, `ContextWithValue`, `ContextWithoutValue`, and `ContextWithEmpty` functions from that package and directly work with the new `Baggage` type. (#1967) +- The `OTEL_SERVICE_NAME` environment variable is the preferred source for `service.name`, used by the environment resource detector if a service name is present both there and in `OTEL_RESOURCE_ATTRIBUTES`. (#1969) +- Creates package `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp` implementing an HTTP `otlptrace.Client` and offers convenience functions, `NewExportPipeline` and `InstallNewPipeline`, to setup and install a `otlptrace.Exporter` in tracing. (#1963) +- Changes `go.opentelemetry.io/otel/sdk/resource.NewWithAttributes` to require a schema URL. The old function is still available as `resource.NewSchemaless`. This is a breaking change. (#1938) +- Several builtin resource detectors now correctly populate the schema URL. (#1938) +- Creates package `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` that defines a metrics exporter that uses a `otlpmetric.Client` to send data. +- Creates package `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` implementing a gRPC `otlpmetric.Client` and offers convenience functions, `New` and `NewUnstarted`, to create an `otlpmetric.Exporter`.(#1991) +- Added `go.opentelemetry.io/otel/exporters/stdout/stdouttrace` exporter. (#2005) +- Added `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` exporter. (#2005) +- Added a `TracerProvider()` method to the `"go.opentelemetry.io/otel/trace".Span` interface. This can be used to obtain a `TracerProvider` from a given span that utilizes the same trace processing pipeline. (#2009) + +### Changed + +- Make `NewSplitDriver` from `go.opentelemetry.io/otel/exporters/otlp` take variadic arguments instead of a `SplitConfig` item. + `NewSplitDriver` now automatically implements an internal `noopDriver` for `SplitConfig` fields that are not initialized. (#1798) +- `resource.New()` now creates a Resource without builtin detectors. Previous behavior is now achieved by using `WithBuiltinDetectors` Option. (#1810) +- Move the `Event` type from the `go.opentelemetry.io/otel` package to the `go.opentelemetry.io/otel/sdk/trace` package. (#1846) +- CI builds validate against last two versions of Go, dropping 1.14 and adding 1.16. (#1865) +- BatchSpanProcessor now report export failures when calling `ForceFlush()` method. (#1860) +- `Set.Encoded(Encoder)` no longer caches the result of an encoding. (#1855) +- Renamed `CloudZoneKey` to `CloudAvailabilityZoneKey` in Resource semantic conventions according to spec. (#1871) +- The `StatusCode` and `StatusMessage` methods of the `ReadOnlySpan` interface and the `Span` produced by the `go.opentelemetry.io/otel/sdk/trace` package have been replaced with a single `Status` method. + This method returns the status of a span using the new `Status` type. (#1874) +- Updated `ExportSpans` method of the`SpanExporter` interface type to accept `ReadOnlySpan`s instead of the removed `SpanSnapshot`. + This brings the export interface into compliance with the specification in that it now accepts an explicitly immutable type instead of just an implied one. (#1873) +- Unembed `SpanContext` in `Link`. (#1877) +- Generate Semantic conventions from the specification YAML. (#1891) +- Spans created by the global `Tracer` obtained from `go.opentelemetry.io/otel`, prior to a functioning `TracerProvider` being set, now propagate the span context from their parent if one exists. (#1901) +- The `"go.opentelemetry.io/otel".Tracer` function now accepts tracer options. (#1902) +- Move the `go.opentelemetry.io/otel/unit` package to `go.opentelemetry.io/otel/metric/unit`. (#1903) +- Changed `go.opentelemetry.io/otel/trace.TracerConfig` to conform to the [Contributing guidelines](CONTRIBUTING.md#config.) (#1921) +- Changed `go.opentelemetry.io/otel/trace.SpanConfig` to conform to the [Contributing guidelines](CONTRIBUTING.md#config). (#1921) +- Changed `span.End()` now only accepts Options that are allowed at `End()`. (#1921) +- Changed `go.opentelemetry.io/otel/metric.InstrumentConfig` to conform to the [Contributing guidelines](CONTRIBUTING.md#config). (#1921) +- Changed `go.opentelemetry.io/otel/metric.MeterConfig` to conform to the [Contributing guidelines](CONTRIBUTING.md#config). (#1921) +- Refactored option types according to the contribution style guide. (#1882) +- Move the `go.opentelemetry.io/otel/trace.TraceStateFromKeyValues` function to the `go.opentelemetry.io/otel/oteltest` package. + This function is preserved for testing purposes where it may be useful to create a `TraceState` from `attribute.KeyValue`s, but it is not intended for production use. + The new `ParseTraceState` function should be used to create a `TraceState`. (#1931) +- Updated `MarshalJSON` method of the `go.opentelemetry.io/otel/trace.TraceState` type to marshal the type into the string representation of the `TraceState`. (#1931) +- The `TraceState.Delete` method from the `go.opentelemetry.io/otel/trace` package no longer returns an error in addition to a `TraceState`. (#1931) +- Updated `Get` method of the `TraceState` type from the `go.opentelemetry.io/otel/trace` package to accept a `string` instead of an `attribute.Key` type. (#1931) +- Updated `Insert` method of the `TraceState` type from the `go.opentelemetry.io/otel/trace` package to accept a pair of `string`s instead of an `attribute.KeyValue` type. (#1931) +- Updated `Delete` method of the `TraceState` type from the `go.opentelemetry.io/otel/trace` package to accept a `string` instead of an `attribute.Key` type. (#1931) +- Renamed `NewExporter` to `New` in the `go.opentelemetry.io/otel/exporters/stdout` package. (#1985) +- Renamed `NewExporter` to `New` in the `go.opentelemetry.io/otel/exporters/metric/prometheus` package. (#1985) +- Renamed `NewExporter` to `New` in the `go.opentelemetry.io/otel/exporters/trace/jaeger` package. (#1985) +- Renamed `NewExporter` to `New` in the `go.opentelemetry.io/otel/exporters/trace/zipkin` package. (#1985) +- Renamed `NewExporter` to `New` in the `go.opentelemetry.io/otel/exporters/otlp` package. (#1985) +- Renamed `NewUnstartedExporter` to `NewUnstarted` in the `go.opentelemetry.io/otel/exporters/otlp` package. (#1985) +- The `go.opentelemetry.io/otel/semconv` package has been moved to `go.opentelemetry.io/otel/semconv/v1.4.0` to allow for multiple [telemetry schema](https://github.com/open-telemetry/oteps/blob/main/text/0152-telemetry-schemas.md) versions to be used concurrently. (#1987) +- Metrics test helpers in `go.opentelemetry.io/otel/oteltest` have been moved to `go.opentelemetry.io/otel/metric/metrictest`. (#1988) + +### Deprecated + +- The `go.opentelemetry.io/otel/exporters/metric/prometheus` is deprecated, use `go.opentelemetry.io/otel/exporters/prometheus` instead. (#1993) +- The `go.opentelemetry.io/otel/exporters/trace/jaeger` is deprecated, use `go.opentelemetry.io/otel/exporters/jaeger` instead. (#1993) +- The `go.opentelemetry.io/otel/exporters/trace/zipkin` is deprecated, use `go.opentelemetry.io/otel/exporters/zipkin` instead. (#1993) + +### Removed + +- Removed `resource.WithoutBuiltin()`. Use `resource.New()`. (#1810) +- Unexported types `resource.FromEnv`, `resource.Host`, and `resource.TelemetrySDK`, Use the corresponding `With*()` to use individually. (#1810) +- Removed the `Tracer` and `IsRecording` method from the `ReadOnlySpan` in the `go.opentelemetry.io/otel/sdk/trace`. + The `Tracer` method is not a required to be included in this interface and given the mutable nature of the tracer that is associated with a span, this method is not appropriate. + The `IsRecording` method returns if the span is recording or not. + A read-only span value does not need to know if updates to it will be recorded or not. + By definition, it cannot be updated so there is no point in communicating if an update is recorded. (#1873) +- Removed the `SpanSnapshot` type from the `go.opentelemetry.io/otel/sdk/trace` package. + The use of this type has been replaced with the use of the explicitly immutable `ReadOnlySpan` type. + When a concrete representation of a read-only span is needed for testing, the newly added `SpanStub` in the `go.opentelemetry.io/otel/sdk/trace/tracetest` package should be used. (#1873) +- Removed the `Tracer` method from the `Span` interface in the `go.opentelemetry.io/otel/trace` package. + Using the same tracer that created a span introduces the error where an instrumentation library's `Tracer` is used by other code instead of their own. + The `"go.opentelemetry.io/otel".Tracer` function or a `TracerProvider` should be used to acquire a library specific `Tracer` instead. (#1900) + - The `TracerProvider()` method on the `Span` interface may also be used to obtain a `TracerProvider` using the same trace processing pipeline. (#2009) +- The `http.url` attribute generated by `HTTPClientAttributesFromHTTPRequest` will no longer include username or password information. (#1919) +- Removed `IsEmpty` method of the `TraceState` type in the `go.opentelemetry.io/otel/trace` package in favor of using the added `TraceState.Len` method. (#1931) +- Removed `Set`, `Value`, `ContextWithValue`, `ContextWithoutValue`, and `ContextWithEmpty` functions in the `go.opentelemetry.io/otel/baggage` package. + Handling of baggage is now done using the added `Baggage` type and related context functions (`ContextWithBaggage`, `ContextWithoutBaggage`, and `FromContext`) in that package. (#1967) +- The `InstallNewPipeline` and `NewExportPipeline` creation functions in all the exporters (prometheus, otlp, stdout, jaeger, and zipkin) have been removed. + These functions were deemed premature attempts to provide convenience that did not achieve this aim. (#1985) +- The `go.opentelemetry.io/otel/exporters/otlp` exporter has been removed. Use `go.opentelemetry.io/otel/exporters/otlp/otlptrace` instead. (#1990) +- The `go.opentelemetry.io/otel/exporters/stdout` exporter has been removed. Use `go.opentelemetry.io/otel/exporters/stdout/stdouttrace` or `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` instead. (#2005) + +### Fixed + +- Only report errors from the `"go.opentelemetry.io/otel/sdk/resource".Environment` function when they are not `nil`. (#1850, #1851) +- The `Shutdown` method of the simple `SpanProcessor` in the `go.opentelemetry.io/otel/sdk/trace` package now honors the context deadline or cancellation. (#1616, #1856) +- BatchSpanProcessor now drops span batches that failed to be exported. (#1860) +- Use `http://localhost:14268/api/traces` as default Jaeger collector endpoint instead of `http://localhost:14250`. (#1898) +- Allow trailing and leading whitespace in the parsing of a `tracestate` header. (#1931) +- Add logic to determine if the channel is closed to fix Jaeger exporter test panic with close closed channel. (#1870, #1973) +- Avoid transport security when OTLP endpoint is a Unix socket. (#2001) + +### Security + +## [0.20.0] - 2021-04-23 + +### Added + +- The OTLP exporter now has two new convenience functions, `NewExportPipeline` and `InstallNewPipeline`, setup and install the exporter in tracing and metrics pipelines. (#1373) +- Adds semantic conventions for exceptions. (#1492) +- Added Jaeger Environment variables: `OTEL_EXPORTER_JAEGER_AGENT_HOST`, `OTEL_EXPORTER_JAEGER_AGENT_PORT` + These environment variables can be used to override Jaeger agent hostname and port (#1752) +- Option `ExportTimeout` was added to batch span processor. (#1755) +- `trace.TraceFlags` is now a defined type over `byte` and `WithSampled(bool) TraceFlags` and `IsSampled() bool` methods have been added to it. (#1770) +- The `Event` and `Link` struct types from the `go.opentelemetry.io/otel` package now include a `DroppedAttributeCount` field to record the number of attributes that were not recorded due to configured limits being reached. (#1771) +- The Jaeger exporter now reports dropped attributes for a Span event in the exported log. (#1771) +- Adds test to check BatchSpanProcessor ignores `OnEnd` and `ForceFlush` post `Shutdown`. (#1772) +- Extract resource attributes from the `OTEL_RESOURCE_ATTRIBUTES` environment variable and merge them with the `resource.Default` resource as well as resources provided to the `TracerProvider` and metric `Controller`. (#1785) +- Added `WithOSType` resource configuration option to set OS (Operating System) type resource attribute (`os.type`). (#1788) +- Added `WithProcess*` resource configuration options to set Process resource attributes. (#1788) + - `process.pid` + - `process.executable.name` + - `process.executable.path` + - `process.command_args` + - `process.owner` + - `process.runtime.name` + - `process.runtime.version` + - `process.runtime.description` +- Adds `k8s.node.name` and `k8s.node.uid` attribute keys to the `semconv` package. (#1789) +- Added support for configuring OTLP/HTTP and OTLP/gRPC Endpoints, TLS Certificates, Headers, Compression and Timeout via Environment Variables. (#1758, #1769 and #1811) + - `OTEL_EXPORTER_OTLP_ENDPOINT` + - `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` + - `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` + - `OTEL_EXPORTER_OTLP_HEADERS` + - `OTEL_EXPORTER_OTLP_TRACES_HEADERS` + - `OTEL_EXPORTER_OTLP_METRICS_HEADERS` + - `OTEL_EXPORTER_OTLP_COMPRESSION` + - `OTEL_EXPORTER_OTLP_TRACES_COMPRESSION` + - `OTEL_EXPORTER_OTLP_METRICS_COMPRESSION` + - `OTEL_EXPORTER_OTLP_TIMEOUT` + - `OTEL_EXPORTER_OTLP_TRACES_TIMEOUT` + - `OTEL_EXPORTER_OTLP_METRICS_TIMEOUT` + - `OTEL_EXPORTER_OTLP_CERTIFICATE` + - `OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE` + - `OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE` +- Adds `otlpgrpc.WithTimeout` option for configuring timeout to the otlp/gRPC exporter. (#1821) +- Adds `jaeger.WithMaxPacketSize` option for configuring maximum UDP packet size used when connecting to the Jaeger agent. (#1853) + +### Fixed + +- The `Span.IsRecording` implementation from `go.opentelemetry.io/otel/sdk/trace` always returns false when not being sampled. (#1750) +- The Jaeger exporter now correctly sets tags for the Span status code and message. + This means it uses the correct tag keys (`"otel.status_code"`, `"otel.status_description"`) and does not set the status message as a tag unless it is set on the span. (#1761) +- The Jaeger exporter now correctly records Span event's names using the `"event"` key for a tag. + Additionally, this tag is overridden, as specified in the OTel specification, if the event contains an attribute with that key. (#1768) +- Zipkin Exporter: Ensure mapping between OTel and Zipkin span data complies with the specification. (#1688) +- Fixed typo for default service name in Jaeger Exporter. (#1797) +- Fix flaky OTLP for the reconnnection of the client connection. (#1527, #1814) +- Fix Jaeger exporter dropping of span batches that exceed the UDP packet size limit. + Instead, the exporter now splits the batch into smaller sendable batches. (#1828) + +### Changed + +- Span `RecordError` now records an `exception` event to comply with the semantic convention specification. (#1492) +- Jaeger exporter was updated to use thrift v0.14.1. (#1712) +- Migrate from using internally built and maintained version of the OTLP to the one hosted at `go.opentelemetry.io/proto/otlp`. (#1713) +- Migrate from using `github.com/gogo/protobuf` to `google.golang.org/protobuf` to match `go.opentelemetry.io/proto/otlp`. (#1713) +- The storage of a local or remote Span in a `context.Context` using its SpanContext is unified to store just the current Span. + The Span's SpanContext can now self-identify as being remote or not. + This means that `"go.opentelemetry.io/otel/trace".ContextWithRemoteSpanContext` will now overwrite any existing current Span, not just existing remote Spans, and make it the current Span in a `context.Context`. (#1731) +- Improve OTLP/gRPC exporter connection errors. (#1737) +- Information about a parent span context in a `"go.opentelemetry.io/otel/export/trace".SpanSnapshot` is unified in a new `Parent` field. + The existing `ParentSpanID` and `HasRemoteParent` fields are removed in favor of this. (#1748) +- The `ParentContext` field of the `"go.opentelemetry.io/otel/sdk/trace".SamplingParameters` is updated to hold a `context.Context` containing the parent span. + This changes it to make `SamplingParameters` conform with the OpenTelemetry specification. (#1749) +- Updated Jaeger Environment Variables: `JAEGER_ENDPOINT`, `JAEGER_USER`, `JAEGER_PASSWORD` + to `OTEL_EXPORTER_JAEGER_ENDPOINT`, `OTEL_EXPORTER_JAEGER_USER`, `OTEL_EXPORTER_JAEGER_PASSWORD` in compliance with OTel specification. (#1752) +- Modify `BatchSpanProcessor.ForceFlush` to abort after timeout/cancellation. (#1757) +- The `DroppedAttributeCount` field of the `Span` in the `go.opentelemetry.io/otel` package now only represents the number of attributes dropped for the span itself. + It no longer is a conglomerate of itself, events, and link attributes that have been dropped. (#1771) +- Make `ExportSpans` in Jaeger Exporter honor context deadline. (#1773) +- Modify Zipkin Exporter default service name, use default resource's serviceName instead of empty. (#1777) +- The `go.opentelemetry.io/otel/sdk/export/trace` package is merged into the `go.opentelemetry.io/otel/sdk/trace` package. (#1778) +- The prometheus.InstallNewPipeline example is moved from comment to example test (#1796) +- The convenience functions for the stdout exporter have been updated to return the `TracerProvider` implementation and enable the shutdown of the exporter. (#1800) +- Replace the flush function returned from the Jaeger exporter's convenience creation functions (`InstallNewPipeline` and `NewExportPipeline`) with the `TracerProvider` implementation they create. + This enables the caller to shutdown and flush using the related `TracerProvider` methods. (#1822) +- Updated the Jaeger exporter to have a default endpoint, `http://localhost:14250`, for the collector. (#1824) +- Changed the function `WithCollectorEndpoint` in the Jaeger exporter to no longer accept an endpoint as an argument. + The endpoint can be passed with the `CollectorEndpointOption` using the `WithEndpoint` function or by setting the `OTEL_EXPORTER_JAEGER_ENDPOINT` environment variable value appropriately. (#1824) +- The Jaeger exporter no longer batches exported spans itself, instead it relies on the SDK's `BatchSpanProcessor` for this functionality. (#1830) +- The Jaeger exporter creation functions (`NewRawExporter`, `NewExportPipeline`, and `InstallNewPipeline`) no longer accept the removed `Option` type as a variadic argument. (#1830) + +### Removed + +- Removed Jaeger Environment variables: `JAEGER_SERVICE_NAME`, `JAEGER_DISABLED`, `JAEGER_TAGS` + These environment variables will no longer be used to override values of the Jaeger exporter (#1752) +- No longer set the links for a `Span` in `go.opentelemetry.io/otel/sdk/trace` that is configured to be a new root. + This is unspecified behavior that the OpenTelemetry community plans to standardize in the future. + To prevent backwards incompatible changes when it is specified, these links are removed. (#1726) +- Setting error status while recording error with Span from oteltest package. (#1729) +- The concept of a remote and local Span stored in a context is unified to just the current Span. + Because of this `"go.opentelemetry.io/otel/trace".RemoteSpanContextFromContext` is removed as it is no longer needed. + Instead, `"go.opentelemetry.io/otel/trace".SpanContextFromContex` can be used to return the current Span. + If needed, that Span's `SpanContext.IsRemote()` can then be used to determine if it is remote or not. (#1731) +- The `HasRemoteParent` field of the `"go.opentelemetry.io/otel/sdk/trace".SamplingParameters` is removed. + This field is redundant to the information returned from the `Remote` method of the `SpanContext` held in the `ParentContext` field. (#1749) +- The `trace.FlagsDebug` and `trace.FlagsDeferred` constants have been removed and will be localized to the B3 propagator. (#1770) +- Remove `Process` configuration, `WithProcessFromEnv` and `ProcessFromEnv`, and type from the Jaeger exporter package. + The information that could be configured in the `Process` struct should be configured in a `Resource` instead. (#1776, #1804) +- Remove the `WithDisabled` option from the Jaeger exporter. + To disable the exporter unregister it from the `TracerProvider` or use a no-operation `TracerProvider`. (#1806) +- Removed the functions `CollectorEndpointFromEnv` and `WithCollectorEndpointOptionFromEnv` from the Jaeger exporter. + These functions for retrieving specific environment variable values are redundant of other internal functions and + are not intended for end user use. (#1824) +- Removed the Jaeger exporter `WithSDKOptions` `Option`. + This option was used to set SDK options for the exporter creation convenience functions. + These functions are provided as a way to easily setup or install the exporter with what are deemed reasonable SDK settings for common use cases. + If the SDK needs to be configured differently, the `NewRawExporter` function and direct setup of the SDK with the desired settings should be used. (#1825) +- The `WithBufferMaxCount` and `WithBatchMaxCount` `Option`s from the Jaeger exporter are removed. + The exporter no longer batches exports, instead relying on the SDK's `BatchSpanProcessor` for this functionality. (#1830) +- The Jaeger exporter `Option` type is removed. + The type is no longer used by the exporter to configure anything. + All the previous configurations these options provided were duplicates of SDK configuration. + They have been removed in favor of using the SDK configuration and focuses the exporter configuration to be only about the endpoints it will send telemetry to. (#1830) + +## [0.19.0] - 2021-03-18 + +### Added + +- Added `Marshaler` config option to `otlphttp` to enable otlp over json or protobufs. (#1586) +- A `ForceFlush` method to the `"go.opentelemetry.io/otel/sdk/trace".TracerProvider` to flush all registered `SpanProcessor`s. (#1608) +- Added `WithSampler` and `WithSpanLimits` to tracer provider. (#1633, #1702) +- `"go.opentelemetry.io/otel/trace".SpanContext` now has a `remote` property, and `IsRemote()` predicate, that is true when the `SpanContext` has been extracted from remote context data. (#1701) +- A `Valid` method to the `"go.opentelemetry.io/otel/attribute".KeyValue` type. (#1703) + +### Changed + +- `trace.SpanContext` is now immutable and has no exported fields. (#1573) + - `trace.NewSpanContext()` can be used in conjunction with the `trace.SpanContextConfig` struct to initialize a new `SpanContext` where all values are known. +- Update the `ForceFlush` method signature to the `"go.opentelemetry.io/otel/sdk/trace".SpanProcessor` to accept a `context.Context` and return an error. (#1608) +- Update the `Shutdown` method to the `"go.opentelemetry.io/otel/sdk/trace".TracerProvider` return an error on shutdown failure. (#1608) +- The SimpleSpanProcessor will now shut down the enclosed `SpanExporter` and gracefully ignore subsequent calls to `OnEnd` after `Shutdown` is called. (#1612) +- `"go.opentelemetry.io/sdk/metric/controller.basic".WithPusher` is replaced with `WithExporter` to provide consistent naming across project. (#1656) +- Added non-empty string check for trace `Attribute` keys. (#1659) +- Add `description` to SpanStatus only when `StatusCode` is set to error. (#1662) +- Jaeger exporter falls back to `resource.Default`'s `service.name` if the exported Span does not have one. (#1673) +- Jaeger exporter populates Jaeger's Span Process from Resource. (#1673) +- Renamed the `LabelSet` method of `"go.opentelemetry.io/otel/sdk/resource".Resource` to `Set`. (#1692) +- Changed `WithSDK` to `WithSDKOptions` to accept variadic arguments of `TracerProviderOption` type in `go.opentelemetry.io/otel/exporters/trace/jaeger` package. (#1693) +- Changed `WithSDK` to `WithSDKOptions` to accept variadic arguments of `TracerProviderOption` type in `go.opentelemetry.io/otel/exporters/trace/zipkin` package. (#1693) + +### Removed + +- Removed `serviceName` parameter from Zipkin exporter and uses resource instead. (#1549) +- Removed `WithConfig` from tracer provider to avoid overriding configuration. (#1633) +- Removed the exported `SimpleSpanProcessor` and `BatchSpanProcessor` structs. + These are now returned as a SpanProcessor interface from their respective constructors. (#1638) +- Removed `WithRecord()` from `trace.SpanOption` when creating a span. (#1660) +- Removed setting status to `Error` while recording an error as a span event in `RecordError`. (#1663) +- Removed `jaeger.WithProcess` configuration option. (#1673) +- Removed `ApplyConfig` method from `"go.opentelemetry.io/otel/sdk/trace".TracerProvider` and the now unneeded `Config` struct. (#1693) + +### Fixed + +- Jaeger Exporter: Ensure mapping between OTEL and Jaeger span data complies with the specification. (#1626) +- `SamplingResult.TraceState` is correctly propagated to a newly created span's `SpanContext`. (#1655) +- The `otel-collector` example now correctly flushes metric events prior to shutting down the exporter. (#1678) +- Do not set span status message in `SpanStatusFromHTTPStatusCode` if it can be inferred from `http.status_code`. (#1681) +- Synchronization issues in global trace delegate implementation. (#1686) +- Reduced excess memory usage by global `TracerProvider`. (#1687) + +## [0.18.0] - 2021-03-03 + +### Added + +- Added `resource.Default()` for use with meter and tracer providers. (#1507) +- `AttributePerEventCountLimit` and `AttributePerLinkCountLimit` for `SpanLimits`. (#1535) +- Added `Keys()` method to `propagation.TextMapCarrier` and `propagation.HeaderCarrier` to adapt `http.Header` to this interface. (#1544) +- Added `code` attributes to `go.opentelemetry.io/otel/semconv` package. (#1558) +- Compatibility testing suite in the CI system for the following systems. (#1567) + | OS | Go Version | Architecture | + | ------- | ---------- | ------------ | + | Ubuntu | 1.15 | amd64 | + | Ubuntu | 1.14 | amd64 | + | Ubuntu | 1.15 | 386 | + | Ubuntu | 1.14 | 386 | + | MacOS | 1.15 | amd64 | + | MacOS | 1.14 | amd64 | + | Windows | 1.15 | amd64 | + | Windows | 1.14 | amd64 | + | Windows | 1.15 | 386 | + | Windows | 1.14 | 386 | + +### Changed + +- Replaced interface `oteltest.SpanRecorder` with its existing implementation + `StandardSpanRecorder`. (#1542) +- Default span limit values to 128. (#1535) +- Rename `MaxEventsPerSpan`, `MaxAttributesPerSpan` and `MaxLinksPerSpan` to `EventCountLimit`, `AttributeCountLimit` and `LinkCountLimit`, and move these fields into `SpanLimits`. (#1535) +- Renamed the `otel/label` package to `otel/attribute`. (#1541) +- Vendor the Jaeger exporter's dependency on Apache Thrift. (#1551) +- Parallelize the CI linting and testing. (#1567) +- Stagger timestamps in exact aggregator tests. (#1569) +- Changed all examples to use `WithBatchTimeout(5 * time.Second)` rather than `WithBatchTimeout(5)`. (#1621) +- Prevent end-users from implementing some interfaces (#1575) + + ``` + "otel/exporters/otlp/otlphttp".Option + "otel/exporters/stdout".Option + "otel/oteltest".Option + "otel/trace".TracerOption + "otel/trace".SpanOption + "otel/trace".EventOption + "otel/trace".LifeCycleOption + "otel/trace".InstrumentationOption + "otel/sdk/resource".Option + "otel/sdk/trace".ParentBasedSamplerOption + "otel/sdk/trace".ReadOnlySpan + "otel/sdk/trace".ReadWriteSpan + ``` + +### Removed + +- Removed attempt to resample spans upon changing the span name with `span.SetName()`. (#1545) +- The `test-benchmark` is no longer a dependency of the `precommit` make target. (#1567) +- Removed the `test-386` make target. + This was replaced with a full compatibility testing suite (i.e. multi OS/arch) in the CI system. (#1567) + +### Fixed + +- The sequential timing check of timestamps in the stdout exporter are now setup explicitly to be sequential (#1571). (#1572) +- Windows build of Jaeger tests now compiles with OS specific functions (#1576). (#1577) +- The sequential timing check of timestamps of go.opentelemetry.io/otel/sdk/metric/aggregator/lastvalue are now setup explicitly to be sequential (#1578). (#1579) +- Validate tracestate header keys with vendors according to the W3C TraceContext specification (#1475). (#1581) +- The OTLP exporter includes related labels for translations of a GaugeArray (#1563). (#1570) + +## [0.17.0] - 2021-02-12 + +### Changed + +- Rename project default branch from `master` to `main`. (#1505) +- Reverse order in which `Resource` attributes are merged, per change in spec. (#1501) +- Add tooling to maintain "replace" directives in go.mod files automatically. (#1528) +- Create new modules: otel/metric, otel/trace, otel/oteltest, otel/sdk/export/metric, otel/sdk/metric (#1528) +- Move metric-related public global APIs from otel to otel/metric/global. (#1528) + +## Fixed + +- Fixed otlpgrpc reconnection issue. +- The example code in the README.md of `go.opentelemetry.io/otel/exporters/otlp` is moved to a compiled example test and used the new `WithAddress` instead of `WithEndpoint`. (#1513) +- The otel-collector example now uses the default OTLP receiver port of the collector. + +## [0.16.0] - 2021-01-13 + +### Added + +- Add the `ReadOnlySpan` and `ReadWriteSpan` interfaces to provide better control for accessing span data. (#1360) +- `NewGRPCDriver` function returns a `ProtocolDriver` that maintains a single gRPC connection to the collector. (#1369) +- Added documentation about the project's versioning policy. (#1388) +- Added `NewSplitDriver` for OTLP exporter that allows sending traces and metrics to different endpoints. (#1418) +- Added codeql workflow to GitHub Actions (#1428) +- Added Gosec workflow to GitHub Actions (#1429) +- Add new HTTP driver for OTLP exporter in `exporters/otlp/otlphttp`. Currently it only supports the binary protobuf payloads. (#1420) +- Add an OpenCensus exporter bridge. (#1444) + +### Changed + +- Rename `internal/testing` to `internal/internaltest`. (#1449) +- Rename `export.SpanData` to `export.SpanSnapshot` and use it only for exporting spans. (#1360) +- Store the parent's full `SpanContext` rather than just its span ID in the `span` struct. (#1360) +- Improve span duration accuracy. (#1360) +- Migrated CI/CD from CircleCI to GitHub Actions (#1382) +- Remove duplicate checkout from GitHub Actions workflow (#1407) +- Metric `array` aggregator renamed `exact` to match its `aggregation.Kind` (#1412) +- Metric `exact` aggregator includes per-point timestamps (#1412) +- Metric stdout exporter uses MinMaxSumCount aggregator for ValueRecorder instruments (#1412) +- `NewExporter` from `exporters/otlp` now takes a `ProtocolDriver` as a parameter. (#1369) +- Many OTLP Exporter options became gRPC ProtocolDriver options. (#1369) +- Unify endpoint API that related to OTel exporter. (#1401) +- Optimize metric histogram aggregator to re-use its slice of buckets. (#1435) +- Metric aggregator Count() and histogram Bucket.Counts are consistently `uint64`. (1430) +- Histogram aggregator accepts functional options, uses default boundaries if none given. (#1434) +- `SamplingResult` now passed a `Tracestate` from the parent `SpanContext` (#1432) +- Moved gRPC driver for OTLP exporter to `exporters/otlp/otlpgrpc`. (#1420) +- The `TraceContext` propagator now correctly propagates `TraceState` through the `SpanContext`. (#1447) +- Metric Push and Pull Controller components are combined into a single "basic" Controller: + - `WithExporter()` and `Start()` to configure Push behavior + - `Start()` is optional; use `Collect()` and `ForEach()` for Pull behavior + - `Start()` and `Stop()` accept Context. (#1378) +- The `Event` type is moved from the `otel/sdk/export/trace` package to the `otel/trace` API package. (#1452) + +### Removed + +- Remove `errUninitializedSpan` as its only usage is now obsolete. (#1360) +- Remove Metric export functionality related to quantiles and summary data points: this is not specified (#1412) +- Remove DDSketch metric aggregator; our intention is to re-introduce this as an option of the histogram aggregator after [new OTLP histogram data types](https://github.com/open-telemetry/opentelemetry-proto/pull/226) are released (#1412) + +### Fixed + +- `BatchSpanProcessor.Shutdown()` will now shutdown underlying `export.SpanExporter`. (#1443) + +## [0.15.0] - 2020-12-10 + +### Added + +- The `WithIDGenerator` `TracerProviderOption` is added to the `go.opentelemetry.io/otel/trace` package to configure an `IDGenerator` for the `TracerProvider`. (#1363) + +### Changed + +- The Zipkin exporter now uses the Span status code to determine. (#1328) +- `NewExporter` and `Start` functions in `go.opentelemetry.io/otel/exporters/otlp` now receive `context.Context` as a first parameter. (#1357) +- Move the OpenCensus example into `example` directory. (#1359) +- Moved the SDK's `internal.IDGenerator` interface in to the `sdk/trace` package to enable support for externally-defined ID generators. (#1363) +- Bump `github.com/google/go-cmp` from 0.5.3 to 0.5.4 (#1374) +- Bump `github.com/golangci/golangci-lint` in `/internal/tools` (#1375) + +### Fixed + +- Metric SDK `SumObserver` and `UpDownSumObserver` instruments correctness fixes. (#1381) + +## [0.14.0] - 2020-11-19 + +### Added + +- An `EventOption` and the related `NewEventConfig` function are added to the `go.opentelemetry.io/otel` package to configure Span events. (#1254) +- A `TextMapPropagator` and associated `TextMapCarrier` are added to the `go.opentelemetry.io/otel/oteltest` package to test `TextMap` type propagators and their use. (#1259) +- `SpanContextFromContext` returns `SpanContext` from context. (#1255) +- `TraceState` has been added to `SpanContext`. (#1340) +- `DeploymentEnvironmentKey` added to `go.opentelemetry.io/otel/semconv` package. (#1323) +- Add an OpenCensus to OpenTelemetry tracing bridge. (#1305) +- Add a parent context argument to `SpanProcessor.OnStart` to follow the specification. (#1333) +- Add missing tests for `sdk/trace/attributes_map.go`. (#1337) + +### Changed + +- Move the `go.opentelemetry.io/otel/api/trace` package into `go.opentelemetry.io/otel/trace` with the following changes. (#1229) (#1307) + - `ID` has been renamed to `TraceID`. + - `IDFromHex` has been renamed to `TraceIDFromHex`. + - `EmptySpanContext` is removed. +- Move the `go.opentelemetry.io/otel/api/trace/tracetest` package into `go.opentelemetry.io/otel/oteltest`. (#1229) +- OTLP Exporter updates: + - supports OTLP v0.6.0 (#1230, #1354) + - supports configurable aggregation temporality (default: Cumulative, optional: Stateless). (#1296) +- The Sampler is now called on local child spans. (#1233) +- The `Kind` type from the `go.opentelemetry.io/otel/api/metric` package was renamed to `InstrumentKind` to more specifically describe what it is and avoid semantic ambiguity. (#1240) +- The `MetricKind` method of the `Descriptor` type in the `go.opentelemetry.io/otel/api/metric` package was renamed to `Descriptor.InstrumentKind`. + This matches the returned type and fixes misuse of the term metric. (#1240) +- Move test harness from the `go.opentelemetry.io/otel/api/apitest` package into `go.opentelemetry.io/otel/oteltest`. (#1241) +- Move the `go.opentelemetry.io/otel/api/metric/metrictest` package into `go.opentelemetry.io/oteltest` as part of #964. (#1252) +- Move the `go.opentelemetry.io/otel/api/metric` package into `go.opentelemetry.io/otel/metric` as part of #1303. (#1321) +- Move the `go.opentelemetry.io/otel/api/metric/registry` package into `go.opentelemetry.io/otel/metric/registry` as a part of #1303. (#1316) +- Move the `Number` type (together with related functions) from `go.opentelemetry.io/otel/api/metric` package into `go.opentelemetry.io/otel/metric/number` as a part of #1303. (#1316) +- The function signature of the Span `AddEvent` method in `go.opentelemetry.io/otel` is updated to no longer take an unused context and instead take a required name and a variable number of `EventOption`s. (#1254) +- The function signature of the Span `RecordError` method in `go.opentelemetry.io/otel` is updated to no longer take an unused context and instead take a required error value and a variable number of `EventOption`s. (#1254) +- Move the `go.opentelemetry.io/otel/api/global` package to `go.opentelemetry.io/otel`. (#1262) (#1330) +- Move the `Version` function from `go.opentelemetry.io/otel/sdk` to `go.opentelemetry.io/otel`. (#1330) +- Rename correlation context header from `"otcorrelations"` to `"baggage"` to match the OpenTelemetry specification. (#1267) +- Fix `Code.UnmarshalJSON` to work with valid JSON only. (#1276) +- The `resource.New()` method changes signature to support builtin attributes and functional options, including `telemetry.sdk.*` and + `host.name` semantic conventions; the former method is renamed `resource.NewWithAttributes`. (#1235) +- The Prometheus exporter now exports non-monotonic counters (i.e. `UpDownCounter`s) as gauges. (#1210) +- Correct the `Span.End` method documentation in the `otel` API to state updates are not allowed on a span after it has ended. (#1310) +- Updated span collection limits for attribute, event and link counts to 1000 (#1318) +- Renamed `semconv.HTTPUrlKey` to `semconv.HTTPURLKey`. (#1338) + +### Removed + +- The `ErrInvalidHexID`, `ErrInvalidTraceIDLength`, `ErrInvalidSpanIDLength`, `ErrInvalidSpanIDLength`, or `ErrNilSpanID` from the `go.opentelemetry.io/otel` package are unexported now. (#1243) +- The `AddEventWithTimestamp` method on the `Span` interface in `go.opentelemetry.io/otel` is removed due to its redundancy. + It is replaced by using the `AddEvent` method with a `WithTimestamp` option. (#1254) +- The `MockSpan` and `MockTracer` types are removed from `go.opentelemetry.io/otel/oteltest`. + `Tracer` and `Span` from the same module should be used in their place instead. (#1306) +- `WorkerCount` option is removed from `go.opentelemetry.io/otel/exporters/otlp`. (#1350) +- Remove the following labels types: INT32, UINT32, UINT64 and FLOAT32. (#1314) + +### Fixed + +- Rename `MergeItererator` to `MergeIterator` in the `go.opentelemetry.io/otel/label` package. (#1244) +- The `go.opentelemetry.io/otel/api/global` packages global TextMapPropagator now delegates functionality to a globally set delegate for all previously returned propagators. (#1258) +- Fix condition in `label.Any`. (#1299) +- Fix global `TracerProvider` to pass options to its configured provider. (#1329) +- Fix missing handler for `ExactKind` aggregator in OTLP metrics transformer (#1309) + +## [0.13.0] - 2020-10-08 + +### Added + +- OTLP Metric exporter supports Histogram aggregation. (#1209) +- The `Code` struct from the `go.opentelemetry.io/otel/codes` package now supports JSON marshaling and unmarshaling as well as implements the `Stringer` interface. (#1214) +- A Baggage API to implement the OpenTelemetry specification. (#1217) +- Add Shutdown method to sdk/trace/provider, shutdown processors in the order they were registered. (#1227) + +### Changed + +- Set default propagator to no-op propagator. (#1184) +- The `HTTPSupplier`, `HTTPExtractor`, `HTTPInjector`, and `HTTPPropagator` from the `go.opentelemetry.io/otel/api/propagation` package were replaced with unified `TextMapCarrier` and `TextMapPropagator` in the `go.opentelemetry.io/otel/propagation` package. (#1212) (#1325) +- The `New` function from the `go.opentelemetry.io/otel/api/propagation` package was replaced with `NewCompositeTextMapPropagator` in the `go.opentelemetry.io/otel` package. (#1212) +- The status codes of the `go.opentelemetry.io/otel/codes` package have been updated to match the latest OpenTelemetry specification. + They now are `Unset`, `Error`, and `Ok`. + They no longer track the gRPC codes. (#1214) +- The `StatusCode` field of the `SpanData` struct in the `go.opentelemetry.io/otel/sdk/export/trace` package now uses the codes package from this package instead of the gRPC project. (#1214) +- Move the `go.opentelemetry.io/otel/api/baggage` package into `go.opentelemetry.io/otel/baggage`. (#1217) (#1325) +- A `Shutdown` method of `SpanProcessor` and all its implementations receives a context and returns an error. (#1264) + +### Fixed + +- Copies of data from arrays and slices passed to `go.opentelemetry.io/otel/label.ArrayValue()` are now used in the returned `Value` instead of using the mutable data itself. (#1226) + +### Removed + +- The `ExtractHTTP` and `InjectHTTP` functions from the `go.opentelemetry.io/otel/api/propagation` package were removed. (#1212) +- The `Propagators` interface from the `go.opentelemetry.io/otel/api/propagation` package was removed to conform to the OpenTelemetry specification. + The explicit `TextMapPropagator` type can be used in its place as this is the `Propagator` type the specification defines. (#1212) +- The `SetAttribute` method of the `Span` from the `go.opentelemetry.io/otel/api/trace` package was removed given its redundancy with the `SetAttributes` method. (#1216) +- The internal implementation of Baggage storage is removed in favor of using the new Baggage API functionality. (#1217) +- Remove duplicate hostname key `HostHostNameKey` in Resource semantic conventions. (#1219) +- Nested array/slice support has been removed. (#1226) + +## [0.12.0] - 2020-09-24 + +### Added + +- A `SpanConfigure` function in `go.opentelemetry.io/otel/api/trace` to create a new `SpanConfig` from `SpanOption`s. (#1108) +- In the `go.opentelemetry.io/otel/api/trace` package, `NewTracerConfig` was added to construct new `TracerConfig`s. + This addition was made to conform with our project option conventions. (#1155) +- Instrumentation library information was added to the Zipkin exporter. (#1119) +- The `SpanProcessor` interface now has a `ForceFlush()` method. (#1166) +- More semantic conventions for k8s as resource attributes. (#1167) + +### Changed + +- Add reconnecting udp connection type to Jaeger exporter. + This change adds a new optional implementation of the udp conn interface used to detect changes to an agent's host dns record. + It then adopts the new destination address to ensure the exporter doesn't get stuck. This change was ported from jaegertracing/jaeger-client-go#520. (#1063) +- Replace `StartOption` and `EndOption` in `go.opentelemetry.io/otel/api/trace` with `SpanOption`. + This change is matched by replacing the `StartConfig` and `EndConfig` with a unified `SpanConfig`. (#1108) +- Replace the `LinkedTo` span option in `go.opentelemetry.io/otel/api/trace` with `WithLinks`. + This is be more consistent with our other option patterns, i.e. passing the item to be configured directly instead of its component parts, and provides a cleaner function signature. (#1108) +- The `go.opentelemetry.io/otel/api/trace` `TracerOption` was changed to an interface to conform to project option conventions. (#1109) +- Move the `B3` and `TraceContext` from within the `go.opentelemetry.io/otel/api/trace` package to their own `go.opentelemetry.io/otel/propagators` package. + This removal of the propagators is reflective of the OpenTelemetry specification for these propagators as well as cleans up the `go.opentelemetry.io/otel/api/trace` API. (#1118) +- Rename Jaeger tags used for instrumentation library information to reflect changes in OpenTelemetry specification. (#1119) +- Rename `ProbabilitySampler` to `TraceIDRatioBased` and change semantics to ignore parent span sampling status. (#1115) +- Move `tools` package under `internal`. (#1141) +- Move `go.opentelemetry.io/otel/api/correlation` package to `go.opentelemetry.io/otel/api/baggage`. (#1142) + The `correlation.CorrelationContext` propagator has been renamed `baggage.Baggage`. Other exported functions and types are unchanged. +- Rename `ParentOrElse` sampler to `ParentBased` and allow setting samplers depending on parent span. (#1153) +- In the `go.opentelemetry.io/otel/api/trace` package, `SpanConfigure` was renamed to `NewSpanConfig`. (#1155) +- Change `dependabot.yml` to add a `Skip Changelog` label to dependabot-sourced PRs. (#1161) +- The [configuration style guide](https://github.com/open-telemetry/opentelemetry-go/blob/master/CONTRIBUTING.md#config) has been updated to + recommend the use of `newConfig()` instead of `configure()`. (#1163) +- The `otlp.Config` type has been unexported and changed to `otlp.config`, along with its initializer. (#1163) +- Ensure exported interface types include parameter names and update the + Style Guide to reflect this styling rule. (#1172) +- Don't consider unset environment variable for resource detection to be an error. (#1170) +- Rename `go.opentelemetry.io/otel/api/metric.ConfigureInstrument` to `NewInstrumentConfig` and + `go.opentelemetry.io/otel/api/metric.ConfigureMeter` to `NewMeterConfig`. +- ValueObserver instruments use LastValue aggregator by default. (#1165) +- OTLP Metric exporter supports LastValue aggregation. (#1165) +- Move the `go.opentelemetry.io/otel/api/unit` package to `go.opentelemetry.io/otel/unit`. (#1185) +- Rename `Provider` to `MeterProvider` in the `go.opentelemetry.io/otel/api/metric` package. (#1190) +- Rename `NoopProvider` to `NoopMeterProvider` in the `go.opentelemetry.io/otel/api/metric` package. (#1190) +- Rename `NewProvider` to `NewMeterProvider` in the `go.opentelemetry.io/otel/api/metric/metrictest` package. (#1190) +- Rename `Provider` to `MeterProvider` in the `go.opentelemetry.io/otel/api/metric/registry` package. (#1190) +- Rename `NewProvider` to `NewMeterProvider` in the `go.opentelemetry.io/otel/api/metri/registryc` package. (#1190) +- Rename `Provider` to `TracerProvider` in the `go.opentelemetry.io/otel/api/trace` package. (#1190) +- Rename `NoopProvider` to `NoopTracerProvider` in the `go.opentelemetry.io/otel/api/trace` package. (#1190) +- Rename `Provider` to `TracerProvider` in the `go.opentelemetry.io/otel/api/trace/tracetest` package. (#1190) +- Rename `NewProvider` to `NewTracerProvider` in the `go.opentelemetry.io/otel/api/trace/tracetest` package. (#1190) +- Rename `WrapperProvider` to `WrapperTracerProvider` in the `go.opentelemetry.io/otel/bridge/opentracing` package. (#1190) +- Rename `NewWrapperProvider` to `NewWrapperTracerProvider` in the `go.opentelemetry.io/otel/bridge/opentracing` package. (#1190) +- Rename `Provider` method of the pull controller to `MeterProvider` in the `go.opentelemetry.io/otel/sdk/metric/controller/pull` package. (#1190) +- Rename `Provider` method of the push controller to `MeterProvider` in the `go.opentelemetry.io/otel/sdk/metric/controller/push` package. (#1190) +- Rename `ProviderOptions` to `TracerProviderConfig` in the `go.opentelemetry.io/otel/sdk/trace` package. (#1190) +- Rename `ProviderOption` to `TracerProviderOption` in the `go.opentelemetry.io/otel/sdk/trace` package. (#1190) +- Rename `Provider` to `TracerProvider` in the `go.opentelemetry.io/otel/sdk/trace` package. (#1190) +- Rename `NewProvider` to `NewTracerProvider` in the `go.opentelemetry.io/otel/sdk/trace` package. (#1190) +- Renamed `SamplingDecision` values to comply with OpenTelemetry specification change. (#1192) +- Renamed Zipkin attribute names from `ot.status_code & ot.status_description` to `otel.status_code & otel.status_description`. (#1201) +- The default SDK now invokes registered `SpanProcessor`s in the order they were registered with the `TracerProvider`. (#1195) +- Add test of spans being processed by the `SpanProcessor`s in the order they were registered. (#1203) + +### Removed + +- Remove the B3 propagator from `go.opentelemetry.io/otel/propagators`. It is now located in the + `go.opentelemetry.io/contrib/propagators/` module. (#1191) +- Remove the semantic convention for HTTP status text, `HTTPStatusTextKey` from package `go.opentelemetry.io/otel/semconv`. (#1194) + +### Fixed + +- Zipkin example no longer mentions `ParentSampler`, corrected to `ParentBased`. (#1171) +- Fix missing shutdown processor in otel-collector example. (#1186) +- Fix missing shutdown processor in basic and namedtracer examples. (#1197) + +## [0.11.0] - 2020-08-24 + +### Added + +- Support for exporting array-valued attributes via OTLP. (#992) +- `Noop` and `InMemory` `SpanBatcher` implementations to help with testing integrations. (#994) +- Support for filtering metric label sets. (#1047) +- A dimensionality-reducing metric Processor. (#1057) +- Integration tests for more OTel Collector Attribute types. (#1062) +- A new `WithSpanProcessor` `ProviderOption` is added to the `go.opentelemetry.io/otel/sdk/trace` package to create a `Provider` and automatically register the `SpanProcessor`. (#1078) + +### Changed + +- Rename `sdk/metric/processor/test` to `sdk/metric/processor/processortest`. (#1049) +- Rename `sdk/metric/controller/test` to `sdk/metric/controller/controllertest`. (#1049) +- Rename `api/testharness` to `api/apitest`. (#1049) +- Rename `api/trace/testtrace` to `api/trace/tracetest`. (#1049) +- Change Metric Processor to merge multiple observations. (#1024) +- The `go.opentelemetry.io/otel/bridge/opentracing` bridge package has been made into its own module. + This removes the package dependencies of this bridge from the rest of the OpenTelemetry based project. (#1038) +- Renamed `go.opentelemetry.io/otel/api/standard` package to `go.opentelemetry.io/otel/semconv` to avoid the ambiguous and generic name `standard` and better describe the package as containing OpenTelemetry semantic conventions. (#1016) +- The environment variable used for resource detection has been changed from `OTEL_RESOURCE_LABELS` to `OTEL_RESOURCE_ATTRIBUTES` (#1042) +- Replace `WithSyncer` with `WithBatcher` in examples. (#1044) +- Replace the `google.golang.org/grpc/codes` dependency in the API with an equivalent `go.opentelemetry.io/otel/codes` package. (#1046) +- Merge the `go.opentelemetry.io/otel/api/label` and `go.opentelemetry.io/otel/api/kv` into the new `go.opentelemetry.io/otel/label` package. (#1060) +- Unify Callback Function Naming. + Rename `*Callback` with `*Func`. (#1061) +- CI builds validate against last two versions of Go, dropping 1.13 and adding 1.15. (#1064) +- The `go.opentelemetry.io/otel/sdk/export/trace` interfaces `SpanSyncer` and `SpanBatcher` have been replaced with a specification compliant `Exporter` interface. + This interface still supports the export of `SpanData`, but only as a slice. + Implementation are also required now to return any error from `ExportSpans` if one occurs as well as implement a `Shutdown` method for exporter clean-up. (#1078) +- The `go.opentelemetry.io/otel/sdk/trace` `NewBatchSpanProcessor` function no longer returns an error. + If a `nil` exporter is passed as an argument to this function, instead of it returning an error, it now returns a `BatchSpanProcessor` that handles the export of `SpanData` by not taking any action. (#1078) +- The `go.opentelemetry.io/otel/sdk/trace` `NewProvider` function to create a `Provider` no longer returns an error, instead only a `*Provider`. + This change is related to `NewBatchSpanProcessor` not returning an error which was the only error this function would return. (#1078) + +### Removed + +- Duplicate, unused API sampler interface. (#999) + Use the [`Sampler` interface](https://github.com/open-telemetry/opentelemetry-go/blob/v0.11.0/sdk/trace/sampling.go) provided by the SDK instead. +- The `grpctrace` instrumentation was moved to the `go.opentelemetry.io/contrib` repository and out of this repository. + This move includes moving the `grpc` example to the `go.opentelemetry.io/contrib` as well. (#1027) +- The `WithSpan` method of the `Tracer` interface. + The functionality this method provided was limited compared to what a user can provide themselves. + It was removed with the understanding that if there is sufficient user need it can be added back based on actual user usage. (#1043) +- The `RegisterSpanProcessor` and `UnregisterSpanProcessor` functions. + These were holdovers from an approach prior to the TracerProvider design. They were not used anymore. (#1077) +- The `oterror` package. (#1026) +- The `othttp` and `httptrace` instrumentations were moved to `go.opentelemetry.io/contrib`. (#1032) + +### Fixed + +- The `semconv.HTTPServerMetricAttributesFromHTTPRequest()` function no longer generates the high-cardinality `http.request.content.length` label. (#1031) +- Correct instrumentation version tag in Jaeger exporter. (#1037) +- The SDK span will now set an error event if the `End` method is called during a panic (i.e. it was deferred). (#1043) +- Move internally generated protobuf code from the `go.opentelemetry.io/otel` to the OTLP exporter to reduce dependency overhead. (#1050) +- The `otel-collector` example referenced outdated collector processors. (#1006) + +## [0.10.0] - 2020-07-29 + +This release migrates the default OpenTelemetry SDK into its own Go module, decoupling the SDK from the API and reducing dependencies for instrumentation packages. + +### Added + +- The Zipkin exporter now has `NewExportPipeline` and `InstallNewPipeline` constructor functions to match the common pattern. + These function build a new exporter with default SDK options and register the exporter with the `global` package respectively. (#944) +- Add propagator option for gRPC instrumentation. (#986) +- The `testtrace` package now tracks the `trace.SpanKind` for each span. (#987) + +### Changed + +- Replace the `RegisterGlobal` `Option` in the Jaeger exporter with an `InstallNewPipeline` constructor function. + This matches the other exporter constructor patterns and will register a new exporter after building it with default configuration. (#944) +- The trace (`go.opentelemetry.io/otel/exporters/trace/stdout`) and metric (`go.opentelemetry.io/otel/exporters/metric/stdout`) `stdout` exporters are now merged into a single exporter at `go.opentelemetry.io/otel/exporters/stdout`. + This new exporter was made into its own Go module to follow the pattern of all exporters and decouple it from the `go.opentelemetry.io/otel` module. (#956, #963) +- Move the `go.opentelemetry.io/otel/exporters/test` test package to `go.opentelemetry.io/otel/sdk/export/metric/metrictest`. (#962) +- The `go.opentelemetry.io/otel/api/kv/value` package was merged into the parent `go.opentelemetry.io/otel/api/kv` package. (#968) + - `value.Bool` was replaced with `kv.BoolValue`. + - `value.Int64` was replaced with `kv.Int64Value`. + - `value.Uint64` was replaced with `kv.Uint64Value`. + - `value.Float64` was replaced with `kv.Float64Value`. + - `value.Int32` was replaced with `kv.Int32Value`. + - `value.Uint32` was replaced with `kv.Uint32Value`. + - `value.Float32` was replaced with `kv.Float32Value`. + - `value.String` was replaced with `kv.StringValue`. + - `value.Int` was replaced with `kv.IntValue`. + - `value.Uint` was replaced with `kv.UintValue`. + - `value.Array` was replaced with `kv.ArrayValue`. +- Rename `Infer` to `Any` in the `go.opentelemetry.io/otel/api/kv` package. (#972) +- Change `othttp` to use the `httpsnoop` package to wrap the `ResponseWriter` so that optional interfaces (`http.Hijacker`, `http.Flusher`, etc.) that are implemented by the original `ResponseWriter`are also implemented by the wrapped `ResponseWriter`. (#979) +- Rename `go.opentelemetry.io/otel/sdk/metric/aggregator/test` package to `go.opentelemetry.io/otel/sdk/metric/aggregator/aggregatortest`. (#980) +- Make the SDK into its own Go module called `go.opentelemetry.io/otel/sdk`. (#985) +- Changed the default trace `Sampler` from `AlwaysOn` to `ParentOrElse(AlwaysOn)`. (#989) + +### Removed + +- The `IndexedAttribute` function from the `go.opentelemetry.io/otel/api/label` package was removed in favor of `IndexedLabel` which it was synonymous with. (#970) + +### Fixed + +- Bump github.com/golangci/golangci-lint from 1.28.3 to 1.29.0 in /tools. (#953) +- Bump github.com/google/go-cmp from 0.5.0 to 0.5.1. (#957) +- Use `global.Handle` for span export errors in the OTLP exporter. (#946) +- Correct Go language formatting in the README documentation. (#961) +- Remove default SDK dependencies from the `go.opentelemetry.io/otel/api` package. (#977) +- Remove default SDK dependencies from the `go.opentelemetry.io/otel/instrumentation` package. (#983) +- Move documented examples for `go.opentelemetry.io/otel/instrumentation/grpctrace` interceptors into Go example tests. (#984) + +## [0.9.0] - 2020-07-20 + +### Added + +- A new Resource Detector interface is included to allow resources to be automatically detected and included. (#939) +- A Detector to automatically detect resources from an environment variable. (#939) +- Github action to generate protobuf Go bindings locally in `internal/opentelemetry-proto-gen`. (#938) +- OTLP .proto files from `open-telemetry/opentelemetry-proto` imported as a git submodule under `internal/opentelemetry-proto`. + References to `github.com/open-telemetry/opentelemetry-proto` changed to `go.opentelemetry.io/otel/internal/opentelemetry-proto-gen`. (#942) + +### Changed + +- Non-nil value `struct`s for key-value pairs will be marshalled using JSON rather than `Sprintf`. (#948) + +### Removed + +- Removed dependency on `github.com/open-telemetry/opentelemetry-collector`. (#943) + +## [0.8.0] - 2020-07-09 + +### Added + +- The `B3Encoding` type to represent the B3 encoding(s) the B3 propagator can inject. + A value for HTTP supported encodings (Multiple Header: `MultipleHeader`, Single Header: `SingleHeader`) are included. (#882) +- The `FlagsDeferred` trace flag to indicate if the trace sampling decision has been deferred. (#882) +- The `FlagsDebug` trace flag to indicate if the trace is a debug trace. (#882) +- Add `peer.service` semantic attribute. (#898) +- Add database-specific semantic attributes. (#899) +- Add semantic convention for `faas.coldstart` and `container.id`. (#909) +- Add http content size semantic conventions. (#905) +- Include `http.request_content_length` in HTTP request basic attributes. (#905) +- Add semantic conventions for operating system process resource attribute keys. (#919) +- The Jaeger exporter now has a `WithBatchMaxCount` option to specify the maximum number of spans sent in a batch. (#931) + +### Changed + +- Update `CONTRIBUTING.md` to ask for updates to `CHANGELOG.md` with each pull request. (#879) +- Use lowercase header names for B3 Multiple Headers. (#881) +- The B3 propagator `SingleHeader` field has been replaced with `InjectEncoding`. + This new field can be set to combinations of the `B3Encoding` bitmasks and will inject trace information in these encodings. + If no encoding is set, the propagator will default to `MultipleHeader` encoding. (#882) +- The B3 propagator now extracts from either HTTP encoding of B3 (Single Header or Multiple Header) based on what is contained in the header. + Preference is given to Single Header encoding with Multiple Header being the fallback if Single Header is not found or is invalid. + This behavior change is made to dynamically support all correctly encoded traces received instead of having to guess the expected encoding prior to receiving. (#882) +- Extend semantic conventions for RPC. (#900) +- To match constant naming conventions in the `api/standard` package, the `FaaS*` key names are appended with a suffix of `Key`. (#920) + - `"api/standard".FaaSName` -> `FaaSNameKey` + - `"api/standard".FaaSID` -> `FaaSIDKey` + - `"api/standard".FaaSVersion` -> `FaaSVersionKey` + - `"api/standard".FaaSInstance` -> `FaaSInstanceKey` + +### Removed + +- The `FlagsUnused` trace flag is removed. + The purpose of this flag was to act as the inverse of `FlagsSampled`, the inverse of `FlagsSampled` is used instead. (#882) +- The B3 header constants (`B3SingleHeader`, `B3DebugFlagHeader`, `B3TraceIDHeader`, `B3SpanIDHeader`, `B3SampledHeader`, `B3ParentSpanIDHeader`) are removed. + If B3 header keys are needed [the authoritative OpenZipkin package constants](https://pkg.go.dev/github.com/openzipkin/zipkin-go@v0.2.2/propagation/b3?tab=doc#pkg-constants) should be used instead. (#882) + +### Fixed + +- The B3 Single Header name is now correctly `b3` instead of the previous `X-B3`. (#881) +- The B3 propagator now correctly supports sampling only values (`b3: 0`, `b3: 1`, or `b3: d`) for a Single B3 Header. (#882) +- The B3 propagator now propagates the debug flag. + This removes the behavior of changing the debug flag into a set sampling bit. + Instead, this now follow the B3 specification and omits the `X-B3-Sampling` header. (#882) +- The B3 propagator now tracks "unset" sampling state (meaning "defer the decision") and does not set the `X-B3-Sampling` header when injecting. (#882) +- Bump github.com/itchyny/gojq from 0.10.3 to 0.10.4 in /tools. (#883) +- Bump github.com/opentracing/opentracing-go from v1.1.1-0.20190913142402-a7454ce5950e to v1.2.0. (#885) +- The tracing time conversion for OTLP spans is now correctly set to `UnixNano`. (#896) +- Ensure span status is not set to `Unknown` when no HTTP status code is provided as it is assumed to be `200 OK`. (#908) +- Ensure `httptrace.clientTracer` closes `http.headers` span. (#912) +- Prometheus exporter will not apply stale updates or forget inactive metrics. (#903) +- Add test for api.standard `HTTPClientAttributesFromHTTPRequest`. (#905) +- Bump github.com/golangci/golangci-lint from 1.27.0 to 1.28.1 in /tools. (#901, #913) +- Update otel-colector example to use the v0.5.0 collector. (#915) +- The `grpctrace` instrumentation uses a span name conforming to the OpenTelemetry semantic conventions (does not contain a leading slash (`/`)). (#922) +- The `grpctrace` instrumentation includes an `rpc.method` attribute now set to the gRPC method name. (#900, #922) +- The `grpctrace` instrumentation `rpc.service` attribute now contains the package name if one exists. + This is in accordance with OpenTelemetry semantic conventions. (#922) +- Correlation Context extractor will no longer insert an empty map into the returned context when no valid values are extracted. (#923) +- Bump google.golang.org/api from 0.28.0 to 0.29.0 in /exporters/trace/jaeger. (#925) +- Bump github.com/itchyny/gojq from 0.10.4 to 0.11.0 in /tools. (#926) +- Bump github.com/golangci/golangci-lint from 1.28.1 to 1.28.2 in /tools. (#930) + +## [0.7.0] - 2020-06-26 + +This release implements the v0.5.0 version of the OpenTelemetry specification. + +### Added + +- The othttp instrumentation now includes default metrics. (#861) +- This CHANGELOG file to track all changes in the project going forward. +- Support for array type attributes. (#798) +- Apply transitive dependabot go.mod dependency updates as part of a new automatic Github workflow. (#844) +- Timestamps are now passed to exporters for each export. (#835) +- Add new `Accumulation` type to metric SDK to transport telemetry from `Accumulator`s to `Processor`s. + This replaces the prior `Record` `struct` use for this purpose. (#835) +- New dependabot integration to automate package upgrades. (#814) +- `Meter` and `Tracer` implementations accept instrumentation version version as an optional argument. + This instrumentation version is passed on to exporters. (#811) (#805) (#802) +- The OTLP exporter includes the instrumentation version in telemetry it exports. (#811) +- Environment variables for Jaeger exporter are supported. (#796) +- New `aggregation.Kind` in the export metric API. (#808) +- New example that uses OTLP and the collector. (#790) +- Handle errors in the span `SetName` during span initialization. (#791) +- Default service config to enable retries for retry-able failed requests in the OTLP exporter and an option to override this default. (#777) +- New `go.opentelemetry.io/otel/api/oterror` package to uniformly support error handling and definitions for the project. (#778) +- New `global` default implementation of the `go.opentelemetry.io/otel/api/oterror.Handler` interface to be used to handle errors prior to an user defined `Handler`. + There is also functionality for the user to register their `Handler` as well as a convenience function `Handle` to handle an error with this global `Handler`(#778) +- Options to specify propagators for httptrace and grpctrace instrumentation. (#784) +- The required `application/json` header for the Zipkin exporter is included in all exports. (#774) +- Integrate HTTP semantics helpers from the contrib repository into the `api/standard` package. #769 + +### Changed + +- Rename `Integrator` to `Processor` in the metric SDK. (#863) +- Rename `AggregationSelector` to `AggregatorSelector`. (#859) +- Rename `SynchronizedCopy` to `SynchronizedMove`. (#858) +- Rename `simple` integrator to `basic` integrator. (#857) +- Merge otlp collector examples. (#841) +- Change the metric SDK to support cumulative, delta, and pass-through exporters directly. + With these changes, cumulative and delta specific exporters are able to request the correct kind of aggregation from the SDK. (#840) +- The `Aggregator.Checkpoint` API is renamed to `SynchronizedCopy` and adds an argument, a different `Aggregator` into which the copy is stored. (#812) +- The `export.Aggregator` contract is that `Update()` and `SynchronizedCopy()` are synchronized with each other. + All the aggregation interfaces (`Sum`, `LastValue`, ...) are not meant to be synchronized, as the caller is expected to synchronize aggregators at a higher level after the `Accumulator`. + Some of the `Aggregators` used unnecessary locking and that has been cleaned up. (#812) +- Use of `metric.Number` was replaced by `int64` now that we use `sync.Mutex` in the `MinMaxSumCount` and `Histogram` `Aggregators`. (#812) +- Replace `AlwaysParentSample` with `ParentSample(fallback)` to match the OpenTelemetry v0.5.0 specification. (#810) +- Rename `sdk/export/metric/aggregator` to `sdk/export/metric/aggregation`. #808 +- Send configured headers with every request in the OTLP exporter, instead of just on connection creation. (#806) +- Update error handling for any one off error handlers, replacing, instead, with the `global.Handle` function. (#791) +- Rename `plugin` directory to `instrumentation` to match the OpenTelemetry specification. (#779) +- Makes the argument order to Histogram and DDSketch `New()` consistent. (#781) + +### Removed + +- `Uint64NumberKind` and related functions from the API. (#864) +- Context arguments from `Aggregator.Checkpoint` and `Integrator.Process` as they were unused. (#803) +- `SpanID` is no longer included in parameters for sampling decision to match the OpenTelemetry specification. (#775) + +### Fixed + +- Upgrade OTLP exporter to opentelemetry-proto matching the opentelemetry-collector v0.4.0 release. (#866) +- Allow changes to `go.sum` and `go.mod` when running dependabot tidy-up. (#871) +- Bump github.com/stretchr/testify from 1.4.0 to 1.6.1. (#824) +- Bump github.com/prometheus/client_golang from 1.7.0 to 1.7.1 in /exporters/metric/prometheus. (#867) +- Bump google.golang.org/grpc from 1.29.1 to 1.30.0 in /exporters/trace/jaeger. (#853) +- Bump google.golang.org/grpc from 1.29.1 to 1.30.0 in /exporters/trace/zipkin. (#854) +- Bumps github.com/golang/protobuf from 1.3.2 to 1.4.2 (#848) +- Bump github.com/stretchr/testify from 1.4.0 to 1.6.1 in /exporters/otlp (#817) +- Bump github.com/golangci/golangci-lint from 1.25.1 to 1.27.0 in /tools (#828) +- Bump github.com/prometheus/client_golang from 1.5.0 to 1.7.0 in /exporters/metric/prometheus (#838) +- Bump github.com/stretchr/testify from 1.4.0 to 1.6.1 in /exporters/trace/jaeger (#829) +- Bump github.com/benbjohnson/clock from 1.0.0 to 1.0.3 (#815) +- Bump github.com/stretchr/testify from 1.4.0 to 1.6.1 in /exporters/trace/zipkin (#823) +- Bump github.com/itchyny/gojq from 0.10.1 to 0.10.3 in /tools (#830) +- Bump github.com/stretchr/testify from 1.4.0 to 1.6.1 in /exporters/metric/prometheus (#822) +- Bump google.golang.org/grpc from 1.27.1 to 1.29.1 in /exporters/trace/zipkin (#820) +- Bump google.golang.org/grpc from 1.27.1 to 1.29.1 in /exporters/trace/jaeger (#831) +- Bump github.com/google/go-cmp from 0.4.0 to 0.5.0 (#836) +- Bump github.com/google/go-cmp from 0.4.0 to 0.5.0 in /exporters/trace/jaeger (#837) +- Bump github.com/google/go-cmp from 0.4.0 to 0.5.0 in /exporters/otlp (#839) +- Bump google.golang.org/api from 0.20.0 to 0.28.0 in /exporters/trace/jaeger (#843) +- Set span status from HTTP status code in the othttp instrumentation. (#832) +- Fixed typo in push controller comment. (#834) +- The `Aggregator` testing has been updated and cleaned. (#812) +- `metric.Number(0)` expressions are replaced by `0` where possible. (#812) +- Fixed `global` `handler_test.go` test failure. #804 +- Fixed `BatchSpanProcessor.Shutdown` to wait until all spans are processed. (#766) +- Fixed OTLP example's accidental early close of exporter. (#807) +- Ensure zipkin exporter reads and closes response body. (#788) +- Update instrumentation to use `api/standard` keys instead of custom keys. (#782) +- Clean up tools and RELEASING documentation. (#762) + +## [0.6.0] - 2020-05-21 + +### Added + +- Support for `Resource`s in the prometheus exporter. (#757) +- New pull controller. (#751) +- New `UpDownSumObserver` instrument. (#750) +- OpenTelemetry collector demo. (#711) +- New `SumObserver` instrument. (#747) +- New `UpDownCounter` instrument. (#745) +- New timeout `Option` and configuration function `WithTimeout` to the push controller. (#742) +- New `api/standards` package to implement semantic conventions and standard key-value generation. (#731) + +### Changed + +- Rename `Register*` functions in the metric API to `New*` for all `Observer` instruments. (#761) +- Use `[]float64` for histogram boundaries, not `[]metric.Number`. (#758) +- Change OTLP example to use exporter as a trace `Syncer` instead of as an unneeded `Batcher`. (#756) +- Replace `WithResourceAttributes()` with `WithResource()` in the trace SDK. (#754) +- The prometheus exporter now uses the new pull controller. (#751) +- Rename `ScheduleDelayMillis` to `BatchTimeout` in the trace `BatchSpanProcessor`.(#752) +- Support use of synchronous instruments in asynchronous callbacks (#725) +- Move `Resource` from the `Export` method parameter into the metric export `Record`. (#739) +- Rename `Observer` instrument to `ValueObserver`. (#734) +- The push controller now has a method (`Provider()`) to return a `metric.Provider` instead of the old `Meter` method that acted as a `metric.Provider`. (#738) +- Replace `Measure` instrument by `ValueRecorder` instrument. (#732) +- Rename correlation context header from `"Correlation-Context"` to `"otcorrelations"` to match the OpenTelemetry specification. (#727) + +### Fixed + +- Ensure gRPC `ClientStream` override methods do not panic in grpctrace package. (#755) +- Disable parts of `BatchSpanProcessor` test until a fix is found. (#743) +- Fix `string` case in `kv` `Infer` function. (#746) +- Fix panic in grpctrace client interceptors. (#740) +- Refactor the `api/metrics` push controller and add `CheckpointSet` synchronization. (#737) +- Rewrite span batch process queue batching logic. (#719) +- Remove the push controller named Meter map. (#738) +- Fix Histogram aggregator initial state (fix #735). (#736) +- Ensure golang alpine image is running `golang-1.14` for examples. (#733) +- Added test for grpctrace `UnaryInterceptorClient`. (#695) +- Rearrange `api/metric` code layout. (#724) + +## [0.5.0] - 2020-05-13 + +### Added + +- Batch `Observer` callback support. (#717) +- Alias `api` types to root package of project. (#696) +- Create basic `othttp.Transport` for simple client instrumentation. (#678) +- `SetAttribute(string, interface{})` to the trace API. (#674) +- Jaeger exporter option that allows user to specify custom http client. (#671) +- `Stringer` and `Infer` methods to `key`s. (#662) + +### Changed + +- Rename `NewKey` in the `kv` package to just `Key`. (#721) +- Move `core` and `key` to `kv` package. (#720) +- Make the metric API `Meter` a `struct` so the abstract `MeterImpl` can be passed and simplify implementation. (#709) +- Rename SDK `Batcher` to `Integrator` to match draft OpenTelemetry SDK specification. (#710) +- Rename SDK `Ungrouped` integrator to `simple.Integrator` to match draft OpenTelemetry SDK specification. (#710) +- Rename SDK `SDK` `struct` to `Accumulator` to match draft OpenTelemetry SDK specification. (#710) +- Move `Number` from `core` to `api/metric` package. (#706) +- Move `SpanContext` from `core` to `trace` package. (#692) +- Change traceparent header from `Traceparent` to `traceparent` to implement the W3C specification. (#681) + +### Fixed + +- Update tooling to run generators in all submodules. (#705) +- gRPC interceptor regexp to match methods without a service name. (#683) +- Use a `const` for padding 64-bit B3 trace IDs. (#701) +- Update `mockZipkin` listen address from `:0` to `127.0.0.1:0`. (#700) +- Left-pad 64-bit B3 trace IDs with zero. (#698) +- Propagate at least the first W3C tracestate header. (#694) +- Remove internal `StateLocker` implementation. (#688) +- Increase instance size CI system uses. (#690) +- Add a `key` benchmark and use reflection in `key.Infer()`. (#679) +- Fix internal `global` test by using `global.Meter` with `RecordBatch()`. (#680) +- Reimplement histogram using mutex instead of `StateLocker`. (#669) +- Switch `MinMaxSumCount` to a mutex lock implementation instead of `StateLocker`. (#667) +- Update documentation to not include any references to `WithKeys`. (#672) +- Correct misspelling. (#668) +- Fix clobbering of the span context if extraction fails. (#656) +- Bump `golangci-lint` and work around the corrupting bug. (#666) (#670) + +## [0.4.3] - 2020-04-24 + +### Added + +- `Dockerfile` and `docker-compose.yml` to run example code. (#635) +- New `grpctrace` package that provides gRPC client and server interceptors for both unary and stream connections. (#621) +- New `api/label` package, providing common label set implementation. (#651) +- Support for JSON marshaling of `Resources`. (#654) +- `TraceID` and `SpanID` implementations for `Stringer` interface. (#642) +- `RemoteAddrKey` in the othttp plugin to include the HTTP client address in top-level spans. (#627) +- `WithSpanFormatter` option to the othttp plugin. (#617) +- Updated README to include section for compatible libraries and include reference to the contrib repository. (#612) +- The prometheus exporter now supports exporting histograms. (#601) +- A `String` method to the `Resource` to return a hashable identifier for a now unique resource. (#613) +- An `Iter` method to the `Resource` to return an array `AttributeIterator`. (#613) +- An `Equal` method to the `Resource` test the equivalence of resources. (#613) +- An iterable structure (`AttributeIterator`) for `Resource` attributes. + +### Changed + +- zipkin export's `NewExporter` now requires a `serviceName` argument to ensure this needed values is provided. (#644) +- Pass `Resources` through the metrics export pipeline. (#659) + +### Removed + +- `WithKeys` option from the metric API. (#639) + +### Fixed + +- Use the `label.Set.Equivalent` value instead of an encoding in the batcher. (#658) +- Correct typo `trace.Exporter` to `trace.SpanSyncer` in comments. (#653) +- Use type names for return values in jaeger exporter. (#648) +- Increase the visibility of the `api/key` package by updating comments and fixing usages locally. (#650) +- `Checkpoint` only after `Update`; Keep records in the `sync.Map` longer. (#647) +- Do not cache `reflect.ValueOf()` in metric Labels. (#649) +- Batch metrics exported from the OTLP exporter based on `Resource` and labels. (#626) +- Add error wrapping to the prometheus exporter. (#631) +- Update the OTLP exporter batching of traces to use a unique `string` representation of an associated `Resource` as the batching key. (#623) +- Update OTLP `SpanData` transform to only include the `ParentSpanID` if one exists. (#614) +- Update `Resource` internal representation to uniquely and reliably identify resources. (#613) +- Check return value from `CheckpointSet.ForEach` in prometheus exporter. (#622) +- Ensure spans created by httptrace client tracer reflect operation structure. (#618) +- Create a new recorder rather than reuse when multiple observations in same epoch for asynchronous instruments. #610 +- The default port the OTLP exporter uses to connect to the OpenTelemetry collector is updated to match the one the collector listens on by default. (#611) + +## [0.4.2] - 2020-03-31 + +### Fixed + +- Fix `pre_release.sh` to update version in `sdk/opentelemetry.go`. (#607) +- Fix time conversion from internal to OTLP in OTLP exporter. (#606) + +## [0.4.1] - 2020-03-31 + +### Fixed + +- Update `tag.sh` to create signed tags. (#604) + +## [0.4.0] - 2020-03-30 + +### Added + +- New API package `api/metric/registry` that exposes a `MeterImpl` wrapper for use by SDKs to generate unique instruments. (#580) +- Script to verify examples after a new release. (#579) + +### Removed + +- The dogstatsd exporter due to lack of support. + This additionally removes support for statsd. (#591) +- `LabelSet` from the metric API. + This is replaced by a `[]core.KeyValue` slice. (#595) +- `Labels` from the metric API's `Meter` interface. (#595) + +### Changed + +- The metric `export.Labels` became an interface which the SDK implements and the `export` package provides a simple, immutable implementation of this interface intended for testing purposes. (#574) +- Renamed `internal/metric.Meter` to `MeterImpl`. (#580) +- Renamed `api/global/internal.obsImpl` to `asyncImpl`. (#580) + +### Fixed + +- Corrected missing return in mock span. (#582) +- Update License header for all source files to match CNCF guidelines and include a test to ensure it is present. (#586) (#596) +- Update to v0.3.0 of the OTLP in the OTLP exporter. (#588) +- Update pre-release script to be compatible between GNU and BSD based systems. (#592) +- Add a `RecordBatch` benchmark. (#594) +- Moved span transforms of the OTLP exporter to the internal package. (#593) +- Build both go-1.13 and go-1.14 in circleci to test for all supported versions of Go. (#569) +- Removed unneeded allocation on empty labels in OLTP exporter. (#597) +- Update `BatchedSpanProcessor` to process the queue until no data but respect max batch size. (#599) +- Update project documentation godoc.org links to pkg.go.dev. (#602) + +## [0.3.0] - 2020-03-21 + +This is a first official beta release, which provides almost fully complete metrics, tracing, and context propagation functionality. +There is still a possibility of breaking changes. + +### Added + +- Add `Observer` metric instrument. (#474) +- Add global `Propagators` functionality to enable deferred initialization for propagators registered before the first Meter SDK is installed. (#494) +- Simplified export setup pipeline for the jaeger exporter to match other exporters. (#459) +- The zipkin trace exporter. (#495) +- The OTLP exporter to export metric and trace telemetry to the OpenTelemetry collector. (#497) (#544) (#545) +- Add `StatusMessage` field to the trace `Span`. (#524) +- Context propagation in OpenTracing bridge in terms of OpenTelemetry context propagation. (#525) +- The `Resource` type was added to the SDK. (#528) +- The global API now supports a `Tracer` and `Meter` function as shortcuts to getting a global `*Provider` and calling these methods directly. (#538) +- The metric API now defines a generic `MeterImpl` interface to support general purpose `Meter` construction. + Additionally, `SyncImpl` and `AsyncImpl` are added to support general purpose instrument construction. (#560) +- A metric `Kind` is added to represent the `MeasureKind`, `ObserverKind`, and `CounterKind`. (#560) +- Scripts to better automate the release process. (#576) + +### Changed + +- Default to to use `AlwaysSampler` instead of `ProbabilitySampler` to match OpenTelemetry specification. (#506) +- Renamed `AlwaysSampleSampler` to `AlwaysOnSampler` in the trace API. (#511) +- Renamed `NeverSampleSampler` to `AlwaysOffSampler` in the trace API. (#511) +- The `Status` field of the `Span` was changed to `StatusCode` to disambiguate with the added `StatusMessage`. (#524) +- Updated the trace `Sampler` interface conform to the OpenTelemetry specification. (#531) +- Rename metric API `Options` to `Config`. (#541) +- Rename metric `Counter` aggregator to be `Sum`. (#541) +- Unify metric options into `Option` from instrument specific options. (#541) +- The trace API's `TraceProvider` now support `Resource`s. (#545) +- Correct error in zipkin module name. (#548) +- The jaeger trace exporter now supports `Resource`s. (#551) +- Metric SDK now supports `Resource`s. + The `WithResource` option was added to configure a `Resource` on creation and the `Resource` method was added to the metric `Descriptor` to return the associated `Resource`. (#552) +- Replace `ErrNoLastValue` and `ErrEmptyDataSet` by `ErrNoData` in the metric SDK. (#557) +- The stdout trace exporter now supports `Resource`s. (#558) +- The metric `Descriptor` is now included at the API instead of the SDK. (#560) +- Replace `Ordered` with an iterator in `export.Labels`. (#567) + +### Removed + +- The vendor specific Stackdriver. It is now hosted on 3rd party vendor infrastructure. (#452) +- The `Unregister` method for metric observers as it is not in the OpenTelemetry specification. (#560) +- `GetDescriptor` from the metric SDK. (#575) +- The `Gauge` instrument from the metric API. (#537) + +### Fixed + +- Make histogram aggregator checkpoint consistent. (#438) +- Update README with import instructions and how to build and test. (#505) +- The default label encoding was updated to be unique. (#508) +- Use `NewRoot` in the othttp plugin for public endpoints. (#513) +- Fix data race in `BatchedSpanProcessor`. (#518) +- Skip test-386 for Mac OS 10.15.x (Catalina and upwards). #521 +- Use a variable-size array to represent ordered labels in maps. (#523) +- Update the OTLP protobuf and update changed import path. (#532) +- Use `StateLocker` implementation in `MinMaxSumCount`. (#546) +- Eliminate goroutine leak in histogram stress test. (#547) +- Update OTLP exporter with latest protobuf. (#550) +- Add filters to the othttp plugin. (#556) +- Provide an implementation of the `Header*` filters that do not depend on Go 1.14. (#565) +- Encode labels once during checkpoint. + The checkpoint function is executed in a single thread so we can do the encoding lazily before passing the encoded version of labels to the exporter. + This is a cheap and quick way to avoid encoding the labels on every collection interval. (#572) +- Run coverage over all packages in `COVERAGE_MOD_DIR`. (#573) + +## [0.2.3] - 2020-03-04 + +### Added + +- `RecordError` method on `Span`s in the trace API to Simplify adding error events to spans. (#473) +- Configurable push frequency for exporters setup pipeline. (#504) + +### Changed + +- Rename the `exporter` directory to `exporters`. + The `go.opentelemetry.io/otel/exporter/trace/jaeger` package was mistakenly released with a `v1.0.0` tag instead of `v0.1.0`. + This resulted in all subsequent releases not becoming the default latest. + A consequence of this was that all `go get`s pulled in the incompatible `v0.1.0` release of that package when pulling in more recent packages from other otel packages. + Renaming the `exporter` directory to `exporters` fixes this issue by renaming the package and therefore clearing any existing dependency tags. + Consequentially, this action also renames *all* exporter packages. (#502) + +### Removed + +- The `CorrelationContextHeader` constant in the `correlation` package is no longer exported. (#503) + +## [0.2.2] - 2020-02-27 + +### Added + +- `HTTPSupplier` interface in the propagation API to specify methods to retrieve and store a single value for a key to be associated with a carrier. (#467) +- `HTTPExtractor` interface in the propagation API to extract information from an `HTTPSupplier` into a context. (#467) +- `HTTPInjector` interface in the propagation API to inject information into an `HTTPSupplier.` (#467) +- `Config` and configuring `Option` to the propagator API. (#467) +- `Propagators` interface in the propagation API to contain the set of injectors and extractors for all supported carrier formats. (#467) +- `HTTPPropagator` interface in the propagation API to inject and extract from an `HTTPSupplier.` (#467) +- `WithInjectors` and `WithExtractors` functions to the propagator API to configure injectors and extractors to use. (#467) +- `ExtractHTTP` and `InjectHTTP` functions to apply configured HTTP extractors and injectors to a passed context. (#467) +- Histogram aggregator. (#433) +- `DefaultPropagator` function and have it return `trace.TraceContext` as the default context propagator. (#456) +- `AlwaysParentSample` sampler to the trace API. (#455) +- `WithNewRoot` option function to the trace API to specify the created span should be considered a root span. (#451) + +### Changed + +- Renamed `WithMap` to `ContextWithMap` in the correlation package. (#481) +- Renamed `FromContext` to `MapFromContext` in the correlation package. (#481) +- Move correlation context propagation to correlation package. (#479) +- Do not default to putting remote span context into links. (#480) +- `Tracer.WithSpan` updated to accept `StartOptions`. (#472) +- Renamed `MetricKind` to `Kind` to not stutter in the type usage. (#432) +- Renamed the `export` package to `metric` to match directory structure. (#432) +- Rename the `api/distributedcontext` package to `api/correlation`. (#444) +- Rename the `api/propagators` package to `api/propagation`. (#444) +- Move the propagators from the `propagators` package into the `trace` API package. (#444) +- Update `Float64Gauge`, `Int64Gauge`, `Float64Counter`, `Int64Counter`, `Float64Measure`, and `Int64Measure` metric methods to use value receivers instead of pointers. (#462) +- Moved all dependencies of tools package to a tools directory. (#466) + +### Removed + +- Binary propagators. (#467) +- NOOP propagator. (#467) + +### Fixed + +- Upgraded `github.com/golangci/golangci-lint` from `v1.21.0` to `v1.23.6` in `tools/`. (#492) +- Fix a possible nil-dereference crash (#478) +- Correct comments for `InstallNewPipeline` in the stdout exporter. (#483) +- Correct comments for `InstallNewPipeline` in the dogstatsd exporter. (#484) +- Correct comments for `InstallNewPipeline` in the prometheus exporter. (#482) +- Initialize `onError` based on `Config` in prometheus exporter. (#486) +- Correct module name in prometheus exporter README. (#475) +- Removed tracer name prefix from span names. (#430) +- Fix `aggregator_test.go` import package comment. (#431) +- Improved detail in stdout exporter. (#436) +- Fix a dependency issue (generate target should depend on stringer, not lint target) in Makefile. (#442) +- Reorders the Makefile targets within `precommit` target so we generate files and build the code before doing linting, so we can get much nicer errors about syntax errors from the compiler. (#442) +- Reword function documentation in gRPC plugin. (#446) +- Send the `span.kind` tag to Jaeger from the jaeger exporter. (#441) +- Fix `metadataSupplier` in the jaeger exporter to overwrite the header if existing instead of appending to it. (#441) +- Upgraded to Go 1.13 in CI. (#465) +- Correct opentelemetry.io URL in trace SDK documentation. (#464) +- Refactored reference counting logic in SDK determination of stale records. (#468) +- Add call to `runtime.Gosched` in instrument `acquireHandle` logic to not block the collector. (#469) + +## [0.2.1.1] - 2020-01-13 + +### Fixed + +- Use stateful batcher on Prometheus exporter fixing regression introduced in #395. (#428) + +## [0.2.1] - 2020-01-08 + +### Added + +- Global meter forwarding implementation. + This enables deferred initialization for metric instruments registered before the first Meter SDK is installed. (#392) +- Global trace forwarding implementation. + This enables deferred initialization for tracers registered before the first Trace SDK is installed. (#406) +- Standardize export pipeline creation in all exporters. (#395) +- A testing, organization, and comments for 64-bit field alignment. (#418) +- Script to tag all modules in the project. (#414) + +### Changed + +- Renamed `propagation` package to `propagators`. (#362) +- Renamed `B3Propagator` propagator to `B3`. (#362) +- Renamed `TextFormatPropagator` propagator to `TextFormat`. (#362) +- Renamed `BinaryPropagator` propagator to `Binary`. (#362) +- Renamed `BinaryFormatPropagator` propagator to `BinaryFormat`. (#362) +- Renamed `NoopTextFormatPropagator` propagator to `NoopTextFormat`. (#362) +- Renamed `TraceContextPropagator` propagator to `TraceContext`. (#362) +- Renamed `SpanOption` to `StartOption` in the trace API. (#369) +- Renamed `StartOptions` to `StartConfig` in the trace API. (#369) +- Renamed `EndOptions` to `EndConfig` in the trace API. (#369) +- `Number` now has a pointer receiver for its methods. (#375) +- Renamed `CurrentSpan` to `SpanFromContext` in the trace API. (#379) +- Renamed `SetCurrentSpan` to `ContextWithSpan` in the trace API. (#379) +- Renamed `Message` in Event to `Name` in the trace API. (#389) +- Prometheus exporter no longer aggregates metrics, instead it only exports them. (#385) +- Renamed `HandleImpl` to `BoundInstrumentImpl` in the metric API. (#400) +- Renamed `Float64CounterHandle` to `Float64CounterBoundInstrument` in the metric API. (#400) +- Renamed `Int64CounterHandle` to `Int64CounterBoundInstrument` in the metric API. (#400) +- Renamed `Float64GaugeHandle` to `Float64GaugeBoundInstrument` in the metric API. (#400) +- Renamed `Int64GaugeHandle` to `Int64GaugeBoundInstrument` in the metric API. (#400) +- Renamed `Float64MeasureHandle` to `Float64MeasureBoundInstrument` in the metric API. (#400) +- Renamed `Int64MeasureHandle` to `Int64MeasureBoundInstrument` in the metric API. (#400) +- Renamed `Release` method for bound instruments in the metric API to `Unbind`. (#400) +- Renamed `AcquireHandle` method for bound instruments in the metric API to `Bind`. (#400) +- Renamed the `File` option in the stdout exporter to `Writer`. (#404) +- Renamed all `Options` to `Config` for all metric exports where this wasn't already the case. + +### Fixed + +- Aggregator import path corrected. (#421) +- Correct links in README. (#368) +- The README was updated to match latest code changes in its examples. (#374) +- Don't capitalize error statements. (#375) +- Fix ignored errors. (#375) +- Fix ambiguous variable naming. (#375) +- Removed unnecessary type casting. (#375) +- Use named parameters. (#375) +- Updated release schedule. (#378) +- Correct http-stackdriver example module name. (#394) +- Removed the `http.request` span in `httptrace` package. (#397) +- Add comments in the metrics SDK (#399) +- Initialize checkpoint when creating ddsketch aggregator to prevent panic when merging into a empty one. (#402) (#403) +- Add documentation of compatible exporters in the README. (#405) +- Typo fix. (#408) +- Simplify span check logic in SDK tracer implementation. (#419) + +## [0.2.0] - 2019-12-03 + +### Added + +- Unary gRPC tracing example. (#351) +- Prometheus exporter. (#334) +- Dogstatsd metrics exporter. (#326) + +### Changed + +- Rename `MaxSumCount` aggregation to `MinMaxSumCount` and add the `Min` interface for this aggregation. (#352) +- Rename `GetMeter` to `Meter`. (#357) +- Rename `HTTPTraceContextPropagator` to `TraceContextPropagator`. (#355) +- Rename `HTTPB3Propagator` to `B3Propagator`. (#355) +- Rename `HTTPTraceContextPropagator` to `TraceContextPropagator`. (#355) +- Move `/global` package to `/api/global`. (#356) +- Rename `GetTracer` to `Tracer`. (#347) + +### Removed + +- `SetAttribute` from the `Span` interface in the trace API. (#361) +- `AddLink` from the `Span` interface in the trace API. (#349) +- `Link` from the `Span` interface in the trace API. (#349) + +### Fixed + +- Exclude example directories from coverage report. (#365) +- Lint make target now implements automatic fixes with `golangci-lint` before a second run to report the remaining issues. (#360) +- Drop `GO111MODULE` environment variable in Makefile as Go 1.13 is the project specified minimum version and this is environment variable is not needed for that version of Go. (#359) +- Run the race checker for all test. (#354) +- Redundant commands in the Makefile are removed. (#354) +- Split the `generate` and `lint` targets of the Makefile. (#354) +- Renames `circle-ci` target to more generic `ci` in Makefile. (#354) +- Add example Prometheus binary to gitignore. (#358) +- Support negative numbers with the `MaxSumCount`. (#335) +- Resolve race conditions in `push_test.go` identified in #339. (#340) +- Use `/usr/bin/env bash` as a shebang in scripts rather than `/bin/bash`. (#336) +- Trace benchmark now tests both `AlwaysSample` and `NeverSample`. + Previously it was testing `AlwaysSample` twice. (#325) +- Trace benchmark now uses a `[]byte` for `TraceID` to fix failing test. (#325) +- Added a trace benchmark to test variadic functions in `setAttribute` vs `setAttributes` (#325) +- The `defaultkeys` batcher was only using the encoded label set as its map key while building a checkpoint. + This allowed distinct label sets through, but any metrics sharing a label set could be overwritten or merged incorrectly. + This was corrected. (#333) + +## [0.1.2] - 2019-11-18 + +### Fixed + +- Optimized the `simplelru` map for attributes to reduce the number of allocations. (#328) +- Removed unnecessary unslicing of parameters that are already a slice. (#324) + +## [0.1.1] - 2019-11-18 + +This release contains a Metrics SDK with stdout exporter and supports basic aggregations such as counter, gauges, array, maxsumcount, and ddsketch. + +### Added + +- Metrics stdout export pipeline. (#265) +- Array aggregation for raw measure metrics. (#282) +- The core.Value now have a `MarshalJSON` method. (#281) + +### Removed + +- `WithService`, `WithResources`, and `WithComponent` methods of tracers. (#314) +- Prefix slash in `Tracer.Start()` for the Jaeger example. (#292) + +### Changed + +- Allocation in LabelSet construction to reduce GC overhead. (#318) +- `trace.WithAttributes` to append values instead of replacing (#315) +- Use a formula for tolerance in sampling tests. (#298) +- Move export types into trace and metric-specific sub-directories. (#289) +- `SpanKind` back to being based on an `int` type. (#288) + +### Fixed + +- URL to OpenTelemetry website in README. (#323) +- Name of othttp default tracer. (#321) +- `ExportSpans` for the stackdriver exporter now handles `nil` context. (#294) +- CI modules cache to correctly restore/save from/to the cache. (#316) +- Fix metric SDK race condition between `LoadOrStore` and the assignment `rec.recorder = i.meter.exporter.AggregatorFor(rec)`. (#293) +- README now reflects the new code structure introduced with these changes. (#291) +- Make the basic example work. (#279) + +## [0.1.0] - 2019-11-04 + +This is the first release of open-telemetry go library. +It contains api and sdk for trace and meter. + +### Added + +- Initial OpenTelemetry trace and metric API prototypes. +- Initial OpenTelemetry trace, metric, and export SDK packages. +- A wireframe bridge to support compatibility with OpenTracing. +- Example code for a basic, http-stackdriver, http, jaeger, and named tracer setup. +- Exporters for Jaeger, Stackdriver, and stdout. +- Propagators for binary, B3, and trace-context protocols. +- Project information and guidelines in the form of a README and CONTRIBUTING. +- Tools to build the project and a Makefile to automate the process. +- Apache-2.0 license. +- CircleCI build CI manifest files. +- CODEOWNERS file to track owners of this project. + +[Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v1.21.0...HEAD +[1.21.0/0.44.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.21.0 +[1.20.0/0.43.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.20.0 +[1.19.0/0.42.0/0.0.7]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.19.0 +[1.19.0-rc.1/0.42.0-rc.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.19.0-rc.1 +[1.18.0/0.41.0/0.0.6]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.18.0 +[1.17.0/0.40.0/0.0.5]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.17.0 +[1.16.0/0.39.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.16.0 +[1.16.0-rc.1/0.39.0-rc.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.16.0-rc.1 +[1.15.1/0.38.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.15.1 +[1.15.0/0.38.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.15.0 +[1.15.0-rc.2/0.38.0-rc.2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.15.0-rc.2 +[1.15.0-rc.1/0.38.0-rc.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.15.0-rc.1 +[1.14.0/0.37.0/0.0.4]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.14.0 +[1.13.0/0.36.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.13.0 +[1.12.0/0.35.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.12.0 +[1.11.2/0.34.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.11.2 +[1.11.1/0.33.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.11.1 +[1.11.0/0.32.3]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.11.0 +[0.32.2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/sdk/metric/v0.32.2 +[0.32.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/sdk/metric/v0.32.1 +[0.32.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/sdk/metric/v0.32.0 +[1.10.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.10.0 +[1.9.0/0.0.3]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.9.0 +[1.8.0/0.31.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.8.0 +[1.7.0/0.30.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.7.0 +[0.29.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/metric/v0.29.0 +[1.6.3]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.6.3 +[1.6.2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.6.2 +[1.6.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.6.1 +[1.6.0/0.28.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.6.0 +[1.5.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.5.0 +[1.4.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.4.1 +[1.4.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.4.0 +[1.3.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.3.0 +[1.2.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.2.0 +[1.1.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.1.0 +[1.0.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.0.1 +[Metrics 0.24.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/metric/v0.24.0 +[1.0.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.0.0 +[1.0.0-RC3]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.0.0-RC3 +[1.0.0-RC2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.0.0-RC2 +[Experimental Metrics v0.22.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/metric/v0.22.0 +[1.0.0-RC1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.0.0-RC1 +[0.20.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.20.0 +[0.19.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.19.0 +[0.18.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.18.0 +[0.17.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.17.0 +[0.16.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.16.0 +[0.15.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.15.0 +[0.14.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.14.0 +[0.13.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.13.0 +[0.12.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.12.0 +[0.11.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.11.0 +[0.10.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.10.0 +[0.9.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.9.0 +[0.8.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.8.0 +[0.7.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.7.0 +[0.6.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.6.0 +[0.5.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.5.0 +[0.4.3]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.4.3 +[0.4.2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.4.2 +[0.4.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.4.1 +[0.4.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.4.0 +[0.3.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.3.0 +[0.2.3]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.2.3 +[0.2.2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.2.2 +[0.2.1.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.2.1.1 +[0.2.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.2.1 +[0.2.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.2.0 +[0.1.2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.1.2 +[0.1.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.1.1 +[0.1.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.1.0 + +[Go 1.20]: https://go.dev/doc/go1.20 +[Go 1.19]: https://go.dev/doc/go1.19 +[Go 1.18]: https://go.dev/doc/go1.18 + +[metric API]:https://pkg.go.dev/go.opentelemetry.io/otel/metric +[metric SDK]:https://pkg.go.dev/go.opentelemetry.io/otel/sdk/metric +[trace API]:https://pkg.go.dev/go.opentelemetry.io/otel/trace diff --git a/vendor/go.opentelemetry.io/otel/CODEOWNERS b/vendor/go.opentelemetry.io/otel/CODEOWNERS new file mode 100644 index 000000000..623740007 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/CODEOWNERS @@ -0,0 +1,17 @@ +##################################################### +# +# List of approvers for this repository +# +##################################################### +# +# Learn about membership in OpenTelemetry community: +# https://github.com/open-telemetry/community/blob/main/community-membership.md +# +# +# Learn about CODEOWNERS file format: +# https://help.github.com/en/articles/about-code-owners +# + +* @MrAlias @Aneurysm9 @evantorrie @XSAM @dashpole @MadVikingGod @pellared @hanyuancheung @dmathieu + +CODEOWNERS @MrAlias @MadVikingGod @pellared \ No newline at end of file diff --git a/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md b/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md new file mode 100644 index 000000000..850606ae6 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md @@ -0,0 +1,624 @@ +# Contributing to opentelemetry-go + +The Go special interest group (SIG) meets regularly. See the +OpenTelemetry +[community](https://github.com/open-telemetry/community#golang-sdk) +repo for information on this and other language SIGs. + +See the [public meeting +notes](https://docs.google.com/document/d/1E5e7Ld0NuU1iVvf-42tOBpu2VBBLYnh73GJuITGJTTU/edit) +for a summary description of past meetings. To request edit access, +join the meeting or get in touch on +[Slack](https://cloud-native.slack.com/archives/C01NPAXACKT). + +## Development + +You can view and edit the source code by cloning this repository: + +```sh +git clone https://github.com/open-telemetry/opentelemetry-go.git +``` + +Run `make test` to run the tests instead of `go test`. + +There are some generated files checked into the repo. To make sure +that the generated files are up-to-date, run `make` (or `make +precommit` - the `precommit` target is the default). + +The `precommit` target also fixes the formatting of the code and +checks the status of the go module files. + +Additionally, there is a `codespell` target that checks for common +typos in the code. It is not run by default, but you can run it +manually with `make codespell`. It will set up a virtual environment +in `venv` and install `codespell` there. + +If after running `make precommit` the output of `git status` contains +`nothing to commit, working tree clean` then it means that everything +is up-to-date and properly formatted. + +## Pull Requests + +### How to Send Pull Requests + +Everyone is welcome to contribute code to `opentelemetry-go` via +GitHub pull requests (PRs). + +To create a new PR, fork the project in GitHub and clone the upstream +repo: + +```sh +go get -d go.opentelemetry.io/otel +``` + +(This may print some warning about "build constraints exclude all Go +files", just ignore it.) + +This will put the project in `${GOPATH}/src/go.opentelemetry.io/otel`. You +can alternatively use `git` directly with: + +```sh +git clone https://github.com/open-telemetry/opentelemetry-go +``` + +(Note that `git clone` is *not* using the `go.opentelemetry.io/otel` name - +that name is a kind of a redirector to GitHub that `go get` can +understand, but `git` does not.) + +This would put the project in the `opentelemetry-go` directory in +current working directory. + +Enter the newly created directory and add your fork as a new remote: + +```sh +git remote add git@github.com:/opentelemetry-go +``` + +Check out a new branch, make modifications, run linters and tests, update +`CHANGELOG.md`, and push the branch to your fork: + +```sh +git checkout -b +# edit files +# update changelog +make precommit +git add -p +git commit +git push +``` + +Open a pull request against the main `opentelemetry-go` repo. Be sure to add the pull +request ID to the entry you added to `CHANGELOG.md`. + +Avoid rebasing and force-pushing to your branch to facilitate reviewing the pull request. +Rewriting Git history makes it difficult to keep track of iterations during code review. +All pull requests are squashed to a single commit upon merge to `main`. + +### How to Receive Comments + +* If the PR is not ready for review, please put `[WIP]` in the title, + tag it as `work-in-progress`, or mark it as + [`draft`](https://github.blog/2019-02-14-introducing-draft-pull-requests/). +* Make sure CLA is signed and CI is clear. + +### How to Get PRs Merged + +A PR is considered **ready to merge** when: + +* It has received two qualified approvals[^1]. + + This is not enforced through automation, but needs to be validated by the + maintainer merging. + * The qualified approvals need to be from [Approver]s/[Maintainer]s + affiliated with different companies. Two qualified approvals from + [Approver]s or [Maintainer]s affiliated with the same company counts as a + single qualified approval. + * PRs introducing changes that have already been discussed and consensus + reached only need one qualified approval. The discussion and resolution + needs to be linked to the PR. + * Trivial changes[^2] only need one qualified approval. + +* All feedback has been addressed. + * All PR comments and suggestions are resolved. + * All GitHub Pull Request reviews with a status of "Request changes" have + been addressed. Another review by the objecting reviewer with a different + status can be submitted to clear the original review, or the review can be + dismissed by a [Maintainer] when the issues from the original review have + been addressed. + * Any comments or reviews that cannot be resolved between the PR author and + reviewers can be submitted to the community [Approver]s and [Maintainer]s + during the weekly SIG meeting. If consensus is reached among the + [Approver]s and [Maintainer]s during the SIG meeting the objections to the + PR may be dismissed or resolved or the PR closed by a [Maintainer]. + * Any substantive changes to the PR require existing Approval reviews be + cleared unless the approver explicitly states that their approval persists + across changes. This includes changes resulting from other feedback. + [Approver]s and [Maintainer]s can help in clearing reviews and they should + be consulted if there are any questions. + +* The PR branch is up to date with the base branch it is merging into. + * To ensure this does not block the PR, it should be configured to allow + maintainers to update it. + +* It has been open for review for at least one working day. This gives people + reasonable time to review. + * Trivial changes[^2] do not have to wait for one day and may be merged with + a single [Maintainer]'s approval. + +* All required GitHub workflows have succeeded. +* Urgent fix can take exception as long as it has been actively communicated + among [Maintainer]s. + +Any [Maintainer] can merge the PR once the above criteria have been met. + +[^1]: A qualified approval is a GitHub Pull Request review with "Approve" + status from an OpenTelemetry Go [Approver] or [Maintainer]. +[^2]: Trivial changes include: typo corrections, cosmetic non-substantive + changes, documentation corrections or updates, dependency updates, etc. + +## Design Choices + +As with other OpenTelemetry clients, opentelemetry-go follows the +[OpenTelemetry Specification](https://opentelemetry.io/docs/specs/otel). + +It's especially valuable to read through the [library +guidelines](https://opentelemetry.io/docs/specs/otel/library-guidelines). + +### Focus on Capabilities, Not Structure Compliance + +OpenTelemetry is an evolving specification, one where the desires and +use cases are clear, but the method to satisfy those uses cases are +not. + +As such, Contributions should provide functionality and behavior that +conforms to the specification, but the interface and structure is +flexible. + +It is preferable to have contributions follow the idioms of the +language rather than conform to specific API names or argument +patterns in the spec. + +For a deeper discussion, see +[this](https://github.com/open-telemetry/opentelemetry-specification/issues/165). + +## Documentation + +Each (non-internal, non-test) package must be documented using +[Go Doc Comments](https://go.dev/doc/comment), +preferably in a `doc.go` file. + +Prefer using [Examples](https://pkg.go.dev/testing#hdr-Examples) +instead of putting code snippets in Go doc comments. +In some cases, you can even create [Testable Examples](https://go.dev/blog/examples). + +You can install and run a "local Go Doc site" in the following way: + + ```sh + go install golang.org/x/pkgsite/cmd/pkgsite@latest + pkgsite + ``` + +[`go.opentelemetry.io/otel/metric`](https://pkg.go.dev/go.opentelemetry.io/otel/metric) +is an example of a very well-documented package. + +## Style Guide + +One of the primary goals of this project is that it is actually used by +developers. With this goal in mind the project strives to build +user-friendly and idiomatic Go code adhering to the Go community's best +practices. + +For a non-comprehensive but foundational overview of these best practices +the [Effective Go](https://golang.org/doc/effective_go.html) documentation +is an excellent starting place. + +As a convenience for developers building this project the `make precommit` +will format, lint, validate, and in some cases fix the changes you plan to +submit. This check will need to pass for your changes to be able to be +merged. + +In addition to idiomatic Go, the project has adopted certain standards for +implementations of common patterns. These standards should be followed as a +default, and if they are not followed documentation needs to be included as +to the reasons why. + +### Configuration + +When creating an instantiation function for a complex `type T struct`, it is +useful to allow variable number of options to be applied. However, the strong +type system of Go restricts the function design options. There are a few ways +to solve this problem, but we have landed on the following design. + +#### `config` + +Configuration should be held in a `struct` named `config`, or prefixed with +specific type name this Configuration applies to if there are multiple +`config` in the package. This type must contain configuration options. + +```go +// config contains configuration options for a thing. +type config struct { + // options ... +} +``` + +In general the `config` type will not need to be used externally to the +package and should be unexported. If, however, it is expected that the user +will likely want to build custom options for the configuration, the `config` +should be exported. Please, include in the documentation for the `config` +how the user can extend the configuration. + +It is important that internal `config` are not shared across package boundaries. +Meaning a `config` from one package should not be directly used by another. The +one exception is the API packages. The configs from the base API, eg. +`go.opentelemetry.io/otel/trace.TracerConfig` and +`go.opentelemetry.io/otel/metric.InstrumentConfig`, are intended to be consumed +by the SDK therefore it is expected that these are exported. + +When a config is exported we want to maintain forward and backward +compatibility, to achieve this no fields should be exported but should +instead be accessed by methods. + +Optionally, it is common to include a `newConfig` function (with the same +naming scheme). This function wraps any defaults setting and looping over +all options to create a configured `config`. + +```go +// newConfig returns an appropriately configured config. +func newConfig(options ...Option) config { + // Set default values for config. + config := config{/* […] */} + for _, option := range options { + config = option.apply(config) + } + // Perform any validation here. + return config +} +``` + +If validation of the `config` options is also performed this can return an +error as well that is expected to be handled by the instantiation function +or propagated to the user. + +Given the design goal of not having the user need to work with the `config`, +the `newConfig` function should also be unexported. + +#### `Option` + +To set the value of the options a `config` contains, a corresponding +`Option` interface type should be used. + +```go +type Option interface { + apply(config) config +} +``` + +Having `apply` unexported makes sure that it will not be used externally. +Moreover, the interface becomes sealed so the user cannot easily implement +the interface on its own. + +The `apply` method should return a modified version of the passed config. +This approach, instead of passing a pointer, is used to prevent the config from being allocated to the heap. + +The name of the interface should be prefixed in the same way the +corresponding `config` is (if at all). + +#### Options + +All user configurable options for a `config` must have a related unexported +implementation of the `Option` interface and an exported configuration +function that wraps this implementation. + +The wrapping function name should be prefixed with `With*` (or in the +special case of a boolean options `Without*`) and should have the following +function signature. + +```go +func With*(…) Option { … } +``` + +##### `bool` Options + +```go +type defaultFalseOption bool + +func (o defaultFalseOption) apply(c config) config { + c.Bool = bool(o) + return c +} + +// WithOption sets a T to have an option included. +func WithOption() Option { + return defaultFalseOption(true) +} +``` + +```go +type defaultTrueOption bool + +func (o defaultTrueOption) apply(c config) config { + c.Bool = bool(o) + return c +} + +// WithoutOption sets a T to have Bool option excluded. +func WithoutOption() Option { + return defaultTrueOption(false) +} +``` + +##### Declared Type Options + +```go +type myTypeOption struct { + MyType MyType +} + +func (o myTypeOption) apply(c config) config { + c.MyType = o.MyType + return c +} + +// WithMyType sets T to have include MyType. +func WithMyType(t MyType) Option { + return myTypeOption{t} +} +``` + +##### Functional Options + +```go +type optionFunc func(config) config + +func (fn optionFunc) apply(c config) config { + return fn(c) +} + +// WithMyType sets t as MyType. +func WithMyType(t MyType) Option { + return optionFunc(func(c config) config { + c.MyType = t + return c + }) +} +``` + +#### Instantiation + +Using this configuration pattern to configure instantiation with a `NewT` +function. + +```go +func NewT(options ...Option) T {…} +``` + +Any required parameters can be declared before the variadic `options`. + +#### Dealing with Overlap + +Sometimes there are multiple complex `struct` that share common +configuration and also have distinct configuration. To avoid repeated +portions of `config`s, a common `config` can be used with the union of +options being handled with the `Option` interface. + +For example. + +```go +// config holds options for all animals. +type config struct { + Weight float64 + Color string + MaxAltitude float64 +} + +// DogOption apply Dog specific options. +type DogOption interface { + applyDog(config) config +} + +// BirdOption apply Bird specific options. +type BirdOption interface { + applyBird(config) config +} + +// Option apply options for all animals. +type Option interface { + BirdOption + DogOption +} + +type weightOption float64 + +func (o weightOption) applyDog(c config) config { + c.Weight = float64(o) + return c +} + +func (o weightOption) applyBird(c config) config { + c.Weight = float64(o) + return c +} + +func WithWeight(w float64) Option { return weightOption(w) } + +type furColorOption string + +func (o furColorOption) applyDog(c config) config { + c.Color = string(o) + return c +} + +func WithFurColor(c string) DogOption { return furColorOption(c) } + +type maxAltitudeOption float64 + +func (o maxAltitudeOption) applyBird(c config) config { + c.MaxAltitude = float64(o) + return c +} + +func WithMaxAltitude(a float64) BirdOption { return maxAltitudeOption(a) } + +func NewDog(name string, o ...DogOption) Dog {…} +func NewBird(name string, o ...BirdOption) Bird {…} +``` + +### Interfaces + +To allow other developers to better comprehend the code, it is important +to ensure it is sufficiently documented. One simple measure that contributes +to this aim is self-documenting by naming method parameters. Therefore, +where appropriate, methods of every exported interface type should have +their parameters appropriately named. + +#### Interface Stability + +All exported stable interfaces that include the following warning in their +documentation are allowed to be extended with additional methods. + +> Warning: methods may be added to this interface in minor releases. + +These interfaces are defined by the OpenTelemetry specification and will be +updated as the specification evolves. + +Otherwise, stable interfaces MUST NOT be modified. + +#### How to Change Specification Interfaces + +When an API change must be made, we will update the SDK with the new method one +release before the API change. This will allow the SDK one version before the +API change to work seamlessly with the new API. + +If an incompatible version of the SDK is used with the new API the application +will fail to compile. + +#### How Not to Change Specification Interfaces + +We have explored using a v2 of the API to change interfaces and found that there +was no way to introduce a v2 and have it work seamlessly with the v1 of the API. +Problems happened with libraries that upgraded to v2 when an application did not, +and would not produce any telemetry. + +More detail of the approaches considered and their limitations can be found in +the [Use a V2 API to evolve interfaces](https://github.com/open-telemetry/opentelemetry-go/issues/3920) +issue. + +#### How to Change Other Interfaces + +If new functionality is needed for an interface that cannot be changed it MUST +be added by including an additional interface. That added interface can be a +simple interface for the specific functionality that you want to add or it can +be a super-set of the original interface. For example, if you wanted to a +`Close` method to the `Exporter` interface: + +```go +type Exporter interface { + Export() +} +``` + +A new interface, `Closer`, can be added: + +```go +type Closer interface { + Close() +} +``` + +Code that is passed the `Exporter` interface can now check to see if the passed +value also satisfies the new interface. E.g. + +```go +func caller(e Exporter) { + /* ... */ + if c, ok := e.(Closer); ok { + c.Close() + } + /* ... */ +} +``` + +Alternatively, a new type that is the super-set of an `Exporter` can be created. + +```go +type ClosingExporter struct { + Exporter + Close() +} +``` + +This new type can be used similar to the simple interface above in that a +passed `Exporter` type can be asserted to satisfy the `ClosingExporter` type +and the `Close` method called. + +This super-set approach can be useful if there is explicit behavior that needs +to be coupled with the original type and passed as a unified type to a new +function, but, because of this coupling, it also limits the applicability of +the added functionality. If there exist other interfaces where this +functionality should be added, each one will need their own super-set +interfaces and will duplicate the pattern. For this reason, the simple targeted +interface that defines the specific functionality should be preferred. + +### Testing + +The tests should never leak goroutines. + +Use the term `ConcurrentSafe` in the test name when it aims to verify the +absence of race conditions. + +### Internal packages + +The use of internal packages should be scoped to a single module. A sub-module +should never import from a parent internal package. This creates a coupling +between the two modules where a user can upgrade the parent without the child +and if the internal package API has changed it will fail to upgrade[^3]. + +There are two known exceptions to this rule: + +- `go.opentelemetry.io/otel/internal/global` + - This package manages global state for all of opentelemetry-go. It needs to + be a single package in order to ensure the uniqueness of the global state. +- `go.opentelemetry.io/otel/internal/baggage` + - This package provides values in a `context.Context` that need to be + recognized by `go.opentelemetry.io/otel/baggage` and + `go.opentelemetry.io/otel/bridge/opentracing` but remain private. + +If you have duplicate code in multiple modules, make that code into a Go +template stored in `go.opentelemetry.io/otel/internal/shared` and use [gotmpl] +to render the templates in the desired locations. See [#4404] for an example of +this. + +[^3]: https://github.com/open-telemetry/opentelemetry-go/issues/3548 + +## Approvers and Maintainers + +### Approvers + +- [Evan Torrie](https://github.com/evantorrie), Verizon Media +- [Sam Xie](https://github.com/XSAM), Cisco/AppDynamics +- [David Ashpole](https://github.com/dashpole), Google +- [Chester Cheung](https://github.com/hanyuancheung), Tencent +- [Damien Mathieu](https://github.com/dmathieu), Elastic +- [Anthony Mirabella](https://github.com/Aneurysm9), AWS + +### Maintainers + +- [Aaron Clawson](https://github.com/MadVikingGod), LightStep +- [Robert Pająk](https://github.com/pellared), Splunk +- [Tyler Yahn](https://github.com/MrAlias), Splunk + +### Emeritus + +- [Gustavo Silva Paiva](https://github.com/paivagustavo), LightStep +- [Josh MacDonald](https://github.com/jmacd), LightStep + +### Become an Approver or a Maintainer + +See the [community membership document in OpenTelemetry community +repo](https://github.com/open-telemetry/community/blob/main/community-membership.md). + +[Approver]: #approvers +[Maintainer]: #maintainers +[gotmpl]: https://pkg.go.dev/go.opentelemetry.io/build-tools/gotmpl +[#4404]: https://github.com/open-telemetry/opentelemetry-go/pull/4404 diff --git a/vendor/go.opentelemetry.io/otel/LICENSE b/vendor/go.opentelemetry.io/otel/LICENSE new file mode 100644 index 000000000..261eeb9e9 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/go.opentelemetry.io/otel/Makefile b/vendor/go.opentelemetry.io/otel/Makefile new file mode 100644 index 000000000..35fc18996 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/Makefile @@ -0,0 +1,318 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +TOOLS_MOD_DIR := ./internal/tools + +ALL_DOCS := $(shell find . -name '*.md' -type f | sort) +ALL_GO_MOD_DIRS := $(shell find . -type f -name 'go.mod' -exec dirname {} \; | sort) +OTEL_GO_MOD_DIRS := $(filter-out $(TOOLS_MOD_DIR), $(ALL_GO_MOD_DIRS)) +ALL_COVERAGE_MOD_DIRS := $(shell find . -type f -name 'go.mod' -exec dirname {} \; | grep -E -v '^./example|^$(TOOLS_MOD_DIR)' | sort) + +GO = go +TIMEOUT = 60 + +.DEFAULT_GOAL := precommit + +.PHONY: precommit ci +precommit: generate dependabot-generate license-check misspell go-mod-tidy golangci-lint-fix test-default +ci: generate dependabot-check license-check lint vanity-import-check build test-default check-clean-work-tree test-coverage + +# Tools + +TOOLS = $(CURDIR)/.tools + +$(TOOLS): + @mkdir -p $@ +$(TOOLS)/%: | $(TOOLS) + cd $(TOOLS_MOD_DIR) && \ + $(GO) build -o $@ $(PACKAGE) + +MULTIMOD = $(TOOLS)/multimod +$(TOOLS)/multimod: PACKAGE=go.opentelemetry.io/build-tools/multimod + +SEMCONVGEN = $(TOOLS)/semconvgen +$(TOOLS)/semconvgen: PACKAGE=go.opentelemetry.io/build-tools/semconvgen + +CROSSLINK = $(TOOLS)/crosslink +$(TOOLS)/crosslink: PACKAGE=go.opentelemetry.io/build-tools/crosslink + +SEMCONVKIT = $(TOOLS)/semconvkit +$(TOOLS)/semconvkit: PACKAGE=go.opentelemetry.io/otel/$(TOOLS_MOD_DIR)/semconvkit + +DBOTCONF = $(TOOLS)/dbotconf +$(TOOLS)/dbotconf: PACKAGE=go.opentelemetry.io/build-tools/dbotconf + +GOLANGCI_LINT = $(TOOLS)/golangci-lint +$(TOOLS)/golangci-lint: PACKAGE=github.com/golangci/golangci-lint/cmd/golangci-lint + +MISSPELL = $(TOOLS)/misspell +$(TOOLS)/misspell: PACKAGE=github.com/client9/misspell/cmd/misspell + +GOCOVMERGE = $(TOOLS)/gocovmerge +$(TOOLS)/gocovmerge: PACKAGE=github.com/wadey/gocovmerge + +STRINGER = $(TOOLS)/stringer +$(TOOLS)/stringer: PACKAGE=golang.org/x/tools/cmd/stringer + +PORTO = $(TOOLS)/porto +$(TOOLS)/porto: PACKAGE=github.com/jcchavezs/porto/cmd/porto + +GOJQ = $(TOOLS)/gojq +$(TOOLS)/gojq: PACKAGE=github.com/itchyny/gojq/cmd/gojq + +GOTMPL = $(TOOLS)/gotmpl +$(GOTMPL): PACKAGE=go.opentelemetry.io/build-tools/gotmpl + +GORELEASE = $(TOOLS)/gorelease +$(GORELEASE): PACKAGE=golang.org/x/exp/cmd/gorelease + +GOVULNCHECK = $(TOOLS)/govulncheck +$(TOOLS)/govulncheck: PACKAGE=golang.org/x/vuln/cmd/govulncheck + +.PHONY: tools +tools: $(CROSSLINK) $(DBOTCONF) $(GOLANGCI_LINT) $(MISSPELL) $(GOCOVMERGE) $(STRINGER) $(PORTO) $(GOJQ) $(SEMCONVGEN) $(MULTIMOD) $(SEMCONVKIT) $(GOTMPL) $(GORELEASE) + +# Virtualized python tools via docker + +# The directory where the virtual environment is created. +VENVDIR := venv + +# The directory where the python tools are installed. +PYTOOLS := $(VENVDIR)/bin + +# The pip executable in the virtual environment. +PIP := $(PYTOOLS)/pip + +# The directory in the docker image where the current directory is mounted. +WORKDIR := /workdir + +# The python image to use for the virtual environment. +PYTHONIMAGE := python:3.11.3-slim-bullseye + +# Run the python image with the current directory mounted. +DOCKERPY := docker run --rm -v "$(CURDIR):$(WORKDIR)" -w $(WORKDIR) $(PYTHONIMAGE) + +# Create a virtual environment for Python tools. +$(PYTOOLS): +# The `--upgrade` flag is needed to ensure that the virtual environment is +# created with the latest pip version. + @$(DOCKERPY) bash -c "python3 -m venv $(VENVDIR) && $(PIP) install --upgrade pip" + +# Install python packages into the virtual environment. +$(PYTOOLS)/%: | $(PYTOOLS) + @$(DOCKERPY) $(PIP) install -r requirements.txt + +CODESPELL = $(PYTOOLS)/codespell +$(CODESPELL): PACKAGE=codespell + +# Generate + +.PHONY: generate +generate: go-generate vanity-import-fix + +.PHONY: go-generate +go-generate: $(OTEL_GO_MOD_DIRS:%=go-generate/%) +go-generate/%: DIR=$* +go-generate/%: | $(STRINGER) $(GOTMPL) + @echo "$(GO) generate $(DIR)/..." \ + && cd $(DIR) \ + && PATH="$(TOOLS):$${PATH}" $(GO) generate ./... + +.PHONY: vanity-import-fix +vanity-import-fix: | $(PORTO) + @$(PORTO) --include-internal -w . + +# Generate go.work file for local development. +.PHONY: go-work +go-work: | $(CROSSLINK) + $(CROSSLINK) work --root=$(shell pwd) + +# Build + +.PHONY: build + +build: $(OTEL_GO_MOD_DIRS:%=build/%) $(OTEL_GO_MOD_DIRS:%=build-tests/%) +build/%: DIR=$* +build/%: + @echo "$(GO) build $(DIR)/..." \ + && cd $(DIR) \ + && $(GO) build ./... + +build-tests/%: DIR=$* +build-tests/%: + @echo "$(GO) build tests $(DIR)/..." \ + && cd $(DIR) \ + && $(GO) list ./... \ + | grep -v third_party \ + | xargs $(GO) test -vet=off -run xxxxxMatchNothingxxxxx >/dev/null + +# Tests + +TEST_TARGETS := test-default test-bench test-short test-verbose test-race +.PHONY: $(TEST_TARGETS) test +test-default test-race: ARGS=-race +test-bench: ARGS=-run=xxxxxMatchNothingxxxxx -test.benchtime=1ms -bench=. +test-short: ARGS=-short +test-verbose: ARGS=-v -race +$(TEST_TARGETS): test +test: $(OTEL_GO_MOD_DIRS:%=test/%) +test/%: DIR=$* +test/%: + @echo "$(GO) test -timeout $(TIMEOUT)s $(ARGS) $(DIR)/..." \ + && cd $(DIR) \ + && $(GO) list ./... \ + | grep -v third_party \ + | xargs $(GO) test -timeout $(TIMEOUT)s $(ARGS) + +COVERAGE_MODE = atomic +COVERAGE_PROFILE = coverage.out +.PHONY: test-coverage +test-coverage: | $(GOCOVMERGE) + @set -e; \ + printf "" > coverage.txt; \ + for dir in $(ALL_COVERAGE_MOD_DIRS); do \ + echo "$(GO) test -coverpkg=go.opentelemetry.io/otel/... -covermode=$(COVERAGE_MODE) -coverprofile="$(COVERAGE_PROFILE)" $${dir}/..."; \ + (cd "$${dir}" && \ + $(GO) list ./... \ + | grep -v third_party \ + | grep -v 'semconv/v.*' \ + | xargs $(GO) test -coverpkg=./... -covermode=$(COVERAGE_MODE) -coverprofile="$(COVERAGE_PROFILE)" && \ + $(GO) tool cover -html=coverage.out -o coverage.html); \ + done; \ + $(GOCOVMERGE) $$(find . -name coverage.out) > coverage.txt + +# Adding a directory will include all benchmarks in that direcotry if a filter is not specified. +BENCHMARK_TARGETS := sdk/trace +.PHONY: benchmark +benchmark: $(BENCHMARK_TARGETS:%=benchmark/%) +BENCHMARK_FILTER = . +# You can override the filter for a particular directory by adding a rule here. +benchmark/sdk/trace: BENCHMARK_FILTER = SpanWithAttributes_8/AlwaysSample +benchmark/%: + @echo "$(GO) test -timeout $(TIMEOUT)s -run=xxxxxMatchNothingxxxxx -bench=$(BENCHMARK_FILTER) $*..." \ + && cd $* \ + $(foreach filter, $(BENCHMARK_FILTER), && $(GO) test -timeout $(TIMEOUT)s -run=xxxxxMatchNothingxxxxx -bench=$(filter)) + +.PHONY: golangci-lint golangci-lint-fix +golangci-lint-fix: ARGS=--fix +golangci-lint-fix: golangci-lint +golangci-lint: $(OTEL_GO_MOD_DIRS:%=golangci-lint/%) +golangci-lint/%: DIR=$* +golangci-lint/%: | $(GOLANGCI_LINT) + @echo 'golangci-lint $(if $(ARGS),$(ARGS) ,)$(DIR)' \ + && cd $(DIR) \ + && $(GOLANGCI_LINT) run --allow-serial-runners $(ARGS) + +.PHONY: crosslink +crosslink: | $(CROSSLINK) + @echo "Updating intra-repository dependencies in all go modules" \ + && $(CROSSLINK) --root=$(shell pwd) --prune + +.PHONY: go-mod-tidy +go-mod-tidy: $(ALL_GO_MOD_DIRS:%=go-mod-tidy/%) +go-mod-tidy/%: DIR=$* +go-mod-tidy/%: | crosslink + @echo "$(GO) mod tidy in $(DIR)" \ + && cd $(DIR) \ + && $(GO) mod tidy -compat=1.20 + +.PHONY: lint-modules +lint-modules: go-mod-tidy + +.PHONY: lint +lint: misspell lint-modules golangci-lint govulncheck + +.PHONY: vanity-import-check +vanity-import-check: | $(PORTO) + @$(PORTO) --include-internal -l . || ( echo "(run: make vanity-import-fix)"; exit 1 ) + +.PHONY: misspell +misspell: | $(MISSPELL) + @$(MISSPELL) -w $(ALL_DOCS) + +.PHONY: govulncheck +govulncheck: $(OTEL_GO_MOD_DIRS:%=govulncheck/%) +govulncheck/%: DIR=$* +govulncheck/%: | $(GOVULNCHECK) + @echo "govulncheck ./... in $(DIR)" \ + && cd $(DIR) \ + && $(GOVULNCHECK) ./... + +.PHONY: codespell +codespell: | $(CODESPELL) + @$(DOCKERPY) $(CODESPELL) + +.PHONY: license-check +license-check: + @licRes=$$(for f in $$(find . -type f \( -iname '*.go' -o -iname '*.sh' \) ! -path '**/third_party/*' ! -path './.git/*' ) ; do \ + awk '/Copyright The OpenTelemetry Authors|generated|GENERATED/ && NR<=4 { found=1; next } END { if (!found) print FILENAME }' $$f; \ + done); \ + if [ -n "$${licRes}" ]; then \ + echo "license header checking failed:"; echo "$${licRes}"; \ + exit 1; \ + fi + +DEPENDABOT_CONFIG = .github/dependabot.yml +.PHONY: dependabot-check +dependabot-check: | $(DBOTCONF) + @$(DBOTCONF) verify $(DEPENDABOT_CONFIG) || ( echo "(run: make dependabot-generate)"; exit 1 ) + +.PHONY: dependabot-generate +dependabot-generate: | $(DBOTCONF) + @$(DBOTCONF) generate > $(DEPENDABOT_CONFIG) + +.PHONY: check-clean-work-tree +check-clean-work-tree: + @if ! git diff --quiet; then \ + echo; \ + echo 'Working tree is not clean, did you forget to run "make precommit"?'; \ + echo; \ + git status; \ + exit 1; \ + fi + +SEMCONVPKG ?= "semconv/" +.PHONY: semconv-generate +semconv-generate: | $(SEMCONVGEN) $(SEMCONVKIT) + [ "$(TAG)" ] || ( echo "TAG unset: missing opentelemetry semantic-conventions tag"; exit 1 ) + [ "$(OTEL_SEMCONV_REPO)" ] || ( echo "OTEL_SEMCONV_REPO unset: missing path to opentelemetry semantic-conventions repo"; exit 1 ) + $(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=span -p conventionType=trace -f trace.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)" + $(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=attribute_group -p conventionType=trace -f attribute_group.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)" + $(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=event -p conventionType=event -f event.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)" + $(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=resource -p conventionType=resource -f resource.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)" + $(SEMCONVKIT) -output "$(SEMCONVPKG)/$(TAG)" -tag "$(TAG)" + +.PHONY: gorelease +gorelease: $(OTEL_GO_MOD_DIRS:%=gorelease/%) +gorelease/%: DIR=$* +gorelease/%:| $(GORELEASE) + @echo "gorelease in $(DIR):" \ + && cd $(DIR) \ + && $(GORELEASE) \ + || echo "" + +.PHONY: prerelease +prerelease: | $(MULTIMOD) + @[ "${MODSET}" ] || ( echo ">> env var MODSET is not set"; exit 1 ) + $(MULTIMOD) verify && $(MULTIMOD) prerelease -m ${MODSET} + +COMMIT ?= "HEAD" +.PHONY: add-tags +add-tags: | $(MULTIMOD) + @[ "${MODSET}" ] || ( echo ">> env var MODSET is not set"; exit 1 ) + $(MULTIMOD) verify && $(MULTIMOD) tag -m ${MODSET} -c ${COMMIT} + +.PHONY: lint-markdown +lint-markdown: + docker run -v "$(CURDIR):$(WORKDIR)" docker://avtodev/markdown-lint:v1 -c $(WORKDIR)/.markdownlint.yaml $(WORKDIR)/**/*.md diff --git a/vendor/go.opentelemetry.io/otel/README.md b/vendor/go.opentelemetry.io/otel/README.md new file mode 100644 index 000000000..2c5b0cc28 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/README.md @@ -0,0 +1,108 @@ +# OpenTelemetry-Go + +[![CI](https://github.com/open-telemetry/opentelemetry-go/workflows/ci/badge.svg)](https://github.com/open-telemetry/opentelemetry-go/actions?query=workflow%3Aci+branch%3Amain) +[![codecov.io](https://codecov.io/gh/open-telemetry/opentelemetry-go/coverage.svg?branch=main)](https://app.codecov.io/gh/open-telemetry/opentelemetry-go?branch=main) +[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel)](https://pkg.go.dev/go.opentelemetry.io/otel) +[![Go Report Card](https://goreportcard.com/badge/go.opentelemetry.io/otel)](https://goreportcard.com/report/go.opentelemetry.io/otel) +[![Slack](https://img.shields.io/badge/slack-@cncf/otel--go-brightgreen.svg?logo=slack)](https://cloud-native.slack.com/archives/C01NPAXACKT) + +OpenTelemetry-Go is the [Go](https://golang.org/) implementation of [OpenTelemetry](https://opentelemetry.io/). +It provides a set of APIs to directly measure performance and behavior of your software and send this data to observability platforms. + +## Project Status + +| Signal | Status | +|---------|------------| +| Traces | Stable | +| Metrics | Stable | +| Logs | Design [1] | + +- [1]: Currently the logs signal development is in a design phase ([#4696](https://github.com/open-telemetry/opentelemetry-go/issues/4696)). + No Logs Pull Requests are currently being accepted. + +Progress and status specific to this repository is tracked in our +[project boards](https://github.com/open-telemetry/opentelemetry-go/projects) +and +[milestones](https://github.com/open-telemetry/opentelemetry-go/milestones). + +Project versioning information and stability guarantees can be found in the +[versioning documentation](VERSIONING.md). + +### Compatibility + +OpenTelemetry-Go ensures compatibility with the current supported versions of +the [Go language](https://golang.org/doc/devel/release#policy): + +> Each major Go release is supported until there are two newer major releases. +> For example, Go 1.5 was supported until the Go 1.7 release, and Go 1.6 was supported until the Go 1.8 release. + +For versions of Go that are no longer supported upstream, opentelemetry-go will +stop ensuring compatibility with these versions in the following manner: + +- A minor release of opentelemetry-go will be made to add support for the new + supported release of Go. +- The following minor release of opentelemetry-go will remove compatibility + testing for the oldest (now archived upstream) version of Go. This, and + future, releases of opentelemetry-go may include features only supported by + the currently supported versions of Go. + +Currently, this project supports the following environments. + +| OS | Go Version | Architecture | +|---------|------------|--------------| +| Ubuntu | 1.21 | amd64 | +| Ubuntu | 1.20 | amd64 | +| Ubuntu | 1.21 | 386 | +| Ubuntu | 1.20 | 386 | +| MacOS | 1.21 | amd64 | +| MacOS | 1.20 | amd64 | +| Windows | 1.21 | amd64 | +| Windows | 1.20 | amd64 | +| Windows | 1.21 | 386 | +| Windows | 1.20 | 386 | + +While this project should work for other systems, no compatibility guarantees +are made for those systems currently. + +## Getting Started + +You can find a getting started guide on [opentelemetry.io](https://opentelemetry.io/docs/go/getting-started/). + +OpenTelemetry's goal is to provide a single set of APIs to capture distributed +traces and metrics from your application and send them to an observability +platform. This project allows you to do just that for applications written in +Go. There are two steps to this process: instrument your application, and +configure an exporter. + +### Instrumentation + +To start capturing distributed traces and metric events from your application +it first needs to be instrumented. The easiest way to do this is by using an +instrumentation library for your code. Be sure to check out [the officially +supported instrumentation +libraries](https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/instrumentation). + +If you need to extend the telemetry an instrumentation library provides or want +to build your own instrumentation for your application directly you will need +to use the +[Go otel](https://pkg.go.dev/go.opentelemetry.io/otel) +package. The included [examples](./example/) are a good way to see some +practical uses of this process. + +### Export + +Now that your application is instrumented to collect telemetry, it needs an +export pipeline to send that telemetry to an observability platform. + +All officially supported exporters for the OpenTelemetry project are contained in the [exporters directory](./exporters). + +| Exporter | Metrics | Traces | +|---------------------------------------|:-------:|:------:| +| [OTLP](./exporters/otlp/) | ✓ | ✓ | +| [Prometheus](./exporters/prometheus/) | ✓ | | +| [stdout](./exporters/stdout/) | ✓ | ✓ | +| [Zipkin](./exporters/zipkin/) | | ✓ | + +## Contributing + +See the [contributing documentation](CONTRIBUTING.md). diff --git a/vendor/go.opentelemetry.io/otel/RELEASING.md b/vendor/go.opentelemetry.io/otel/RELEASING.md new file mode 100644 index 000000000..82ce3ee46 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/RELEASING.md @@ -0,0 +1,139 @@ +# Release Process + +## Semantic Convention Generation + +New versions of the [OpenTelemetry Semantic Conventions] mean new versions of the `semconv` package need to be generated. +The `semconv-generate` make target is used for this. + +1. Checkout a local copy of the [OpenTelemetry Semantic Conventions] to the desired release tag. +2. Pull the latest `otel/semconvgen` image: `docker pull otel/semconvgen:latest` +3. Run the `make semconv-generate ...` target from this repository. + +For example, + +```sh +export TAG="v1.21.0" # Change to the release version you are generating. +export OTEL_SEMCONV_REPO="/absolute/path/to/opentelemetry/semantic-conventions" +docker pull otel/semconvgen:latest +make semconv-generate # Uses the exported TAG and OTEL_SEMCONV_REPO. +``` + +This should create a new sub-package of [`semconv`](./semconv). +Ensure things look correct before submitting a pull request to include the addition. + +## Breaking changes validation + +You can run `make gorelease` that runs [gorelease](https://pkg.go.dev/golang.org/x/exp/cmd/gorelease) to ensure that there are no unwanted changes done in the public API. + +You can check/report problems with `gorelease` [here](https://golang.org/issues/26420). + +## Pre-Release + +First, decide which module sets will be released and update their versions +in `versions.yaml`. Commit this change to a new branch. + +Update go.mod for submodules to depend on the new release which will happen in the next step. + +1. Run the `prerelease` make target. It creates a branch + `prerelease__` that will contain all release changes. + + ``` + make prerelease MODSET= + ``` + +2. Verify the changes. + + ``` + git diff ...prerelease__ + ``` + + This should have changed the version for all modules to be ``. + If these changes look correct, merge them into your pre-release branch: + + ```go + git merge prerelease__ + ``` + +3. Update the [Changelog](./CHANGELOG.md). + - Make sure all relevant changes for this release are included and are in language that non-contributors to the project can understand. + To verify this, you can look directly at the commits since the ``. + + ``` + git --no-pager log --pretty=oneline "..HEAD" + ``` + + - Move all the `Unreleased` changes into a new section following the title scheme (`[] - `). + - Update all the appropriate links at the bottom. + +4. Push the changes to upstream and create a Pull Request on GitHub. + Be sure to include the curated changes from the [Changelog](./CHANGELOG.md) in the description. + +## Tag + +Once the Pull Request with all the version changes has been approved and merged it is time to tag the merged commit. + +***IMPORTANT***: It is critical you use the same tag that you used in the Pre-Release step! +Failure to do so will leave things in a broken state. As long as you do not +change `versions.yaml` between pre-release and this step, things should be fine. + +***IMPORTANT***: [There is currently no way to remove an incorrectly tagged version of a Go module](https://github.com/golang/go/issues/34189). +It is critical you make sure the version you push upstream is correct. +[Failure to do so will lead to minor emergencies and tough to work around](https://github.com/open-telemetry/opentelemetry-go/issues/331). + +1. For each module set that will be released, run the `add-tags` make target + using the `` of the commit on the main branch for the merged Pull Request. + + ``` + make add-tags MODSET= COMMIT= + ``` + + It should only be necessary to provide an explicit `COMMIT` value if the + current `HEAD` of your working directory is not the correct commit. + +2. Push tags to the upstream remote (not your fork: `github.com/open-telemetry/opentelemetry-go.git`). + Make sure you push all sub-modules as well. + + ``` + git push upstream + git push upstream + ... + ``` + +## Release + +Finally create a Release for the new `` on GitHub. +The release body should include all the release notes from the Changelog for this release. + +## Verify Examples + +After releasing verify that examples build outside of the repository. + +``` +./verify_examples.sh +``` + +The script copies examples into a different directory removes any `replace` declarations in `go.mod` and builds them. +This ensures they build with the published release, not the local copy. + +## Post-Release + +### Contrib Repository + +Once verified be sure to [make a release for the `contrib` repository](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/RELEASING.md) that uses this release. + +### Website Documentation + +Update the [Go instrumentation documentation] in the OpenTelemetry website under [content/en/docs/instrumentation/go]. +Importantly, bump any package versions referenced to be the latest one you just released and ensure all code examples still compile and are accurate. + +[OpenTelemetry Semantic Conventions]: https://github.com/open-telemetry/semantic-conventions +[Go instrumentation documentation]: https://opentelemetry.io/docs/instrumentation/go/ +[content/en/docs/instrumentation/go]: https://github.com/open-telemetry/opentelemetry.io/tree/main/content/en/docs/instrumentation/go + +### Demo Repository + +Bump the dependencies in the following Go services: + +- [`accountingservice`](https://github.com/open-telemetry/opentelemetry-demo/tree/main/src/accountingservice) +- [`checkoutservice`](https://github.com/open-telemetry/opentelemetry-demo/tree/main/src/checkoutservice) +- [`productcatalogservice`](https://github.com/open-telemetry/opentelemetry-demo/tree/main/src/productcatalogservice) diff --git a/vendor/go.opentelemetry.io/otel/VERSIONING.md b/vendor/go.opentelemetry.io/otel/VERSIONING.md new file mode 100644 index 000000000..412f1e362 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/VERSIONING.md @@ -0,0 +1,224 @@ +# Versioning + +This document describes the versioning policy for this repository. This policy +is designed so the following goals can be achieved. + +**Users are provided a codebase of value that is stable and secure.** + +## Policy + +* Versioning of this project will be idiomatic of a Go project using [Go + modules](https://github.com/golang/go/wiki/Modules). + * [Semantic import + versioning](https://github.com/golang/go/wiki/Modules#semantic-import-versioning) + will be used. + * Versions will comply with [semver + 2.0](https://semver.org/spec/v2.0.0.html) with the following exceptions. + * New methods may be added to exported API interfaces. All exported + interfaces that fall within this exception will include the following + paragraph in their public documentation. + + > Warning: methods may be added to this interface in minor releases. + + * If a module is version `v2` or higher, the major version of the module + must be included as a `/vN` at the end of the module paths used in + `go.mod` files (e.g., `module go.opentelemetry.io/otel/v2`, `require + go.opentelemetry.io/otel/v2 v2.0.1`) and in the package import path + (e.g., `import "go.opentelemetry.io/otel/v2/trace"`). This includes the + paths used in `go get` commands (e.g., `go get + go.opentelemetry.io/otel/v2@v2.0.1`. Note there is both a `/v2` and a + `@v2.0.1` in that example. One way to think about it is that the module + name now includes the `/v2`, so include `/v2` whenever you are using the + module name). + * If a module is version `v0` or `v1`, do not include the major version in + either the module path or the import path. + * Modules will be used to encapsulate signals and components. + * Experimental modules still under active development will be versioned at + `v0` to imply the stability guarantee defined by + [semver](https://semver.org/spec/v2.0.0.html#spec-item-4). + + > Major version zero (0.y.z) is for initial development. Anything MAY + > change at any time. The public API SHOULD NOT be considered stable. + + * Mature modules for which we guarantee a stable public API will be versioned + with a major version greater than `v0`. + * The decision to make a module stable will be made on a case-by-case + basis by the maintainers of this project. + * Experimental modules will start their versioning at `v0.0.0` and will + increment their minor version when backwards incompatible changes are + released and increment their patch version when backwards compatible + changes are released. + * All stable modules that use the same major version number will use the + same entire version number. + * Stable modules may be released with an incremented minor or patch + version even though that module has not been changed, but rather so + that it will remain at the same version as other stable modules that + did undergo change. + * When an experimental module becomes stable a new stable module version + will be released and will include this now stable module. The new + stable module version will be an increment of the minor version number + and will be applied to all existing stable modules as well as the newly + stable module being released. +* Versioning of the associated [contrib + repository](https://github.com/open-telemetry/opentelemetry-go-contrib) of + this project will be idiomatic of a Go project using [Go + modules](https://github.com/golang/go/wiki/Modules). + * [Semantic import + versioning](https://github.com/golang/go/wiki/Modules#semantic-import-versioning) + will be used. + * Versions will comply with [semver 2.0](https://semver.org/spec/v2.0.0.html). + * If a module is version `v2` or higher, the + major version of the module must be included as a `/vN` at the end of the + module paths used in `go.mod` files (e.g., `module + go.opentelemetry.io/contrib/instrumentation/host/v2`, `require + go.opentelemetry.io/contrib/instrumentation/host/v2 v2.0.1`) and in the + package import path (e.g., `import + "go.opentelemetry.io/contrib/instrumentation/host/v2"`). This includes + the paths used in `go get` commands (e.g., `go get + go.opentelemetry.io/contrib/instrumentation/host/v2@v2.0.1`. Note there + is both a `/v2` and a `@v2.0.1` in that example. One way to think about + it is that the module name now includes the `/v2`, so include `/v2` + whenever you are using the module name). + * If a module is version `v0` or `v1`, do not include the major version + in either the module path or the import path. + * In addition to public APIs, telemetry produced by stable instrumentation + will remain stable and backwards compatible. This is to avoid breaking + alerts and dashboard. + * Modules will be used to encapsulate instrumentation, detectors, exporters, + propagators, and any other independent sets of related components. + * Experimental modules still under active development will be versioned at + `v0` to imply the stability guarantee defined by + [semver](https://semver.org/spec/v2.0.0.html#spec-item-4). + + > Major version zero (0.y.z) is for initial development. Anything MAY + > change at any time. The public API SHOULD NOT be considered stable. + + * Mature modules for which we guarantee a stable public API and telemetry will + be versioned with a major version greater than `v0`. + * Experimental modules will start their versioning at `v0.0.0` and will + increment their minor version when backwards incompatible changes are + released and increment their patch version when backwards compatible + changes are released. + * Stable contrib modules cannot depend on experimental modules from this + project. + * All stable contrib modules of the same major version with this project + will use the same entire version as this project. + * Stable modules may be released with an incremented minor or patch + version even though that module's code has not been changed. Instead + the only change that will have been included is to have updated that + modules dependency on this project's stable APIs. + * When an experimental module in contrib becomes stable a new stable + module version will be released and will include this now stable + module. The new stable module version will be an increment of the minor + version number and will be applied to all existing stable contrib + modules, this project's modules, and the newly stable module being + released. + * Contrib modules will be kept up to date with this project's releases. + * Due to the dependency contrib modules will implicitly have on this + project's modules the release of stable contrib modules to match the + released version number will be staggered after this project's release. + There is no explicit time guarantee for how long after this projects + release the contrib release will be. Effort should be made to keep them + as close in time as possible. + * No additional stable release in this project can be made until the + contrib repository has a matching stable release. + * No release can be made in the contrib repository after this project's + stable release except for a stable release of the contrib repository. +* GitHub releases will be made for all releases. +* Go modules will be made available at Go package mirrors. + +## Example Versioning Lifecycle + +To better understand the implementation of the above policy the following +example is provided. This project is simplified to include only the following +modules and their versions: + +* `otel`: `v0.14.0` +* `otel/trace`: `v0.14.0` +* `otel/metric`: `v0.14.0` +* `otel/baggage`: `v0.14.0` +* `otel/sdk/trace`: `v0.14.0` +* `otel/sdk/metric`: `v0.14.0` + +These modules have been developed to a point where the `otel/trace`, +`otel/baggage`, and `otel/sdk/trace` modules have reached a point that they +should be considered for a stable release. The `otel/metric` and +`otel/sdk/metric` are still under active development and the `otel` module +depends on both `otel/trace` and `otel/metric`. + +The `otel` package is refactored to remove its dependencies on `otel/metric` so +it can be released as stable as well. With that done the following release +candidates are made: + +* `otel`: `v1.0.0-RC1` +* `otel/trace`: `v1.0.0-RC1` +* `otel/baggage`: `v1.0.0-RC1` +* `otel/sdk/trace`: `v1.0.0-RC1` + +The `otel/metric` and `otel/sdk/metric` modules remain at `v0.14.0`. + +A few minor issues are discovered in the `otel/trace` package. These issues are +resolved with some minor, but backwards incompatible, changes and are released +as a second release candidate: + +* `otel`: `v1.0.0-RC2` +* `otel/trace`: `v1.0.0-RC2` +* `otel/baggage`: `v1.0.0-RC2` +* `otel/sdk/trace`: `v1.0.0-RC2` + +Notice that all module version numbers are incremented to adhere to our +versioning policy. + +After these release candidates have been evaluated to satisfaction, they are +released as version `v1.0.0`. + +* `otel`: `v1.0.0` +* `otel/trace`: `v1.0.0` +* `otel/baggage`: `v1.0.0` +* `otel/sdk/trace`: `v1.0.0` + +Since both the `go` utility and the Go module system support [the semantic +versioning definition of +precedence](https://semver.org/spec/v2.0.0.html#spec-item-11), this release +will correctly be interpreted as the successor to the previous release +candidates. + +Active development of this project continues. The `otel/metric` module now has +backwards incompatible changes to its API that need to be released and the +`otel/baggage` module has a minor bug fix that needs to be released. The +following release is made: + +* `otel`: `v1.0.1` +* `otel/trace`: `v1.0.1` +* `otel/metric`: `v0.15.0` +* `otel/baggage`: `v1.0.1` +* `otel/sdk/trace`: `v1.0.1` +* `otel/sdk/metric`: `v0.15.0` + +Notice that, again, all stable module versions are incremented in unison and +the `otel/sdk/metric` package, which depends on the `otel/metric` package, also +bumped its version. This bump of the `otel/sdk/metric` package makes sense +given their coupling, though it is not explicitly required by our versioning +policy. + +As we progress, the `otel/metric` and `otel/sdk/metric` packages have reached a +point where they should be evaluated for stability. The `otel` module is +reintegrated with the `otel/metric` package and the following release is made: + +* `otel`: `v1.1.0-RC1` +* `otel/trace`: `v1.1.0-RC1` +* `otel/metric`: `v1.1.0-RC1` +* `otel/baggage`: `v1.1.0-RC1` +* `otel/sdk/trace`: `v1.1.0-RC1` +* `otel/sdk/metric`: `v1.1.0-RC1` + +All the modules are evaluated and determined to a viable stable release. They +are then released as version `v1.1.0` (the minor version is incremented to +indicate the addition of new signal). + +* `otel`: `v1.1.0` +* `otel/trace`: `v1.1.0` +* `otel/metric`: `v1.1.0` +* `otel/baggage`: `v1.1.0` +* `otel/sdk/trace`: `v1.1.0` +* `otel/sdk/metric`: `v1.1.0` diff --git a/vendor/go.opentelemetry.io/otel/attribute/doc.go b/vendor/go.opentelemetry.io/otel/attribute/doc.go new file mode 100644 index 000000000..dafe7424d --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/attribute/doc.go @@ -0,0 +1,16 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package attribute provides key and value attributes. +package attribute // import "go.opentelemetry.io/otel/attribute" diff --git a/vendor/go.opentelemetry.io/otel/attribute/encoder.go b/vendor/go.opentelemetry.io/otel/attribute/encoder.go new file mode 100644 index 000000000..fe2bc5766 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/attribute/encoder.go @@ -0,0 +1,146 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package attribute // import "go.opentelemetry.io/otel/attribute" + +import ( + "bytes" + "sync" + "sync/atomic" +) + +type ( + // Encoder is a mechanism for serializing an attribute set into a specific + // string representation that supports caching, to avoid repeated + // serialization. An example could be an exporter encoding the attribute + // set into a wire representation. + Encoder interface { + // Encode returns the serialized encoding of the attribute set using + // its Iterator. This result may be cached by a attribute.Set. + Encode(iterator Iterator) string + + // ID returns a value that is unique for each class of attribute + // encoder. Attribute encoders allocate these using `NewEncoderID`. + ID() EncoderID + } + + // EncoderID is used to identify distinct Encoder + // implementations, for caching encoded results. + EncoderID struct { + value uint64 + } + + // defaultAttrEncoder uses a sync.Pool of buffers to reduce the number of + // allocations used in encoding attributes. This implementation encodes a + // comma-separated list of key=value, with '/'-escaping of '=', ',', and + // '\'. + defaultAttrEncoder struct { + // pool is a pool of attribute set builders. The buffers in this pool + // grow to a size that most attribute encodings will not allocate new + // memory. + pool sync.Pool // *bytes.Buffer + } +) + +// escapeChar is used to ensure uniqueness of the attribute encoding where +// keys or values contain either '=' or ','. Since there is no parser needed +// for this encoding and its only requirement is to be unique, this choice is +// arbitrary. Users will see these in some exporters (e.g., stdout), so the +// backslash ('\') is used as a conventional choice. +const escapeChar = '\\' + +var ( + _ Encoder = &defaultAttrEncoder{} + + // encoderIDCounter is for generating IDs for other attribute encoders. + encoderIDCounter uint64 + + defaultEncoderOnce sync.Once + defaultEncoderID = NewEncoderID() + defaultEncoderInstance *defaultAttrEncoder +) + +// NewEncoderID returns a unique attribute encoder ID. It should be called +// once per each type of attribute encoder. Preferably in init() or in var +// definition. +func NewEncoderID() EncoderID { + return EncoderID{value: atomic.AddUint64(&encoderIDCounter, 1)} +} + +// DefaultEncoder returns an attribute encoder that encodes attributes in such +// a way that each escaped attribute's key is followed by an equal sign and +// then by an escaped attribute's value. All key-value pairs are separated by +// a comma. +// +// Escaping is done by prepending a backslash before either a backslash, equal +// sign or a comma. +func DefaultEncoder() Encoder { + defaultEncoderOnce.Do(func() { + defaultEncoderInstance = &defaultAttrEncoder{ + pool: sync.Pool{ + New: func() interface{} { + return &bytes.Buffer{} + }, + }, + } + }) + return defaultEncoderInstance +} + +// Encode is a part of an implementation of the AttributeEncoder interface. +func (d *defaultAttrEncoder) Encode(iter Iterator) string { + buf := d.pool.Get().(*bytes.Buffer) + defer d.pool.Put(buf) + buf.Reset() + + for iter.Next() { + i, keyValue := iter.IndexedAttribute() + if i > 0 { + _, _ = buf.WriteRune(',') + } + copyAndEscape(buf, string(keyValue.Key)) + + _, _ = buf.WriteRune('=') + + if keyValue.Value.Type() == STRING { + copyAndEscape(buf, keyValue.Value.AsString()) + } else { + _, _ = buf.WriteString(keyValue.Value.Emit()) + } + } + return buf.String() +} + +// ID is a part of an implementation of the AttributeEncoder interface. +func (*defaultAttrEncoder) ID() EncoderID { + return defaultEncoderID +} + +// copyAndEscape escapes `=`, `,` and its own escape character (`\`), +// making the default encoding unique. +func copyAndEscape(buf *bytes.Buffer, val string) { + for _, ch := range val { + switch ch { + case '=', ',', escapeChar: + _, _ = buf.WriteRune(escapeChar) + } + _, _ = buf.WriteRune(ch) + } +} + +// Valid returns true if this encoder ID was allocated by +// `NewEncoderID`. Invalid encoder IDs will not be cached. +func (id EncoderID) Valid() bool { + return id.value != 0 +} diff --git a/vendor/go.opentelemetry.io/otel/attribute/filter.go b/vendor/go.opentelemetry.io/otel/attribute/filter.go new file mode 100644 index 000000000..638c213d5 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/attribute/filter.go @@ -0,0 +1,60 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package attribute // import "go.opentelemetry.io/otel/attribute" + +// Filter supports removing certain attributes from attribute sets. When +// the filter returns true, the attribute will be kept in the filtered +// attribute set. When the filter returns false, the attribute is excluded +// from the filtered attribute set, and the attribute instead appears in +// the removed list of excluded attributes. +type Filter func(KeyValue) bool + +// NewAllowKeysFilter returns a Filter that only allows attributes with one of +// the provided keys. +// +// If keys is empty a deny-all filter is returned. +func NewAllowKeysFilter(keys ...Key) Filter { + if len(keys) <= 0 { + return func(kv KeyValue) bool { return false } + } + + allowed := make(map[Key]struct{}) + for _, k := range keys { + allowed[k] = struct{}{} + } + return func(kv KeyValue) bool { + _, ok := allowed[kv.Key] + return ok + } +} + +// NewDenyKeysFilter returns a Filter that only allows attributes +// that do not have one of the provided keys. +// +// If keys is empty an allow-all filter is returned. +func NewDenyKeysFilter(keys ...Key) Filter { + if len(keys) <= 0 { + return func(kv KeyValue) bool { return true } + } + + forbid := make(map[Key]struct{}) + for _, k := range keys { + forbid[k] = struct{}{} + } + return func(kv KeyValue) bool { + _, ok := forbid[kv.Key] + return !ok + } +} diff --git a/vendor/go.opentelemetry.io/otel/attribute/iterator.go b/vendor/go.opentelemetry.io/otel/attribute/iterator.go new file mode 100644 index 000000000..841b271fb --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/attribute/iterator.go @@ -0,0 +1,161 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package attribute // import "go.opentelemetry.io/otel/attribute" + +// Iterator allows iterating over the set of attributes in order, sorted by +// key. +type Iterator struct { + storage *Set + idx int +} + +// MergeIterator supports iterating over two sets of attributes while +// eliminating duplicate values from the combined set. The first iterator +// value takes precedence. +type MergeIterator struct { + one oneIterator + two oneIterator + current KeyValue +} + +type oneIterator struct { + iter Iterator + done bool + attr KeyValue +} + +// Next moves the iterator to the next position. Returns false if there are no +// more attributes. +func (i *Iterator) Next() bool { + i.idx++ + return i.idx < i.Len() +} + +// Label returns current KeyValue. Must be called only after Next returns +// true. +// +// Deprecated: Use Attribute instead. +func (i *Iterator) Label() KeyValue { + return i.Attribute() +} + +// Attribute returns the current KeyValue of the Iterator. It must be called +// only after Next returns true. +func (i *Iterator) Attribute() KeyValue { + kv, _ := i.storage.Get(i.idx) + return kv +} + +// IndexedLabel returns current index and attribute. Must be called only +// after Next returns true. +// +// Deprecated: Use IndexedAttribute instead. +func (i *Iterator) IndexedLabel() (int, KeyValue) { + return i.idx, i.Attribute() +} + +// IndexedAttribute returns current index and attribute. Must be called only +// after Next returns true. +func (i *Iterator) IndexedAttribute() (int, KeyValue) { + return i.idx, i.Attribute() +} + +// Len returns a number of attributes in the iterated set. +func (i *Iterator) Len() int { + return i.storage.Len() +} + +// ToSlice is a convenience function that creates a slice of attributes from +// the passed iterator. The iterator is set up to start from the beginning +// before creating the slice. +func (i *Iterator) ToSlice() []KeyValue { + l := i.Len() + if l == 0 { + return nil + } + i.idx = -1 + slice := make([]KeyValue, 0, l) + for i.Next() { + slice = append(slice, i.Attribute()) + } + return slice +} + +// NewMergeIterator returns a MergeIterator for merging two attribute sets. +// Duplicates are resolved by taking the value from the first set. +func NewMergeIterator(s1, s2 *Set) MergeIterator { + mi := MergeIterator{ + one: makeOne(s1.Iter()), + two: makeOne(s2.Iter()), + } + return mi +} + +func makeOne(iter Iterator) oneIterator { + oi := oneIterator{ + iter: iter, + } + oi.advance() + return oi +} + +func (oi *oneIterator) advance() { + if oi.done = !oi.iter.Next(); !oi.done { + oi.attr = oi.iter.Attribute() + } +} + +// Next returns true if there is another attribute available. +func (m *MergeIterator) Next() bool { + if m.one.done && m.two.done { + return false + } + if m.one.done { + m.current = m.two.attr + m.two.advance() + return true + } + if m.two.done { + m.current = m.one.attr + m.one.advance() + return true + } + if m.one.attr.Key == m.two.attr.Key { + m.current = m.one.attr // first iterator attribute value wins + m.one.advance() + m.two.advance() + return true + } + if m.one.attr.Key < m.two.attr.Key { + m.current = m.one.attr + m.one.advance() + return true + } + m.current = m.two.attr + m.two.advance() + return true +} + +// Label returns the current value after Next() returns true. +// +// Deprecated: Use Attribute instead. +func (m *MergeIterator) Label() KeyValue { + return m.current +} + +// Attribute returns the current value after Next() returns true. +func (m *MergeIterator) Attribute() KeyValue { + return m.current +} diff --git a/vendor/go.opentelemetry.io/otel/attribute/key.go b/vendor/go.opentelemetry.io/otel/attribute/key.go new file mode 100644 index 000000000..0656a04e4 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/attribute/key.go @@ -0,0 +1,134 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package attribute // import "go.opentelemetry.io/otel/attribute" + +// Key represents the key part in key-value pairs. It's a string. The +// allowed character set in the key depends on the use of the key. +type Key string + +// Bool creates a KeyValue instance with a BOOL Value. +// +// If creating both a key and value at the same time, use the provided +// convenience function instead -- Bool(name, value). +func (k Key) Bool(v bool) KeyValue { + return KeyValue{ + Key: k, + Value: BoolValue(v), + } +} + +// BoolSlice creates a KeyValue instance with a BOOLSLICE Value. +// +// If creating both a key and value at the same time, use the provided +// convenience function instead -- BoolSlice(name, value). +func (k Key) BoolSlice(v []bool) KeyValue { + return KeyValue{ + Key: k, + Value: BoolSliceValue(v), + } +} + +// Int creates a KeyValue instance with an INT64 Value. +// +// If creating both a key and value at the same time, use the provided +// convenience function instead -- Int(name, value). +func (k Key) Int(v int) KeyValue { + return KeyValue{ + Key: k, + Value: IntValue(v), + } +} + +// IntSlice creates a KeyValue instance with an INT64SLICE Value. +// +// If creating both a key and value at the same time, use the provided +// convenience function instead -- IntSlice(name, value). +func (k Key) IntSlice(v []int) KeyValue { + return KeyValue{ + Key: k, + Value: IntSliceValue(v), + } +} + +// Int64 creates a KeyValue instance with an INT64 Value. +// +// If creating both a key and value at the same time, use the provided +// convenience function instead -- Int64(name, value). +func (k Key) Int64(v int64) KeyValue { + return KeyValue{ + Key: k, + Value: Int64Value(v), + } +} + +// Int64Slice creates a KeyValue instance with an INT64SLICE Value. +// +// If creating both a key and value at the same time, use the provided +// convenience function instead -- Int64Slice(name, value). +func (k Key) Int64Slice(v []int64) KeyValue { + return KeyValue{ + Key: k, + Value: Int64SliceValue(v), + } +} + +// Float64 creates a KeyValue instance with a FLOAT64 Value. +// +// If creating both a key and value at the same time, use the provided +// convenience function instead -- Float64(name, value). +func (k Key) Float64(v float64) KeyValue { + return KeyValue{ + Key: k, + Value: Float64Value(v), + } +} + +// Float64Slice creates a KeyValue instance with a FLOAT64SLICE Value. +// +// If creating both a key and value at the same time, use the provided +// convenience function instead -- Float64(name, value). +func (k Key) Float64Slice(v []float64) KeyValue { + return KeyValue{ + Key: k, + Value: Float64SliceValue(v), + } +} + +// String creates a KeyValue instance with a STRING Value. +// +// If creating both a key and value at the same time, use the provided +// convenience function instead -- String(name, value). +func (k Key) String(v string) KeyValue { + return KeyValue{ + Key: k, + Value: StringValue(v), + } +} + +// StringSlice creates a KeyValue instance with a STRINGSLICE Value. +// +// If creating both a key and value at the same time, use the provided +// convenience function instead -- StringSlice(name, value). +func (k Key) StringSlice(v []string) KeyValue { + return KeyValue{ + Key: k, + Value: StringSliceValue(v), + } +} + +// Defined returns true for non-empty keys. +func (k Key) Defined() bool { + return len(k) != 0 +} diff --git a/vendor/go.opentelemetry.io/otel/attribute/kv.go b/vendor/go.opentelemetry.io/otel/attribute/kv.go new file mode 100644 index 000000000..1ddf3ce05 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/attribute/kv.go @@ -0,0 +1,86 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package attribute // import "go.opentelemetry.io/otel/attribute" + +import ( + "fmt" +) + +// KeyValue holds a key and value pair. +type KeyValue struct { + Key Key + Value Value +} + +// Valid returns if kv is a valid OpenTelemetry attribute. +func (kv KeyValue) Valid() bool { + return kv.Key.Defined() && kv.Value.Type() != INVALID +} + +// Bool creates a KeyValue with a BOOL Value type. +func Bool(k string, v bool) KeyValue { + return Key(k).Bool(v) +} + +// BoolSlice creates a KeyValue with a BOOLSLICE Value type. +func BoolSlice(k string, v []bool) KeyValue { + return Key(k).BoolSlice(v) +} + +// Int creates a KeyValue with an INT64 Value type. +func Int(k string, v int) KeyValue { + return Key(k).Int(v) +} + +// IntSlice creates a KeyValue with an INT64SLICE Value type. +func IntSlice(k string, v []int) KeyValue { + return Key(k).IntSlice(v) +} + +// Int64 creates a KeyValue with an INT64 Value type. +func Int64(k string, v int64) KeyValue { + return Key(k).Int64(v) +} + +// Int64Slice creates a KeyValue with an INT64SLICE Value type. +func Int64Slice(k string, v []int64) KeyValue { + return Key(k).Int64Slice(v) +} + +// Float64 creates a KeyValue with a FLOAT64 Value type. +func Float64(k string, v float64) KeyValue { + return Key(k).Float64(v) +} + +// Float64Slice creates a KeyValue with a FLOAT64SLICE Value type. +func Float64Slice(k string, v []float64) KeyValue { + return Key(k).Float64Slice(v) +} + +// String creates a KeyValue with a STRING Value type. +func String(k, v string) KeyValue { + return Key(k).String(v) +} + +// StringSlice creates a KeyValue with a STRINGSLICE Value type. +func StringSlice(k string, v []string) KeyValue { + return Key(k).StringSlice(v) +} + +// Stringer creates a new key-value pair with a passed name and a string +// value generated by the passed Stringer interface. +func Stringer(k string, v fmt.Stringer) KeyValue { + return Key(k).String(v.String()) +} diff --git a/vendor/go.opentelemetry.io/otel/attribute/set.go b/vendor/go.opentelemetry.io/otel/attribute/set.go new file mode 100644 index 000000000..9f9303d4f --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/attribute/set.go @@ -0,0 +1,429 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package attribute // import "go.opentelemetry.io/otel/attribute" + +import ( + "encoding/json" + "reflect" + "sort" + "sync" +) + +type ( + // Set is the representation for a distinct attribute set. It manages an + // immutable set of attributes, with an internal cache for storing + // attribute encodings. + // + // This type supports the Equivalent method of comparison using values of + // type Distinct. + Set struct { + equivalent Distinct + } + + // Distinct wraps a variable-size array of KeyValue, constructed with keys + // in sorted order. This can be used as a map key or for equality checking + // between Sets. + Distinct struct { + iface interface{} + } + + // Sortable implements sort.Interface, used for sorting KeyValue. This is + // an exported type to support a memory optimization. A pointer to one of + // these is needed for the call to sort.Stable(), which the caller may + // provide in order to avoid an allocation. See NewSetWithSortable(). + Sortable []KeyValue +) + +var ( + // keyValueType is used in computeDistinctReflect. + keyValueType = reflect.TypeOf(KeyValue{}) + + // emptySet is returned for empty attribute sets. + emptySet = &Set{ + equivalent: Distinct{ + iface: [0]KeyValue{}, + }, + } + + // sortables is a pool of Sortables used to create Sets with a user does + // not provide one. + sortables = sync.Pool{ + New: func() interface{} { return new(Sortable) }, + } +) + +// EmptySet returns a reference to a Set with no elements. +// +// This is a convenience provided for optimized calling utility. +func EmptySet() *Set { + return emptySet +} + +// reflectValue abbreviates reflect.ValueOf(d). +func (d Distinct) reflectValue() reflect.Value { + return reflect.ValueOf(d.iface) +} + +// Valid returns true if this value refers to a valid Set. +func (d Distinct) Valid() bool { + return d.iface != nil +} + +// Len returns the number of attributes in this set. +func (l *Set) Len() int { + if l == nil || !l.equivalent.Valid() { + return 0 + } + return l.equivalent.reflectValue().Len() +} + +// Get returns the KeyValue at ordered position idx in this set. +func (l *Set) Get(idx int) (KeyValue, bool) { + if l == nil || !l.equivalent.Valid() { + return KeyValue{}, false + } + value := l.equivalent.reflectValue() + + if idx >= 0 && idx < value.Len() { + // Note: The Go compiler successfully avoids an allocation for + // the interface{} conversion here: + return value.Index(idx).Interface().(KeyValue), true + } + + return KeyValue{}, false +} + +// Value returns the value of a specified key in this set. +func (l *Set) Value(k Key) (Value, bool) { + if l == nil || !l.equivalent.Valid() { + return Value{}, false + } + rValue := l.equivalent.reflectValue() + vlen := rValue.Len() + + idx := sort.Search(vlen, func(idx int) bool { + return rValue.Index(idx).Interface().(KeyValue).Key >= k + }) + if idx >= vlen { + return Value{}, false + } + keyValue := rValue.Index(idx).Interface().(KeyValue) + if k == keyValue.Key { + return keyValue.Value, true + } + return Value{}, false +} + +// HasValue tests whether a key is defined in this set. +func (l *Set) HasValue(k Key) bool { + if l == nil { + return false + } + _, ok := l.Value(k) + return ok +} + +// Iter returns an iterator for visiting the attributes in this set. +func (l *Set) Iter() Iterator { + return Iterator{ + storage: l, + idx: -1, + } +} + +// ToSlice returns the set of attributes belonging to this set, sorted, where +// keys appear no more than once. +func (l *Set) ToSlice() []KeyValue { + iter := l.Iter() + return iter.ToSlice() +} + +// Equivalent returns a value that may be used as a map key. The Distinct type +// guarantees that the result will equal the equivalent. Distinct value of any +// attribute set with the same elements as this, where sets are made unique by +// choosing the last value in the input for any given key. +func (l *Set) Equivalent() Distinct { + if l == nil || !l.equivalent.Valid() { + return emptySet.equivalent + } + return l.equivalent +} + +// Equals returns true if the argument set is equivalent to this set. +func (l *Set) Equals(o *Set) bool { + return l.Equivalent() == o.Equivalent() +} + +// Encoded returns the encoded form of this set, according to encoder. +func (l *Set) Encoded(encoder Encoder) string { + if l == nil || encoder == nil { + return "" + } + + return encoder.Encode(l.Iter()) +} + +func empty() Set { + return Set{ + equivalent: emptySet.equivalent, + } +} + +// NewSet returns a new Set. See the documentation for +// NewSetWithSortableFiltered for more details. +// +// Except for empty sets, this method adds an additional allocation compared +// with calls that include a Sortable. +func NewSet(kvs ...KeyValue) Set { + // Check for empty set. + if len(kvs) == 0 { + return empty() + } + srt := sortables.Get().(*Sortable) + s, _ := NewSetWithSortableFiltered(kvs, srt, nil) + sortables.Put(srt) + return s +} + +// NewSetWithSortable returns a new Set. See the documentation for +// NewSetWithSortableFiltered for more details. +// +// This call includes a Sortable option as a memory optimization. +func NewSetWithSortable(kvs []KeyValue, tmp *Sortable) Set { + // Check for empty set. + if len(kvs) == 0 { + return empty() + } + s, _ := NewSetWithSortableFiltered(kvs, tmp, nil) + return s +} + +// NewSetWithFiltered returns a new Set. See the documentation for +// NewSetWithSortableFiltered for more details. +// +// This call includes a Filter to include/exclude attribute keys from the +// return value. Excluded keys are returned as a slice of attribute values. +func NewSetWithFiltered(kvs []KeyValue, filter Filter) (Set, []KeyValue) { + // Check for empty set. + if len(kvs) == 0 { + return empty(), nil + } + srt := sortables.Get().(*Sortable) + s, filtered := NewSetWithSortableFiltered(kvs, srt, filter) + sortables.Put(srt) + return s, filtered +} + +// NewSetWithSortableFiltered returns a new Set. +// +// Duplicate keys are eliminated by taking the last value. This +// re-orders the input slice so that unique last-values are contiguous +// at the end of the slice. +// +// This ensures the following: +// +// - Last-value-wins semantics +// - Caller sees the reordering, but doesn't lose values +// - Repeated call preserve last-value wins. +// +// Note that methods are defined on Set, although this returns Set. Callers +// can avoid memory allocations by: +// +// - allocating a Sortable for use as a temporary in this method +// - allocating a Set for storing the return value of this constructor. +// +// The result maintains a cache of encoded attributes, by attribute.EncoderID. +// This value should not be copied after its first use. +// +// The second []KeyValue return value is a list of attributes that were +// excluded by the Filter (if non-nil). +func NewSetWithSortableFiltered(kvs []KeyValue, tmp *Sortable, filter Filter) (Set, []KeyValue) { + // Check for empty set. + if len(kvs) == 0 { + return empty(), nil + } + + *tmp = kvs + + // Stable sort so the following de-duplication can implement + // last-value-wins semantics. + sort.Stable(tmp) + + *tmp = nil + + position := len(kvs) - 1 + offset := position - 1 + + // The requirements stated above require that the stable + // result be placed in the end of the input slice, while + // overwritten values are swapped to the beginning. + // + // De-duplicate with last-value-wins semantics. Preserve + // duplicate values at the beginning of the input slice. + for ; offset >= 0; offset-- { + if kvs[offset].Key == kvs[position].Key { + continue + } + position-- + kvs[offset], kvs[position] = kvs[position], kvs[offset] + } + if filter != nil { + return filterSet(kvs[position:], filter) + } + return Set{ + equivalent: computeDistinct(kvs[position:]), + }, nil +} + +// filterSet reorders kvs so that included keys are contiguous at the end of +// the slice, while excluded keys precede the included keys. +func filterSet(kvs []KeyValue, filter Filter) (Set, []KeyValue) { + var excluded []KeyValue + + // Move attributes that do not match the filter so they're adjacent before + // calling computeDistinct(). + distinctPosition := len(kvs) + + // Swap indistinct keys forward and distinct keys toward the + // end of the slice. + offset := len(kvs) - 1 + for ; offset >= 0; offset-- { + if filter(kvs[offset]) { + distinctPosition-- + kvs[offset], kvs[distinctPosition] = kvs[distinctPosition], kvs[offset] + continue + } + } + excluded = kvs[:distinctPosition] + + return Set{ + equivalent: computeDistinct(kvs[distinctPosition:]), + }, excluded +} + +// Filter returns a filtered copy of this Set. See the documentation for +// NewSetWithSortableFiltered for more details. +func (l *Set) Filter(re Filter) (Set, []KeyValue) { + if re == nil { + return Set{ + equivalent: l.equivalent, + }, nil + } + + // Note: This could be refactored to avoid the temporary slice + // allocation, if it proves to be expensive. + return filterSet(l.ToSlice(), re) +} + +// computeDistinct returns a Distinct using either the fixed- or +// reflect-oriented code path, depending on the size of the input. The input +// slice is assumed to already be sorted and de-duplicated. +func computeDistinct(kvs []KeyValue) Distinct { + iface := computeDistinctFixed(kvs) + if iface == nil { + iface = computeDistinctReflect(kvs) + } + return Distinct{ + iface: iface, + } +} + +// computeDistinctFixed computes a Distinct for small slices. It returns nil +// if the input is too large for this code path. +func computeDistinctFixed(kvs []KeyValue) interface{} { + switch len(kvs) { + case 1: + ptr := new([1]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 2: + ptr := new([2]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 3: + ptr := new([3]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 4: + ptr := new([4]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 5: + ptr := new([5]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 6: + ptr := new([6]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 7: + ptr := new([7]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 8: + ptr := new([8]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 9: + ptr := new([9]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 10: + ptr := new([10]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + default: + return nil + } +} + +// computeDistinctReflect computes a Distinct using reflection, works for any +// size input. +func computeDistinctReflect(kvs []KeyValue) interface{} { + at := reflect.New(reflect.ArrayOf(len(kvs), keyValueType)).Elem() + for i, keyValue := range kvs { + *(at.Index(i).Addr().Interface().(*KeyValue)) = keyValue + } + return at.Interface() +} + +// MarshalJSON returns the JSON encoding of the Set. +func (l *Set) MarshalJSON() ([]byte, error) { + return json.Marshal(l.equivalent.iface) +} + +// MarshalLog is the marshaling function used by the logging system to represent this exporter. +func (l Set) MarshalLog() interface{} { + kvs := make(map[string]string) + for _, kv := range l.ToSlice() { + kvs[string(kv.Key)] = kv.Value.Emit() + } + return kvs +} + +// Len implements sort.Interface. +func (l *Sortable) Len() int { + return len(*l) +} + +// Swap implements sort.Interface. +func (l *Sortable) Swap(i, j int) { + (*l)[i], (*l)[j] = (*l)[j], (*l)[i] +} + +// Less implements sort.Interface. +func (l *Sortable) Less(i, j int) bool { + return (*l)[i].Key < (*l)[j].Key +} diff --git a/vendor/go.opentelemetry.io/otel/attribute/type_string.go b/vendor/go.opentelemetry.io/otel/attribute/type_string.go new file mode 100644 index 000000000..e584b2477 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/attribute/type_string.go @@ -0,0 +1,31 @@ +// Code generated by "stringer -type=Type"; DO NOT EDIT. + +package attribute + +import "strconv" + +func _() { + // An "invalid array index" compiler error signifies that the constant values have changed. + // Re-run the stringer command to generate them again. + var x [1]struct{} + _ = x[INVALID-0] + _ = x[BOOL-1] + _ = x[INT64-2] + _ = x[FLOAT64-3] + _ = x[STRING-4] + _ = x[BOOLSLICE-5] + _ = x[INT64SLICE-6] + _ = x[FLOAT64SLICE-7] + _ = x[STRINGSLICE-8] +} + +const _Type_name = "INVALIDBOOLINT64FLOAT64STRINGBOOLSLICEINT64SLICEFLOAT64SLICESTRINGSLICE" + +var _Type_index = [...]uint8{0, 7, 11, 16, 23, 29, 38, 48, 60, 71} + +func (i Type) String() string { + if i < 0 || i >= Type(len(_Type_index)-1) { + return "Type(" + strconv.FormatInt(int64(i), 10) + ")" + } + return _Type_name[_Type_index[i]:_Type_index[i+1]] +} diff --git a/vendor/go.opentelemetry.io/otel/attribute/value.go b/vendor/go.opentelemetry.io/otel/attribute/value.go new file mode 100644 index 000000000..cb21dd5c0 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/attribute/value.go @@ -0,0 +1,270 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package attribute // import "go.opentelemetry.io/otel/attribute" + +import ( + "encoding/json" + "fmt" + "reflect" + "strconv" + + "go.opentelemetry.io/otel/internal" + "go.opentelemetry.io/otel/internal/attribute" +) + +//go:generate stringer -type=Type + +// Type describes the type of the data Value holds. +type Type int // nolint: revive // redefines builtin Type. + +// Value represents the value part in key-value pairs. +type Value struct { + vtype Type + numeric uint64 + stringly string + slice interface{} +} + +const ( + // INVALID is used for a Value with no value set. + INVALID Type = iota + // BOOL is a boolean Type Value. + BOOL + // INT64 is a 64-bit signed integral Type Value. + INT64 + // FLOAT64 is a 64-bit floating point Type Value. + FLOAT64 + // STRING is a string Type Value. + STRING + // BOOLSLICE is a slice of booleans Type Value. + BOOLSLICE + // INT64SLICE is a slice of 64-bit signed integral numbers Type Value. + INT64SLICE + // FLOAT64SLICE is a slice of 64-bit floating point numbers Type Value. + FLOAT64SLICE + // STRINGSLICE is a slice of strings Type Value. + STRINGSLICE +) + +// BoolValue creates a BOOL Value. +func BoolValue(v bool) Value { + return Value{ + vtype: BOOL, + numeric: internal.BoolToRaw(v), + } +} + +// BoolSliceValue creates a BOOLSLICE Value. +func BoolSliceValue(v []bool) Value { + return Value{vtype: BOOLSLICE, slice: attribute.BoolSliceValue(v)} +} + +// IntValue creates an INT64 Value. +func IntValue(v int) Value { + return Int64Value(int64(v)) +} + +// IntSliceValue creates an INTSLICE Value. +func IntSliceValue(v []int) Value { + var int64Val int64 + cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(int64Val))) + for i, val := range v { + cp.Elem().Index(i).SetInt(int64(val)) + } + return Value{ + vtype: INT64SLICE, + slice: cp.Elem().Interface(), + } +} + +// Int64Value creates an INT64 Value. +func Int64Value(v int64) Value { + return Value{ + vtype: INT64, + numeric: internal.Int64ToRaw(v), + } +} + +// Int64SliceValue creates an INT64SLICE Value. +func Int64SliceValue(v []int64) Value { + return Value{vtype: INT64SLICE, slice: attribute.Int64SliceValue(v)} +} + +// Float64Value creates a FLOAT64 Value. +func Float64Value(v float64) Value { + return Value{ + vtype: FLOAT64, + numeric: internal.Float64ToRaw(v), + } +} + +// Float64SliceValue creates a FLOAT64SLICE Value. +func Float64SliceValue(v []float64) Value { + return Value{vtype: FLOAT64SLICE, slice: attribute.Float64SliceValue(v)} +} + +// StringValue creates a STRING Value. +func StringValue(v string) Value { + return Value{ + vtype: STRING, + stringly: v, + } +} + +// StringSliceValue creates a STRINGSLICE Value. +func StringSliceValue(v []string) Value { + return Value{vtype: STRINGSLICE, slice: attribute.StringSliceValue(v)} +} + +// Type returns a type of the Value. +func (v Value) Type() Type { + return v.vtype +} + +// AsBool returns the bool value. Make sure that the Value's type is +// BOOL. +func (v Value) AsBool() bool { + return internal.RawToBool(v.numeric) +} + +// AsBoolSlice returns the []bool value. Make sure that the Value's type is +// BOOLSLICE. +func (v Value) AsBoolSlice() []bool { + if v.vtype != BOOLSLICE { + return nil + } + return v.asBoolSlice() +} + +func (v Value) asBoolSlice() []bool { + return attribute.AsBoolSlice(v.slice) +} + +// AsInt64 returns the int64 value. Make sure that the Value's type is +// INT64. +func (v Value) AsInt64() int64 { + return internal.RawToInt64(v.numeric) +} + +// AsInt64Slice returns the []int64 value. Make sure that the Value's type is +// INT64SLICE. +func (v Value) AsInt64Slice() []int64 { + if v.vtype != INT64SLICE { + return nil + } + return v.asInt64Slice() +} + +func (v Value) asInt64Slice() []int64 { + return attribute.AsInt64Slice(v.slice) +} + +// AsFloat64 returns the float64 value. Make sure that the Value's +// type is FLOAT64. +func (v Value) AsFloat64() float64 { + return internal.RawToFloat64(v.numeric) +} + +// AsFloat64Slice returns the []float64 value. Make sure that the Value's type is +// FLOAT64SLICE. +func (v Value) AsFloat64Slice() []float64 { + if v.vtype != FLOAT64SLICE { + return nil + } + return v.asFloat64Slice() +} + +func (v Value) asFloat64Slice() []float64 { + return attribute.AsFloat64Slice(v.slice) +} + +// AsString returns the string value. Make sure that the Value's type +// is STRING. +func (v Value) AsString() string { + return v.stringly +} + +// AsStringSlice returns the []string value. Make sure that the Value's type is +// STRINGSLICE. +func (v Value) AsStringSlice() []string { + if v.vtype != STRINGSLICE { + return nil + } + return v.asStringSlice() +} + +func (v Value) asStringSlice() []string { + return attribute.AsStringSlice(v.slice) +} + +type unknownValueType struct{} + +// AsInterface returns Value's data as interface{}. +func (v Value) AsInterface() interface{} { + switch v.Type() { + case BOOL: + return v.AsBool() + case BOOLSLICE: + return v.asBoolSlice() + case INT64: + return v.AsInt64() + case INT64SLICE: + return v.asInt64Slice() + case FLOAT64: + return v.AsFloat64() + case FLOAT64SLICE: + return v.asFloat64Slice() + case STRING: + return v.stringly + case STRINGSLICE: + return v.asStringSlice() + } + return unknownValueType{} +} + +// Emit returns a string representation of Value's data. +func (v Value) Emit() string { + switch v.Type() { + case BOOLSLICE: + return fmt.Sprint(v.asBoolSlice()) + case BOOL: + return strconv.FormatBool(v.AsBool()) + case INT64SLICE: + return fmt.Sprint(v.asInt64Slice()) + case INT64: + return strconv.FormatInt(v.AsInt64(), 10) + case FLOAT64SLICE: + return fmt.Sprint(v.asFloat64Slice()) + case FLOAT64: + return fmt.Sprint(v.AsFloat64()) + case STRINGSLICE: + return fmt.Sprint(v.asStringSlice()) + case STRING: + return v.stringly + default: + return "unknown" + } +} + +// MarshalJSON returns the JSON encoding of the Value. +func (v Value) MarshalJSON() ([]byte, error) { + var jsonVal struct { + Type string + Value interface{} + } + jsonVal.Type = v.Type().String() + jsonVal.Value = v.AsInterface() + return json.Marshal(jsonVal) +} diff --git a/vendor/go.opentelemetry.io/otel/baggage/baggage.go b/vendor/go.opentelemetry.io/otel/baggage/baggage.go new file mode 100644 index 000000000..84532cb1d --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/baggage/baggage.go @@ -0,0 +1,552 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package baggage // import "go.opentelemetry.io/otel/baggage" + +import ( + "errors" + "fmt" + "net/url" + "regexp" + "strings" + + "go.opentelemetry.io/otel/internal/baggage" +) + +const ( + maxMembers = 180 + maxBytesPerMembers = 4096 + maxBytesPerBaggageString = 8192 + + listDelimiter = "," + keyValueDelimiter = "=" + propertyDelimiter = ";" + + keyDef = `([\x21\x23-\x27\x2A\x2B\x2D\x2E\x30-\x39\x41-\x5a\x5e-\x7a\x7c\x7e]+)` + valueDef = `([\x21\x23-\x2b\x2d-\x3a\x3c-\x5B\x5D-\x7e]*)` + keyValueDef = `\s*` + keyDef + `\s*` + keyValueDelimiter + `\s*` + valueDef + `\s*` +) + +var ( + keyRe = regexp.MustCompile(`^` + keyDef + `$`) + valueRe = regexp.MustCompile(`^` + valueDef + `$`) + propertyRe = regexp.MustCompile(`^(?:\s*` + keyDef + `\s*|` + keyValueDef + `)$`) +) + +var ( + errInvalidKey = errors.New("invalid key") + errInvalidValue = errors.New("invalid value") + errInvalidProperty = errors.New("invalid baggage list-member property") + errInvalidMember = errors.New("invalid baggage list-member") + errMemberNumber = errors.New("too many list-members in baggage-string") + errMemberBytes = errors.New("list-member too large") + errBaggageBytes = errors.New("baggage-string too large") +) + +// Property is an additional metadata entry for a baggage list-member. +type Property struct { + key, value string + + // hasValue indicates if a zero-value value means the property does not + // have a value or if it was the zero-value. + hasValue bool +} + +// NewKeyProperty returns a new Property for key. +// +// If key is invalid, an error will be returned. +func NewKeyProperty(key string) (Property, error) { + if !keyRe.MatchString(key) { + return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidKey, key) + } + + p := Property{key: key} + return p, nil +} + +// NewKeyValueProperty returns a new Property for key with value. +// +// If key or value are invalid, an error will be returned. +func NewKeyValueProperty(key, value string) (Property, error) { + if !keyRe.MatchString(key) { + return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidKey, key) + } + if !valueRe.MatchString(value) { + return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidValue, value) + } + + p := Property{ + key: key, + value: value, + hasValue: true, + } + return p, nil +} + +func newInvalidProperty() Property { + return Property{} +} + +// parseProperty attempts to decode a Property from the passed string. It +// returns an error if the input is invalid according to the W3C Baggage +// specification. +func parseProperty(property string) (Property, error) { + if property == "" { + return newInvalidProperty(), nil + } + + match := propertyRe.FindStringSubmatch(property) + if len(match) != 4 { + return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidProperty, property) + } + + var p Property + if match[1] != "" { + p.key = match[1] + } else { + p.key = match[2] + p.value = match[3] + p.hasValue = true + } + + return p, nil +} + +// validate ensures p conforms to the W3C Baggage specification, returning an +// error otherwise. +func (p Property) validate() error { + errFunc := func(err error) error { + return fmt.Errorf("invalid property: %w", err) + } + + if !keyRe.MatchString(p.key) { + return errFunc(fmt.Errorf("%w: %q", errInvalidKey, p.key)) + } + if p.hasValue && !valueRe.MatchString(p.value) { + return errFunc(fmt.Errorf("%w: %q", errInvalidValue, p.value)) + } + if !p.hasValue && p.value != "" { + return errFunc(errors.New("inconsistent value")) + } + return nil +} + +// Key returns the Property key. +func (p Property) Key() string { + return p.key +} + +// Value returns the Property value. Additionally, a boolean value is returned +// indicating if the returned value is the empty if the Property has a value +// that is empty or if the value is not set. +func (p Property) Value() (string, bool) { + return p.value, p.hasValue +} + +// String encodes Property into a string compliant with the W3C Baggage +// specification. +func (p Property) String() string { + if p.hasValue { + return fmt.Sprintf("%s%s%v", p.key, keyValueDelimiter, p.value) + } + return p.key +} + +type properties []Property + +func fromInternalProperties(iProps []baggage.Property) properties { + if len(iProps) == 0 { + return nil + } + + props := make(properties, len(iProps)) + for i, p := range iProps { + props[i] = Property{ + key: p.Key, + value: p.Value, + hasValue: p.HasValue, + } + } + return props +} + +func (p properties) asInternal() []baggage.Property { + if len(p) == 0 { + return nil + } + + iProps := make([]baggage.Property, len(p)) + for i, prop := range p { + iProps[i] = baggage.Property{ + Key: prop.key, + Value: prop.value, + HasValue: prop.hasValue, + } + } + return iProps +} + +func (p properties) Copy() properties { + if len(p) == 0 { + return nil + } + + props := make(properties, len(p)) + copy(props, p) + return props +} + +// validate ensures each Property in p conforms to the W3C Baggage +// specification, returning an error otherwise. +func (p properties) validate() error { + for _, prop := range p { + if err := prop.validate(); err != nil { + return err + } + } + return nil +} + +// String encodes properties into a string compliant with the W3C Baggage +// specification. +func (p properties) String() string { + props := make([]string, len(p)) + for i, prop := range p { + props[i] = prop.String() + } + return strings.Join(props, propertyDelimiter) +} + +// Member is a list-member of a baggage-string as defined by the W3C Baggage +// specification. +type Member struct { + key, value string + properties properties + + // hasData indicates whether the created property contains data or not. + // Properties that do not contain data are invalid with no other check + // required. + hasData bool +} + +// NewMember returns a new Member from the passed arguments. The key will be +// used directly while the value will be url decoded after validation. An error +// is returned if the created Member would be invalid according to the W3C +// Baggage specification. +func NewMember(key, value string, props ...Property) (Member, error) { + m := Member{ + key: key, + value: value, + properties: properties(props).Copy(), + hasData: true, + } + if err := m.validate(); err != nil { + return newInvalidMember(), err + } + decodedValue, err := url.PathUnescape(value) + if err != nil { + return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, value) + } + m.value = decodedValue + return m, nil +} + +func newInvalidMember() Member { + return Member{} +} + +// parseMember attempts to decode a Member from the passed string. It returns +// an error if the input is invalid according to the W3C Baggage +// specification. +func parseMember(member string) (Member, error) { + if n := len(member); n > maxBytesPerMembers { + return newInvalidMember(), fmt.Errorf("%w: %d", errMemberBytes, n) + } + + var ( + key, value string + props properties + ) + + keyValue, properties, found := strings.Cut(member, propertyDelimiter) + if found { + // Parse the member properties. + for _, pStr := range strings.Split(properties, propertyDelimiter) { + p, err := parseProperty(pStr) + if err != nil { + return newInvalidMember(), err + } + props = append(props, p) + } + } + // Parse the member key/value pair. + + // Take into account a value can contain equal signs (=). + k, v, found := strings.Cut(keyValue, keyValueDelimiter) + if !found { + return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidMember, member) + } + // "Leading and trailing whitespaces are allowed but MUST be trimmed + // when converting the header into a data structure." + key = strings.TrimSpace(k) + var err error + value, err = url.PathUnescape(strings.TrimSpace(v)) + if err != nil { + return newInvalidMember(), fmt.Errorf("%w: %q", err, value) + } + if !keyRe.MatchString(key) { + return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidKey, key) + } + if !valueRe.MatchString(value) { + return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, value) + } + + return Member{key: key, value: value, properties: props, hasData: true}, nil +} + +// validate ensures m conforms to the W3C Baggage specification. +// A key is just an ASCII string, but a value must be URL encoded UTF-8, +// returning an error otherwise. +func (m Member) validate() error { + if !m.hasData { + return fmt.Errorf("%w: %q", errInvalidMember, m) + } + + if !keyRe.MatchString(m.key) { + return fmt.Errorf("%w: %q", errInvalidKey, m.key) + } + if !valueRe.MatchString(m.value) { + return fmt.Errorf("%w: %q", errInvalidValue, m.value) + } + return m.properties.validate() +} + +// Key returns the Member key. +func (m Member) Key() string { return m.key } + +// Value returns the Member value. +func (m Member) Value() string { return m.value } + +// Properties returns a copy of the Member properties. +func (m Member) Properties() []Property { return m.properties.Copy() } + +// String encodes Member into a string compliant with the W3C Baggage +// specification. +func (m Member) String() string { + // A key is just an ASCII string, but a value is URL encoded UTF-8. + s := fmt.Sprintf("%s%s%s", m.key, keyValueDelimiter, url.QueryEscape(m.value)) + if len(m.properties) > 0 { + s = fmt.Sprintf("%s%s%s", s, propertyDelimiter, m.properties.String()) + } + return s +} + +// Baggage is a list of baggage members representing the baggage-string as +// defined by the W3C Baggage specification. +type Baggage struct { //nolint:golint + list baggage.List +} + +// New returns a new valid Baggage. It returns an error if it results in a +// Baggage exceeding limits set in that specification. +// +// It expects all the provided members to have already been validated. +func New(members ...Member) (Baggage, error) { + if len(members) == 0 { + return Baggage{}, nil + } + + b := make(baggage.List) + for _, m := range members { + if !m.hasData { + return Baggage{}, errInvalidMember + } + + // OpenTelemetry resolves duplicates by last-one-wins. + b[m.key] = baggage.Item{ + Value: m.value, + Properties: m.properties.asInternal(), + } + } + + // Check member numbers after deduplication. + if len(b) > maxMembers { + return Baggage{}, errMemberNumber + } + + bag := Baggage{b} + if n := len(bag.String()); n > maxBytesPerBaggageString { + return Baggage{}, fmt.Errorf("%w: %d", errBaggageBytes, n) + } + + return bag, nil +} + +// Parse attempts to decode a baggage-string from the passed string. It +// returns an error if the input is invalid according to the W3C Baggage +// specification. +// +// If there are duplicate list-members contained in baggage, the last one +// defined (reading left-to-right) will be the only one kept. This diverges +// from the W3C Baggage specification which allows duplicate list-members, but +// conforms to the OpenTelemetry Baggage specification. +func Parse(bStr string) (Baggage, error) { + if bStr == "" { + return Baggage{}, nil + } + + if n := len(bStr); n > maxBytesPerBaggageString { + return Baggage{}, fmt.Errorf("%w: %d", errBaggageBytes, n) + } + + b := make(baggage.List) + for _, memberStr := range strings.Split(bStr, listDelimiter) { + m, err := parseMember(memberStr) + if err != nil { + return Baggage{}, err + } + // OpenTelemetry resolves duplicates by last-one-wins. + b[m.key] = baggage.Item{ + Value: m.value, + Properties: m.properties.asInternal(), + } + } + + // OpenTelemetry does not allow for duplicate list-members, but the W3C + // specification does. Now that we have deduplicated, ensure the baggage + // does not exceed list-member limits. + if len(b) > maxMembers { + return Baggage{}, errMemberNumber + } + + return Baggage{b}, nil +} + +// Member returns the baggage list-member identified by key. +// +// If there is no list-member matching the passed key the returned Member will +// be a zero-value Member. +// The returned member is not validated, as we assume the validation happened +// when it was added to the Baggage. +func (b Baggage) Member(key string) Member { + v, ok := b.list[key] + if !ok { + // We do not need to worry about distinguishing between the situation + // where a zero-valued Member is included in the Baggage because a + // zero-valued Member is invalid according to the W3C Baggage + // specification (it has an empty key). + return newInvalidMember() + } + + return Member{ + key: key, + value: v.Value, + properties: fromInternalProperties(v.Properties), + hasData: true, + } +} + +// Members returns all the baggage list-members. +// The order of the returned list-members does not have significance. +// +// The returned members are not validated, as we assume the validation happened +// when they were added to the Baggage. +func (b Baggage) Members() []Member { + if len(b.list) == 0 { + return nil + } + + members := make([]Member, 0, len(b.list)) + for k, v := range b.list { + members = append(members, Member{ + key: k, + value: v.Value, + properties: fromInternalProperties(v.Properties), + hasData: true, + }) + } + return members +} + +// SetMember returns a copy the Baggage with the member included. If the +// baggage contains a Member with the same key the existing Member is +// replaced. +// +// If member is invalid according to the W3C Baggage specification, an error +// is returned with the original Baggage. +func (b Baggage) SetMember(member Member) (Baggage, error) { + if !member.hasData { + return b, errInvalidMember + } + + n := len(b.list) + if _, ok := b.list[member.key]; !ok { + n++ + } + list := make(baggage.List, n) + + for k, v := range b.list { + // Do not copy if we are just going to overwrite. + if k == member.key { + continue + } + list[k] = v + } + + list[member.key] = baggage.Item{ + Value: member.value, + Properties: member.properties.asInternal(), + } + + return Baggage{list: list}, nil +} + +// DeleteMember returns a copy of the Baggage with the list-member identified +// by key removed. +func (b Baggage) DeleteMember(key string) Baggage { + n := len(b.list) + if _, ok := b.list[key]; ok { + n-- + } + list := make(baggage.List, n) + + for k, v := range b.list { + if k == key { + continue + } + list[k] = v + } + + return Baggage{list: list} +} + +// Len returns the number of list-members in the Baggage. +func (b Baggage) Len() int { + return len(b.list) +} + +// String encodes Baggage into a string compliant with the W3C Baggage +// specification. The returned string will be invalid if the Baggage contains +// any invalid list-members. +func (b Baggage) String() string { + members := make([]string, 0, len(b.list)) + for k, v := range b.list { + members = append(members, Member{ + key: k, + value: v.Value, + properties: fromInternalProperties(v.Properties), + }.String()) + } + return strings.Join(members, listDelimiter) +} diff --git a/vendor/go.opentelemetry.io/otel/baggage/context.go b/vendor/go.opentelemetry.io/otel/baggage/context.go new file mode 100644 index 000000000..24b34b756 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/baggage/context.go @@ -0,0 +1,39 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package baggage // import "go.opentelemetry.io/otel/baggage" + +import ( + "context" + + "go.opentelemetry.io/otel/internal/baggage" +) + +// ContextWithBaggage returns a copy of parent with baggage. +func ContextWithBaggage(parent context.Context, b Baggage) context.Context { + // Delegate so any hooks for the OpenTracing bridge are handled. + return baggage.ContextWithList(parent, b.list) +} + +// ContextWithoutBaggage returns a copy of parent with no baggage. +func ContextWithoutBaggage(parent context.Context) context.Context { + // Delegate so any hooks for the OpenTracing bridge are handled. + return baggage.ContextWithList(parent, nil) +} + +// FromContext returns the baggage contained in ctx. +func FromContext(ctx context.Context) Baggage { + // Delegate so any hooks for the OpenTracing bridge are handled. + return Baggage{list: baggage.ListFromContext(ctx)} +} diff --git a/vendor/go.opentelemetry.io/otel/baggage/doc.go b/vendor/go.opentelemetry.io/otel/baggage/doc.go new file mode 100644 index 000000000..4545100df --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/baggage/doc.go @@ -0,0 +1,20 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* +Package baggage provides functionality for storing and retrieving +baggage items in Go context. For propagating the baggage, see the +go.opentelemetry.io/otel/propagation package. +*/ +package baggage // import "go.opentelemetry.io/otel/baggage" diff --git a/vendor/go.opentelemetry.io/otel/codes/codes.go b/vendor/go.opentelemetry.io/otel/codes/codes.go new file mode 100644 index 000000000..587ebae4e --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/codes/codes.go @@ -0,0 +1,116 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package codes // import "go.opentelemetry.io/otel/codes" + +import ( + "encoding/json" + "fmt" + "strconv" +) + +const ( + // Unset is the default status code. + Unset Code = 0 + + // Error indicates the operation contains an error. + // + // NOTE: The error code in OTLP is 2. + // The value of this enum is only relevant to the internals + // of the Go SDK. + Error Code = 1 + + // Ok indicates operation has been validated by an Application developers + // or Operator to have completed successfully, or contain no error. + // + // NOTE: The Ok code in OTLP is 1. + // The value of this enum is only relevant to the internals + // of the Go SDK. + Ok Code = 2 + + maxCode = 3 +) + +// Code is an 32-bit representation of a status state. +type Code uint32 + +var codeToStr = map[Code]string{ + Unset: "Unset", + Error: "Error", + Ok: "Ok", +} + +var strToCode = map[string]Code{ + `"Unset"`: Unset, + `"Error"`: Error, + `"Ok"`: Ok, +} + +// String returns the Code as a string. +func (c Code) String() string { + return codeToStr[c] +} + +// UnmarshalJSON unmarshals b into the Code. +// +// This is based on the functionality in the gRPC codes package: +// https://github.com/grpc/grpc-go/blob/bb64fee312b46ebee26be43364a7a966033521b1/codes/codes.go#L218-L244 +func (c *Code) UnmarshalJSON(b []byte) error { + // From json.Unmarshaler: By convention, to approximate the behavior of + // Unmarshal itself, Unmarshalers implement UnmarshalJSON([]byte("null")) as + // a no-op. + if string(b) == "null" { + return nil + } + if c == nil { + return fmt.Errorf("nil receiver passed to UnmarshalJSON") + } + + var x interface{} + if err := json.Unmarshal(b, &x); err != nil { + return err + } + switch x.(type) { + case string: + if jc, ok := strToCode[string(b)]; ok { + *c = jc + return nil + } + return fmt.Errorf("invalid code: %q", string(b)) + case float64: + if ci, err := strconv.ParseUint(string(b), 10, 32); err == nil { + if ci >= maxCode { + return fmt.Errorf("invalid code: %q", ci) + } + + *c = Code(ci) + return nil + } + return fmt.Errorf("invalid code: %q", string(b)) + default: + return fmt.Errorf("invalid code: %q", string(b)) + } +} + +// MarshalJSON returns c as the JSON encoding of c. +func (c *Code) MarshalJSON() ([]byte, error) { + if c == nil { + return []byte("null"), nil + } + str, ok := codeToStr[*c] + if !ok { + return nil, fmt.Errorf("invalid code: %d", *c) + } + return []byte(fmt.Sprintf("%q", str)), nil +} diff --git a/vendor/go.opentelemetry.io/otel/codes/doc.go b/vendor/go.opentelemetry.io/otel/codes/doc.go new file mode 100644 index 000000000..4e328fbb4 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/codes/doc.go @@ -0,0 +1,21 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* +Package codes defines the canonical error codes used by OpenTelemetry. + +It conforms to [the OpenTelemetry +specification](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/trace/api.md#set-status). +*/ +package codes // import "go.opentelemetry.io/otel/codes" diff --git a/vendor/go.opentelemetry.io/otel/doc.go b/vendor/go.opentelemetry.io/otel/doc.go new file mode 100644 index 000000000..daa36c89d --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/doc.go @@ -0,0 +1,34 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* +Package otel provides global access to the OpenTelemetry API. The subpackages of +the otel package provide an implementation of the OpenTelemetry API. + +The provided API is used to instrument code and measure data about that code's +performance and operation. The measured data, by default, is not processed or +transmitted anywhere. An implementation of the OpenTelemetry SDK, like the +default SDK implementation (go.opentelemetry.io/otel/sdk), and associated +exporters are used to process and transport this data. + +To read the getting started guide, see https://opentelemetry.io/docs/go/getting-started/. + +To read more about tracing, see go.opentelemetry.io/otel/trace. + +To read more about metrics, see go.opentelemetry.io/otel/metric. + +To read more about propagation, see go.opentelemetry.io/otel/propagation and +go.opentelemetry.io/otel/baggage. +*/ +package otel // import "go.opentelemetry.io/otel" diff --git a/vendor/go.opentelemetry.io/otel/error_handler.go b/vendor/go.opentelemetry.io/otel/error_handler.go new file mode 100644 index 000000000..72fad8541 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/error_handler.go @@ -0,0 +1,38 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otel // import "go.opentelemetry.io/otel" + +// ErrorHandler handles irremediable events. +type ErrorHandler interface { + // DO NOT CHANGE: any modification will not be backwards compatible and + // must never be done outside of a new major release. + + // Handle handles any error deemed irremediable by an OpenTelemetry + // component. + Handle(error) + // DO NOT CHANGE: any modification will not be backwards compatible and + // must never be done outside of a new major release. +} + +// ErrorHandlerFunc is a convenience adapter to allow the use of a function +// as an ErrorHandler. +type ErrorHandlerFunc func(error) + +var _ ErrorHandler = ErrorHandlerFunc(nil) + +// Handle handles the irremediable error by calling the ErrorHandlerFunc itself. +func (f ErrorHandlerFunc) Handle(err error) { + f(err) +} diff --git a/vendor/go.opentelemetry.io/otel/get_main_pkgs.sh b/vendor/go.opentelemetry.io/otel/get_main_pkgs.sh new file mode 100644 index 000000000..9a58fb1d3 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/get_main_pkgs.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -euo pipefail + +top_dir='.' +if [[ $# -gt 0 ]]; then + top_dir="${1}" +fi + +p=$(pwd) +mod_dirs=() + +# Note `mapfile` does not exist in older bash versions: +# https://stackoverflow.com/questions/41475261/need-alternative-to-readarray-mapfile-for-script-on-older-version-of-bash + +while IFS= read -r line; do + mod_dirs+=("$line") +done < <(find "${top_dir}" -type f -name 'go.mod' -exec dirname {} \; | sort) + +for mod_dir in "${mod_dirs[@]}"; do + cd "${mod_dir}" + + while IFS= read -r line; do + echo ".${line#${p}}" + done < <(go list --find -f '{{.Name}}|{{.Dir}}' ./... | grep '^main|' | cut -f 2- -d '|') + cd "${p}" +done diff --git a/vendor/go.opentelemetry.io/otel/handler.go b/vendor/go.opentelemetry.io/otel/handler.go new file mode 100644 index 000000000..4115fe3bb --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/handler.go @@ -0,0 +1,48 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otel // import "go.opentelemetry.io/otel" + +import ( + "go.opentelemetry.io/otel/internal/global" +) + +var ( + // Compile-time check global.ErrDelegator implements ErrorHandler. + _ ErrorHandler = (*global.ErrDelegator)(nil) + // Compile-time check global.ErrLogger implements ErrorHandler. + _ ErrorHandler = (*global.ErrLogger)(nil) +) + +// GetErrorHandler returns the global ErrorHandler instance. +// +// The default ErrorHandler instance returned will log all errors to STDERR +// until an override ErrorHandler is set with SetErrorHandler. All +// ErrorHandler returned prior to this will automatically forward errors to +// the set instance instead of logging. +// +// Subsequent calls to SetErrorHandler after the first will not forward errors +// to the new ErrorHandler for prior returned instances. +func GetErrorHandler() ErrorHandler { return global.GetErrorHandler() } + +// SetErrorHandler sets the global ErrorHandler to h. +// +// The first time this is called all ErrorHandler previously returned from +// GetErrorHandler will send errors to h instead of the default logging +// ErrorHandler. Subsequent calls will set the global ErrorHandler, but not +// delegate errors to h. +func SetErrorHandler(h ErrorHandler) { global.SetErrorHandler(h) } + +// Handle is a convenience function for ErrorHandler().Handle(err). +func Handle(err error) { global.Handle(err) } diff --git a/vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go b/vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go new file mode 100644 index 000000000..622c3ee3f --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go @@ -0,0 +1,111 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* +Package attribute provide several helper functions for some commonly used +logic of processing attributes. +*/ +package attribute // import "go.opentelemetry.io/otel/internal/attribute" + +import ( + "reflect" +) + +// BoolSliceValue converts a bool slice into an array with same elements as slice. +func BoolSliceValue(v []bool) interface{} { + var zero bool + cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))) + copy(cp.Elem().Slice(0, len(v)).Interface().([]bool), v) + return cp.Elem().Interface() +} + +// Int64SliceValue converts an int64 slice into an array with same elements as slice. +func Int64SliceValue(v []int64) interface{} { + var zero int64 + cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))) + copy(cp.Elem().Slice(0, len(v)).Interface().([]int64), v) + return cp.Elem().Interface() +} + +// Float64SliceValue converts a float64 slice into an array with same elements as slice. +func Float64SliceValue(v []float64) interface{} { + var zero float64 + cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))) + copy(cp.Elem().Slice(0, len(v)).Interface().([]float64), v) + return cp.Elem().Interface() +} + +// StringSliceValue converts a string slice into an array with same elements as slice. +func StringSliceValue(v []string) interface{} { + var zero string + cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))) + copy(cp.Elem().Slice(0, len(v)).Interface().([]string), v) + return cp.Elem().Interface() +} + +// AsBoolSlice converts a bool array into a slice into with same elements as array. +func AsBoolSlice(v interface{}) []bool { + rv := reflect.ValueOf(v) + if rv.Type().Kind() != reflect.Array { + return nil + } + var zero bool + correctLen := rv.Len() + correctType := reflect.ArrayOf(correctLen, reflect.TypeOf(zero)) + cpy := reflect.New(correctType) + _ = reflect.Copy(cpy.Elem(), rv) + return cpy.Elem().Slice(0, correctLen).Interface().([]bool) +} + +// AsInt64Slice converts an int64 array into a slice into with same elements as array. +func AsInt64Slice(v interface{}) []int64 { + rv := reflect.ValueOf(v) + if rv.Type().Kind() != reflect.Array { + return nil + } + var zero int64 + correctLen := rv.Len() + correctType := reflect.ArrayOf(correctLen, reflect.TypeOf(zero)) + cpy := reflect.New(correctType) + _ = reflect.Copy(cpy.Elem(), rv) + return cpy.Elem().Slice(0, correctLen).Interface().([]int64) +} + +// AsFloat64Slice converts a float64 array into a slice into with same elements as array. +func AsFloat64Slice(v interface{}) []float64 { + rv := reflect.ValueOf(v) + if rv.Type().Kind() != reflect.Array { + return nil + } + var zero float64 + correctLen := rv.Len() + correctType := reflect.ArrayOf(correctLen, reflect.TypeOf(zero)) + cpy := reflect.New(correctType) + _ = reflect.Copy(cpy.Elem(), rv) + return cpy.Elem().Slice(0, correctLen).Interface().([]float64) +} + +// AsStringSlice converts a string array into a slice into with same elements as array. +func AsStringSlice(v interface{}) []string { + rv := reflect.ValueOf(v) + if rv.Type().Kind() != reflect.Array { + return nil + } + var zero string + correctLen := rv.Len() + correctType := reflect.ArrayOf(correctLen, reflect.TypeOf(zero)) + cpy := reflect.New(correctType) + _ = reflect.Copy(cpy.Elem(), rv) + return cpy.Elem().Slice(0, correctLen).Interface().([]string) +} diff --git a/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go b/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go new file mode 100644 index 000000000..b96e5408e --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go @@ -0,0 +1,43 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* +Package baggage provides base types and functionality to store and retrieve +baggage in Go context. This package exists because the OpenTracing bridge to +OpenTelemetry needs to synchronize state whenever baggage for a context is +modified and that context contains an OpenTracing span. If it were not for +this need this package would not need to exist and the +`go.opentelemetry.io/otel/baggage` package would be the singular place where +W3C baggage is handled. +*/ +package baggage // import "go.opentelemetry.io/otel/internal/baggage" + +// List is the collection of baggage members. The W3C allows for duplicates, +// but OpenTelemetry does not, therefore, this is represented as a map. +type List map[string]Item + +// Item is the value and metadata properties part of a list-member. +type Item struct { + Value string + Properties []Property +} + +// Property is a metadata entry for a list-member. +type Property struct { + Key, Value string + + // HasValue indicates if a zero-value value means the property does not + // have a value or if it was the zero-value. + HasValue bool +} diff --git a/vendor/go.opentelemetry.io/otel/internal/baggage/context.go b/vendor/go.opentelemetry.io/otel/internal/baggage/context.go new file mode 100644 index 000000000..4469700d9 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/baggage/context.go @@ -0,0 +1,92 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package baggage // import "go.opentelemetry.io/otel/internal/baggage" + +import "context" + +type baggageContextKeyType int + +const baggageKey baggageContextKeyType = iota + +// SetHookFunc is a callback called when storing baggage in the context. +type SetHookFunc func(context.Context, List) context.Context + +// GetHookFunc is a callback called when getting baggage from the context. +type GetHookFunc func(context.Context, List) List + +type baggageState struct { + list List + + setHook SetHookFunc + getHook GetHookFunc +} + +// ContextWithSetHook returns a copy of parent with hook configured to be +// invoked every time ContextWithBaggage is called. +// +// Passing nil SetHookFunc creates a context with no set hook to call. +func ContextWithSetHook(parent context.Context, hook SetHookFunc) context.Context { + var s baggageState + if v, ok := parent.Value(baggageKey).(baggageState); ok { + s = v + } + + s.setHook = hook + return context.WithValue(parent, baggageKey, s) +} + +// ContextWithGetHook returns a copy of parent with hook configured to be +// invoked every time FromContext is called. +// +// Passing nil GetHookFunc creates a context with no get hook to call. +func ContextWithGetHook(parent context.Context, hook GetHookFunc) context.Context { + var s baggageState + if v, ok := parent.Value(baggageKey).(baggageState); ok { + s = v + } + + s.getHook = hook + return context.WithValue(parent, baggageKey, s) +} + +// ContextWithList returns a copy of parent with baggage. Passing nil list +// returns a context without any baggage. +func ContextWithList(parent context.Context, list List) context.Context { + var s baggageState + if v, ok := parent.Value(baggageKey).(baggageState); ok { + s = v + } + + s.list = list + ctx := context.WithValue(parent, baggageKey, s) + if s.setHook != nil { + ctx = s.setHook(ctx, list) + } + + return ctx +} + +// ListFromContext returns the baggage contained in ctx. +func ListFromContext(ctx context.Context) List { + switch v := ctx.Value(baggageKey).(type) { + case baggageState: + if v.getHook != nil { + return v.getHook(ctx, v.list) + } + return v.list + default: + return nil + } +} diff --git a/vendor/go.opentelemetry.io/otel/internal/gen.go b/vendor/go.opentelemetry.io/otel/internal/gen.go new file mode 100644 index 000000000..f532f07e9 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/gen.go @@ -0,0 +1,29 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package internal // import "go.opentelemetry.io/otel/internal" + +//go:generate gotmpl --body=./shared/matchers/expectation.go.tmpl "--data={}" --out=matchers/expectation.go +//go:generate gotmpl --body=./shared/matchers/expecter.go.tmpl "--data={}" --out=matchers/expecter.go +//go:generate gotmpl --body=./shared/matchers/temporal_matcher.go.tmpl "--data={}" --out=matchers/temporal_matcher.go + +//go:generate gotmpl --body=./shared/internaltest/alignment.go.tmpl "--data={}" --out=internaltest/alignment.go +//go:generate gotmpl --body=./shared/internaltest/env.go.tmpl "--data={}" --out=internaltest/env.go +//go:generate gotmpl --body=./shared/internaltest/env_test.go.tmpl "--data={}" --out=internaltest/env_test.go +//go:generate gotmpl --body=./shared/internaltest/errors.go.tmpl "--data={}" --out=internaltest/errors.go +//go:generate gotmpl --body=./shared/internaltest/harness.go.tmpl "--data={\"matchersImportPath\": \"go.opentelemetry.io/otel/internal/matchers\"}" --out=internaltest/harness.go +//go:generate gotmpl --body=./shared/internaltest/text_map_carrier.go.tmpl "--data={}" --out=internaltest/text_map_carrier.go +//go:generate gotmpl --body=./shared/internaltest/text_map_carrier_test.go.tmpl "--data={}" --out=internaltest/text_map_carrier_test.go +//go:generate gotmpl --body=./shared/internaltest/text_map_propagator.go.tmpl "--data={}" --out=internaltest/text_map_propagator.go +//go:generate gotmpl --body=./shared/internaltest/text_map_propagator_test.go.tmpl "--data={}" --out=internaltest/text_map_propagator_test.go diff --git a/vendor/go.opentelemetry.io/otel/internal/global/handler.go b/vendor/go.opentelemetry.io/otel/internal/global/handler.go new file mode 100644 index 000000000..5e9b83047 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/global/handler.go @@ -0,0 +1,102 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package global // import "go.opentelemetry.io/otel/internal/global" + +import ( + "log" + "os" + "sync/atomic" +) + +var ( + // GlobalErrorHandler provides an ErrorHandler that can be used + // throughout an OpenTelemetry instrumented project. When a user + // specified ErrorHandler is registered (`SetErrorHandler`) all calls to + // `Handle` and will be delegated to the registered ErrorHandler. + GlobalErrorHandler = defaultErrorHandler() + + // Compile-time check that delegator implements ErrorHandler. + _ ErrorHandler = (*ErrDelegator)(nil) + // Compile-time check that errLogger implements ErrorHandler. + _ ErrorHandler = (*ErrLogger)(nil) +) + +// ErrorHandler handles irremediable events. +type ErrorHandler interface { + // Handle handles any error deemed irremediable by an OpenTelemetry + // component. + Handle(error) +} + +type ErrDelegator struct { + delegate atomic.Pointer[ErrorHandler] +} + +func (d *ErrDelegator) Handle(err error) { + d.getDelegate().Handle(err) +} + +func (d *ErrDelegator) getDelegate() ErrorHandler { + return *d.delegate.Load() +} + +// setDelegate sets the ErrorHandler delegate. +func (d *ErrDelegator) setDelegate(eh ErrorHandler) { + d.delegate.Store(&eh) +} + +func defaultErrorHandler() *ErrDelegator { + d := &ErrDelegator{} + d.setDelegate(&ErrLogger{l: log.New(os.Stderr, "", log.LstdFlags)}) + return d +} + +// ErrLogger logs errors if no delegate is set, otherwise they are delegated. +type ErrLogger struct { + l *log.Logger +} + +// Handle logs err if no delegate is set, otherwise it is delegated. +func (h *ErrLogger) Handle(err error) { + h.l.Print(err) +} + +// GetErrorHandler returns the global ErrorHandler instance. +// +// The default ErrorHandler instance returned will log all errors to STDERR +// until an override ErrorHandler is set with SetErrorHandler. All +// ErrorHandler returned prior to this will automatically forward errors to +// the set instance instead of logging. +// +// Subsequent calls to SetErrorHandler after the first will not forward errors +// to the new ErrorHandler for prior returned instances. +func GetErrorHandler() ErrorHandler { + return GlobalErrorHandler +} + +// SetErrorHandler sets the global ErrorHandler to h. +// +// The first time this is called all ErrorHandler previously returned from +// GetErrorHandler will send errors to h instead of the default logging +// ErrorHandler. Subsequent calls will set the global ErrorHandler, but not +// delegate errors to h. +func SetErrorHandler(h ErrorHandler) { + GlobalErrorHandler.setDelegate(h) +} + +// Handle is a convenience function for ErrorHandler().Handle(err). +func Handle(err error) { + GetErrorHandler().Handle(err) +} diff --git a/vendor/go.opentelemetry.io/otel/internal/global/instruments.go b/vendor/go.opentelemetry.io/otel/internal/global/instruments.go new file mode 100644 index 000000000..ebb13c206 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/global/instruments.go @@ -0,0 +1,371 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package global // import "go.opentelemetry.io/otel/internal/global" + +import ( + "context" + "sync/atomic" + + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/metric/embedded" +) + +// unwrapper unwraps to return the underlying instrument implementation. +type unwrapper interface { + Unwrap() metric.Observable +} + +type afCounter struct { + embedded.Float64ObservableCounter + metric.Float64Observable + + name string + opts []metric.Float64ObservableCounterOption + + delegate atomic.Value // metric.Float64ObservableCounter +} + +var ( + _ unwrapper = (*afCounter)(nil) + _ metric.Float64ObservableCounter = (*afCounter)(nil) +) + +func (i *afCounter) setDelegate(m metric.Meter) { + ctr, err := m.Float64ObservableCounter(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *afCounter) Unwrap() metric.Observable { + if ctr := i.delegate.Load(); ctr != nil { + return ctr.(metric.Float64ObservableCounter) + } + return nil +} + +type afUpDownCounter struct { + embedded.Float64ObservableUpDownCounter + metric.Float64Observable + + name string + opts []metric.Float64ObservableUpDownCounterOption + + delegate atomic.Value // metric.Float64ObservableUpDownCounter +} + +var ( + _ unwrapper = (*afUpDownCounter)(nil) + _ metric.Float64ObservableUpDownCounter = (*afUpDownCounter)(nil) +) + +func (i *afUpDownCounter) setDelegate(m metric.Meter) { + ctr, err := m.Float64ObservableUpDownCounter(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *afUpDownCounter) Unwrap() metric.Observable { + if ctr := i.delegate.Load(); ctr != nil { + return ctr.(metric.Float64ObservableUpDownCounter) + } + return nil +} + +type afGauge struct { + embedded.Float64ObservableGauge + metric.Float64Observable + + name string + opts []metric.Float64ObservableGaugeOption + + delegate atomic.Value // metric.Float64ObservableGauge +} + +var ( + _ unwrapper = (*afGauge)(nil) + _ metric.Float64ObservableGauge = (*afGauge)(nil) +) + +func (i *afGauge) setDelegate(m metric.Meter) { + ctr, err := m.Float64ObservableGauge(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *afGauge) Unwrap() metric.Observable { + if ctr := i.delegate.Load(); ctr != nil { + return ctr.(metric.Float64ObservableGauge) + } + return nil +} + +type aiCounter struct { + embedded.Int64ObservableCounter + metric.Int64Observable + + name string + opts []metric.Int64ObservableCounterOption + + delegate atomic.Value // metric.Int64ObservableCounter +} + +var ( + _ unwrapper = (*aiCounter)(nil) + _ metric.Int64ObservableCounter = (*aiCounter)(nil) +) + +func (i *aiCounter) setDelegate(m metric.Meter) { + ctr, err := m.Int64ObservableCounter(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *aiCounter) Unwrap() metric.Observable { + if ctr := i.delegate.Load(); ctr != nil { + return ctr.(metric.Int64ObservableCounter) + } + return nil +} + +type aiUpDownCounter struct { + embedded.Int64ObservableUpDownCounter + metric.Int64Observable + + name string + opts []metric.Int64ObservableUpDownCounterOption + + delegate atomic.Value // metric.Int64ObservableUpDownCounter +} + +var ( + _ unwrapper = (*aiUpDownCounter)(nil) + _ metric.Int64ObservableUpDownCounter = (*aiUpDownCounter)(nil) +) + +func (i *aiUpDownCounter) setDelegate(m metric.Meter) { + ctr, err := m.Int64ObservableUpDownCounter(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *aiUpDownCounter) Unwrap() metric.Observable { + if ctr := i.delegate.Load(); ctr != nil { + return ctr.(metric.Int64ObservableUpDownCounter) + } + return nil +} + +type aiGauge struct { + embedded.Int64ObservableGauge + metric.Int64Observable + + name string + opts []metric.Int64ObservableGaugeOption + + delegate atomic.Value // metric.Int64ObservableGauge +} + +var ( + _ unwrapper = (*aiGauge)(nil) + _ metric.Int64ObservableGauge = (*aiGauge)(nil) +) + +func (i *aiGauge) setDelegate(m metric.Meter) { + ctr, err := m.Int64ObservableGauge(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *aiGauge) Unwrap() metric.Observable { + if ctr := i.delegate.Load(); ctr != nil { + return ctr.(metric.Int64ObservableGauge) + } + return nil +} + +// Sync Instruments. +type sfCounter struct { + embedded.Float64Counter + + name string + opts []metric.Float64CounterOption + + delegate atomic.Value // metric.Float64Counter +} + +var _ metric.Float64Counter = (*sfCounter)(nil) + +func (i *sfCounter) setDelegate(m metric.Meter) { + ctr, err := m.Float64Counter(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *sfCounter) Add(ctx context.Context, incr float64, opts ...metric.AddOption) { + if ctr := i.delegate.Load(); ctr != nil { + ctr.(metric.Float64Counter).Add(ctx, incr, opts...) + } +} + +type sfUpDownCounter struct { + embedded.Float64UpDownCounter + + name string + opts []metric.Float64UpDownCounterOption + + delegate atomic.Value // metric.Float64UpDownCounter +} + +var _ metric.Float64UpDownCounter = (*sfUpDownCounter)(nil) + +func (i *sfUpDownCounter) setDelegate(m metric.Meter) { + ctr, err := m.Float64UpDownCounter(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *sfUpDownCounter) Add(ctx context.Context, incr float64, opts ...metric.AddOption) { + if ctr := i.delegate.Load(); ctr != nil { + ctr.(metric.Float64UpDownCounter).Add(ctx, incr, opts...) + } +} + +type sfHistogram struct { + embedded.Float64Histogram + + name string + opts []metric.Float64HistogramOption + + delegate atomic.Value // metric.Float64Histogram +} + +var _ metric.Float64Histogram = (*sfHistogram)(nil) + +func (i *sfHistogram) setDelegate(m metric.Meter) { + ctr, err := m.Float64Histogram(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *sfHistogram) Record(ctx context.Context, x float64, opts ...metric.RecordOption) { + if ctr := i.delegate.Load(); ctr != nil { + ctr.(metric.Float64Histogram).Record(ctx, x, opts...) + } +} + +type siCounter struct { + embedded.Int64Counter + + name string + opts []metric.Int64CounterOption + + delegate atomic.Value // metric.Int64Counter +} + +var _ metric.Int64Counter = (*siCounter)(nil) + +func (i *siCounter) setDelegate(m metric.Meter) { + ctr, err := m.Int64Counter(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *siCounter) Add(ctx context.Context, x int64, opts ...metric.AddOption) { + if ctr := i.delegate.Load(); ctr != nil { + ctr.(metric.Int64Counter).Add(ctx, x, opts...) + } +} + +type siUpDownCounter struct { + embedded.Int64UpDownCounter + + name string + opts []metric.Int64UpDownCounterOption + + delegate atomic.Value // metric.Int64UpDownCounter +} + +var _ metric.Int64UpDownCounter = (*siUpDownCounter)(nil) + +func (i *siUpDownCounter) setDelegate(m metric.Meter) { + ctr, err := m.Int64UpDownCounter(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *siUpDownCounter) Add(ctx context.Context, x int64, opts ...metric.AddOption) { + if ctr := i.delegate.Load(); ctr != nil { + ctr.(metric.Int64UpDownCounter).Add(ctx, x, opts...) + } +} + +type siHistogram struct { + embedded.Int64Histogram + + name string + opts []metric.Int64HistogramOption + + delegate atomic.Value // metric.Int64Histogram +} + +var _ metric.Int64Histogram = (*siHistogram)(nil) + +func (i *siHistogram) setDelegate(m metric.Meter) { + ctr, err := m.Int64Histogram(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *siHistogram) Record(ctx context.Context, x int64, opts ...metric.RecordOption) { + if ctr := i.delegate.Load(); ctr != nil { + ctr.(metric.Int64Histogram).Record(ctx, x, opts...) + } +} diff --git a/vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go b/vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go new file mode 100644 index 000000000..c6f305a2b --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go @@ -0,0 +1,69 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package global // import "go.opentelemetry.io/otel/internal/global" + +import ( + "log" + "os" + "sync/atomic" + + "github.com/go-logr/logr" + "github.com/go-logr/stdr" +) + +// globalLogger is the logging interface used within the otel api and sdk provide details of the internals. +// +// The default logger uses stdr which is backed by the standard `log.Logger` +// interface. This logger will only show messages at the Error Level. +var globalLogger atomic.Pointer[logr.Logger] + +func init() { + SetLogger(stdr.New(log.New(os.Stderr, "", log.LstdFlags|log.Lshortfile))) +} + +// SetLogger overrides the globalLogger with l. +// +// To see Warn messages use a logger with `l.V(1).Enabled() == true` +// To see Info messages use a logger with `l.V(4).Enabled() == true` +// To see Debug messages use a logger with `l.V(8).Enabled() == true`. +func SetLogger(l logr.Logger) { + globalLogger.Store(&l) +} + +func getLogger() logr.Logger { + return *globalLogger.Load() +} + +// Info prints messages about the general state of the API or SDK. +// This should usually be less than 5 messages a minute. +func Info(msg string, keysAndValues ...interface{}) { + getLogger().V(4).Info(msg, keysAndValues...) +} + +// Error prints messages about exceptional states of the API or SDK. +func Error(err error, msg string, keysAndValues ...interface{}) { + getLogger().Error(err, msg, keysAndValues...) +} + +// Debug prints messages about all internal changes in the API or SDK. +func Debug(msg string, keysAndValues ...interface{}) { + getLogger().V(8).Info(msg, keysAndValues...) +} + +// Warn prints messages about warnings in the API or SDK. +// Not an error but is likely more important than an informational event. +func Warn(msg string, keysAndValues ...interface{}) { + getLogger().V(1).Info(msg, keysAndValues...) +} diff --git a/vendor/go.opentelemetry.io/otel/internal/global/meter.go b/vendor/go.opentelemetry.io/otel/internal/global/meter.go new file mode 100644 index 000000000..0097db478 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/global/meter.go @@ -0,0 +1,354 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package global // import "go.opentelemetry.io/otel/internal/global" + +import ( + "container/list" + "sync" + "sync/atomic" + + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/metric/embedded" +) + +// meterProvider is a placeholder for a configured SDK MeterProvider. +// +// All MeterProvider functionality is forwarded to a delegate once +// configured. +type meterProvider struct { + embedded.MeterProvider + + mtx sync.Mutex + meters map[il]*meter + + delegate metric.MeterProvider +} + +// setDelegate configures p to delegate all MeterProvider functionality to +// provider. +// +// All Meters provided prior to this function call are switched out to be +// Meters provided by provider. All instruments and callbacks are recreated and +// delegated. +// +// It is guaranteed by the caller that this happens only once. +func (p *meterProvider) setDelegate(provider metric.MeterProvider) { + p.mtx.Lock() + defer p.mtx.Unlock() + + p.delegate = provider + + if len(p.meters) == 0 { + return + } + + for _, meter := range p.meters { + meter.setDelegate(provider) + } + + p.meters = nil +} + +// Meter implements MeterProvider. +func (p *meterProvider) Meter(name string, opts ...metric.MeterOption) metric.Meter { + p.mtx.Lock() + defer p.mtx.Unlock() + + if p.delegate != nil { + return p.delegate.Meter(name, opts...) + } + + // At this moment it is guaranteed that no sdk is installed, save the meter in the meters map. + + c := metric.NewMeterConfig(opts...) + key := il{ + name: name, + version: c.InstrumentationVersion(), + } + + if p.meters == nil { + p.meters = make(map[il]*meter) + } + + if val, ok := p.meters[key]; ok { + return val + } + + t := &meter{name: name, opts: opts} + p.meters[key] = t + return t +} + +// meter is a placeholder for a metric.Meter. +// +// All Meter functionality is forwarded to a delegate once configured. +// Otherwise, all functionality is forwarded to a NoopMeter. +type meter struct { + embedded.Meter + + name string + opts []metric.MeterOption + + mtx sync.Mutex + instruments []delegatedInstrument + + registry list.List + + delegate atomic.Value // metric.Meter +} + +type delegatedInstrument interface { + setDelegate(metric.Meter) +} + +// setDelegate configures m to delegate all Meter functionality to Meters +// created by provider. +// +// All subsequent calls to the Meter methods will be passed to the delegate. +// +// It is guaranteed by the caller that this happens only once. +func (m *meter) setDelegate(provider metric.MeterProvider) { + meter := provider.Meter(m.name, m.opts...) + m.delegate.Store(meter) + + m.mtx.Lock() + defer m.mtx.Unlock() + + for _, inst := range m.instruments { + inst.setDelegate(meter) + } + + for e := m.registry.Front(); e != nil; e = e.Next() { + r := e.Value.(*registration) + r.setDelegate(meter) + m.registry.Remove(e) + } + + m.instruments = nil + m.registry.Init() +} + +func (m *meter) Int64Counter(name string, options ...metric.Int64CounterOption) (metric.Int64Counter, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Int64Counter(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &siCounter{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +func (m *meter) Int64UpDownCounter(name string, options ...metric.Int64UpDownCounterOption) (metric.Int64UpDownCounter, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Int64UpDownCounter(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &siUpDownCounter{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +func (m *meter) Int64Histogram(name string, options ...metric.Int64HistogramOption) (metric.Int64Histogram, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Int64Histogram(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &siHistogram{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +func (m *meter) Int64ObservableCounter(name string, options ...metric.Int64ObservableCounterOption) (metric.Int64ObservableCounter, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Int64ObservableCounter(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &aiCounter{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +func (m *meter) Int64ObservableUpDownCounter(name string, options ...metric.Int64ObservableUpDownCounterOption) (metric.Int64ObservableUpDownCounter, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Int64ObservableUpDownCounter(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &aiUpDownCounter{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +func (m *meter) Int64ObservableGauge(name string, options ...metric.Int64ObservableGaugeOption) (metric.Int64ObservableGauge, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Int64ObservableGauge(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &aiGauge{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +func (m *meter) Float64Counter(name string, options ...metric.Float64CounterOption) (metric.Float64Counter, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Float64Counter(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &sfCounter{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +func (m *meter) Float64UpDownCounter(name string, options ...metric.Float64UpDownCounterOption) (metric.Float64UpDownCounter, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Float64UpDownCounter(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &sfUpDownCounter{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +func (m *meter) Float64Histogram(name string, options ...metric.Float64HistogramOption) (metric.Float64Histogram, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Float64Histogram(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &sfHistogram{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +func (m *meter) Float64ObservableCounter(name string, options ...metric.Float64ObservableCounterOption) (metric.Float64ObservableCounter, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Float64ObservableCounter(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &afCounter{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +func (m *meter) Float64ObservableUpDownCounter(name string, options ...metric.Float64ObservableUpDownCounterOption) (metric.Float64ObservableUpDownCounter, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Float64ObservableUpDownCounter(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &afUpDownCounter{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +func (m *meter) Float64ObservableGauge(name string, options ...metric.Float64ObservableGaugeOption) (metric.Float64ObservableGauge, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Float64ObservableGauge(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &afGauge{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +// RegisterCallback captures the function that will be called during Collect. +func (m *meter) RegisterCallback(f metric.Callback, insts ...metric.Observable) (metric.Registration, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + insts = unwrapInstruments(insts) + return del.RegisterCallback(f, insts...) + } + + m.mtx.Lock() + defer m.mtx.Unlock() + + reg := ®istration{instruments: insts, function: f} + e := m.registry.PushBack(reg) + reg.unreg = func() error { + m.mtx.Lock() + _ = m.registry.Remove(e) + m.mtx.Unlock() + return nil + } + return reg, nil +} + +type wrapped interface { + unwrap() metric.Observable +} + +func unwrapInstruments(instruments []metric.Observable) []metric.Observable { + out := make([]metric.Observable, 0, len(instruments)) + + for _, inst := range instruments { + if in, ok := inst.(wrapped); ok { + out = append(out, in.unwrap()) + } else { + out = append(out, inst) + } + } + + return out +} + +type registration struct { + embedded.Registration + + instruments []metric.Observable + function metric.Callback + + unreg func() error + unregMu sync.Mutex +} + +func (c *registration) setDelegate(m metric.Meter) { + insts := unwrapInstruments(c.instruments) + + c.unregMu.Lock() + defer c.unregMu.Unlock() + + if c.unreg == nil { + // Unregister already called. + return + } + + reg, err := m.RegisterCallback(c.function, insts...) + if err != nil { + GetErrorHandler().Handle(err) + } + + c.unreg = reg.Unregister +} + +func (c *registration) Unregister() error { + c.unregMu.Lock() + defer c.unregMu.Unlock() + if c.unreg == nil { + // Unregister already called. + return nil + } + + var err error + err, c.unreg = c.unreg(), nil + return err +} diff --git a/vendor/go.opentelemetry.io/otel/internal/global/propagator.go b/vendor/go.opentelemetry.io/otel/internal/global/propagator.go new file mode 100644 index 000000000..06bac35c2 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/global/propagator.go @@ -0,0 +1,82 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package global // import "go.opentelemetry.io/otel/internal/global" + +import ( + "context" + "sync" + + "go.opentelemetry.io/otel/propagation" +) + +// textMapPropagator is a default TextMapPropagator that delegates calls to a +// registered delegate if one is set, otherwise it defaults to delegating the +// calls to a the default no-op propagation.TextMapPropagator. +type textMapPropagator struct { + mtx sync.Mutex + once sync.Once + delegate propagation.TextMapPropagator + noop propagation.TextMapPropagator +} + +// Compile-time guarantee that textMapPropagator implements the +// propagation.TextMapPropagator interface. +var _ propagation.TextMapPropagator = (*textMapPropagator)(nil) + +func newTextMapPropagator() *textMapPropagator { + return &textMapPropagator{ + noop: propagation.NewCompositeTextMapPropagator(), + } +} + +// SetDelegate sets a delegate propagation.TextMapPropagator that all calls are +// forwarded to. Delegation can only be performed once, all subsequent calls +// perform no delegation. +func (p *textMapPropagator) SetDelegate(delegate propagation.TextMapPropagator) { + if delegate == nil { + return + } + + p.mtx.Lock() + p.once.Do(func() { p.delegate = delegate }) + p.mtx.Unlock() +} + +// effectiveDelegate returns the current delegate of p if one is set, +// otherwise the default noop TextMapPropagator is returned. This method +// can be called concurrently. +func (p *textMapPropagator) effectiveDelegate() propagation.TextMapPropagator { + p.mtx.Lock() + defer p.mtx.Unlock() + if p.delegate != nil { + return p.delegate + } + return p.noop +} + +// Inject set cross-cutting concerns from the Context into the carrier. +func (p *textMapPropagator) Inject(ctx context.Context, carrier propagation.TextMapCarrier) { + p.effectiveDelegate().Inject(ctx, carrier) +} + +// Extract reads cross-cutting concerns from the carrier into a Context. +func (p *textMapPropagator) Extract(ctx context.Context, carrier propagation.TextMapCarrier) context.Context { + return p.effectiveDelegate().Extract(ctx, carrier) +} + +// Fields returns the keys whose values are set with Inject. +func (p *textMapPropagator) Fields() []string { + return p.effectiveDelegate().Fields() +} diff --git a/vendor/go.opentelemetry.io/otel/internal/global/state.go b/vendor/go.opentelemetry.io/otel/internal/global/state.go new file mode 100644 index 000000000..7985005bc --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/global/state.go @@ -0,0 +1,156 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package global // import "go.opentelemetry.io/otel/internal/global" + +import ( + "errors" + "sync" + "sync/atomic" + + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/propagation" + "go.opentelemetry.io/otel/trace" +) + +type ( + tracerProviderHolder struct { + tp trace.TracerProvider + } + + propagatorsHolder struct { + tm propagation.TextMapPropagator + } + + meterProviderHolder struct { + mp metric.MeterProvider + } +) + +var ( + globalTracer = defaultTracerValue() + globalPropagators = defaultPropagatorsValue() + globalMeterProvider = defaultMeterProvider() + + delegateTraceOnce sync.Once + delegateTextMapPropagatorOnce sync.Once + delegateMeterOnce sync.Once +) + +// TracerProvider is the internal implementation for global.TracerProvider. +func TracerProvider() trace.TracerProvider { + return globalTracer.Load().(tracerProviderHolder).tp +} + +// SetTracerProvider is the internal implementation for global.SetTracerProvider. +func SetTracerProvider(tp trace.TracerProvider) { + current := TracerProvider() + + if _, cOk := current.(*tracerProvider); cOk { + if _, tpOk := tp.(*tracerProvider); tpOk && current == tp { + // Do not assign the default delegating TracerProvider to delegate + // to itself. + Error( + errors.New("no delegate configured in tracer provider"), + "Setting tracer provider to it's current value. No delegate will be configured", + ) + return + } + } + + delegateTraceOnce.Do(func() { + if def, ok := current.(*tracerProvider); ok { + def.setDelegate(tp) + } + }) + globalTracer.Store(tracerProviderHolder{tp: tp}) +} + +// TextMapPropagator is the internal implementation for global.TextMapPropagator. +func TextMapPropagator() propagation.TextMapPropagator { + return globalPropagators.Load().(propagatorsHolder).tm +} + +// SetTextMapPropagator is the internal implementation for global.SetTextMapPropagator. +func SetTextMapPropagator(p propagation.TextMapPropagator) { + current := TextMapPropagator() + + if _, cOk := current.(*textMapPropagator); cOk { + if _, pOk := p.(*textMapPropagator); pOk && current == p { + // Do not assign the default delegating TextMapPropagator to + // delegate to itself. + Error( + errors.New("no delegate configured in text map propagator"), + "Setting text map propagator to it's current value. No delegate will be configured", + ) + return + } + } + + // For the textMapPropagator already returned by TextMapPropagator + // delegate to p. + delegateTextMapPropagatorOnce.Do(func() { + if def, ok := current.(*textMapPropagator); ok { + def.SetDelegate(p) + } + }) + // Return p when subsequent calls to TextMapPropagator are made. + globalPropagators.Store(propagatorsHolder{tm: p}) +} + +// MeterProvider is the internal implementation for global.MeterProvider. +func MeterProvider() metric.MeterProvider { + return globalMeterProvider.Load().(meterProviderHolder).mp +} + +// SetMeterProvider is the internal implementation for global.SetMeterProvider. +func SetMeterProvider(mp metric.MeterProvider) { + current := MeterProvider() + if _, cOk := current.(*meterProvider); cOk { + if _, mpOk := mp.(*meterProvider); mpOk && current == mp { + // Do not assign the default delegating MeterProvider to delegate + // to itself. + Error( + errors.New("no delegate configured in meter provider"), + "Setting meter provider to it's current value. No delegate will be configured", + ) + return + } + } + + delegateMeterOnce.Do(func() { + if def, ok := current.(*meterProvider); ok { + def.setDelegate(mp) + } + }) + globalMeterProvider.Store(meterProviderHolder{mp: mp}) +} + +func defaultTracerValue() *atomic.Value { + v := &atomic.Value{} + v.Store(tracerProviderHolder{tp: &tracerProvider{}}) + return v +} + +func defaultPropagatorsValue() *atomic.Value { + v := &atomic.Value{} + v.Store(propagatorsHolder{tm: newTextMapPropagator()}) + return v +} + +func defaultMeterProvider() *atomic.Value { + v := &atomic.Value{} + v.Store(meterProviderHolder{mp: &meterProvider{}}) + return v +} diff --git a/vendor/go.opentelemetry.io/otel/internal/global/trace.go b/vendor/go.opentelemetry.io/otel/internal/global/trace.go new file mode 100644 index 000000000..3f61ec12a --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/global/trace.go @@ -0,0 +1,199 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package global // import "go.opentelemetry.io/otel/internal/global" + +/* +This file contains the forwarding implementation of the TracerProvider used as +the default global instance. Prior to initialization of an SDK, Tracers +returned by the global TracerProvider will provide no-op functionality. This +means that all Span created prior to initialization are no-op Spans. + +Once an SDK has been initialized, all provided no-op Tracers are swapped for +Tracers provided by the SDK defined TracerProvider. However, any Span started +prior to this initialization does not change its behavior. Meaning, the Span +remains a no-op Span. + +The implementation to track and swap Tracers locks all new Tracer creation +until the swap is complete. This assumes that this operation is not +performance-critical. If that assumption is incorrect, be sure to configure an +SDK prior to any Tracer creation. +*/ + +import ( + "context" + "sync" + "sync/atomic" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/codes" + "go.opentelemetry.io/otel/trace" + "go.opentelemetry.io/otel/trace/embedded" +) + +// tracerProvider is a placeholder for a configured SDK TracerProvider. +// +// All TracerProvider functionality is forwarded to a delegate once +// configured. +type tracerProvider struct { + embedded.TracerProvider + + mtx sync.Mutex + tracers map[il]*tracer + delegate trace.TracerProvider +} + +// Compile-time guarantee that tracerProvider implements the TracerProvider +// interface. +var _ trace.TracerProvider = &tracerProvider{} + +// setDelegate configures p to delegate all TracerProvider functionality to +// provider. +// +// All Tracers provided prior to this function call are switched out to be +// Tracers provided by provider. +// +// It is guaranteed by the caller that this happens only once. +func (p *tracerProvider) setDelegate(provider trace.TracerProvider) { + p.mtx.Lock() + defer p.mtx.Unlock() + + p.delegate = provider + + if len(p.tracers) == 0 { + return + } + + for _, t := range p.tracers { + t.setDelegate(provider) + } + + p.tracers = nil +} + +// Tracer implements TracerProvider. +func (p *tracerProvider) Tracer(name string, opts ...trace.TracerOption) trace.Tracer { + p.mtx.Lock() + defer p.mtx.Unlock() + + if p.delegate != nil { + return p.delegate.Tracer(name, opts...) + } + + // At this moment it is guaranteed that no sdk is installed, save the tracer in the tracers map. + + c := trace.NewTracerConfig(opts...) + key := il{ + name: name, + version: c.InstrumentationVersion(), + } + + if p.tracers == nil { + p.tracers = make(map[il]*tracer) + } + + if val, ok := p.tracers[key]; ok { + return val + } + + t := &tracer{name: name, opts: opts, provider: p} + p.tracers[key] = t + return t +} + +type il struct { + name string + version string +} + +// tracer is a placeholder for a trace.Tracer. +// +// All Tracer functionality is forwarded to a delegate once configured. +// Otherwise, all functionality is forwarded to a NoopTracer. +type tracer struct { + embedded.Tracer + + name string + opts []trace.TracerOption + provider *tracerProvider + + delegate atomic.Value +} + +// Compile-time guarantee that tracer implements the trace.Tracer interface. +var _ trace.Tracer = &tracer{} + +// setDelegate configures t to delegate all Tracer functionality to Tracers +// created by provider. +// +// All subsequent calls to the Tracer methods will be passed to the delegate. +// +// It is guaranteed by the caller that this happens only once. +func (t *tracer) setDelegate(provider trace.TracerProvider) { + t.delegate.Store(provider.Tracer(t.name, t.opts...)) +} + +// Start implements trace.Tracer by forwarding the call to t.delegate if +// set, otherwise it forwards the call to a NoopTracer. +func (t *tracer) Start(ctx context.Context, name string, opts ...trace.SpanStartOption) (context.Context, trace.Span) { + delegate := t.delegate.Load() + if delegate != nil { + return delegate.(trace.Tracer).Start(ctx, name, opts...) + } + + s := nonRecordingSpan{sc: trace.SpanContextFromContext(ctx), tracer: t} + ctx = trace.ContextWithSpan(ctx, s) + return ctx, s +} + +// nonRecordingSpan is a minimal implementation of a Span that wraps a +// SpanContext. It performs no operations other than to return the wrapped +// SpanContext. +type nonRecordingSpan struct { + embedded.Span + + sc trace.SpanContext + tracer *tracer +} + +var _ trace.Span = nonRecordingSpan{} + +// SpanContext returns the wrapped SpanContext. +func (s nonRecordingSpan) SpanContext() trace.SpanContext { return s.sc } + +// IsRecording always returns false. +func (nonRecordingSpan) IsRecording() bool { return false } + +// SetStatus does nothing. +func (nonRecordingSpan) SetStatus(codes.Code, string) {} + +// SetError does nothing. +func (nonRecordingSpan) SetError(bool) {} + +// SetAttributes does nothing. +func (nonRecordingSpan) SetAttributes(...attribute.KeyValue) {} + +// End does nothing. +func (nonRecordingSpan) End(...trace.SpanEndOption) {} + +// RecordError does nothing. +func (nonRecordingSpan) RecordError(error, ...trace.EventOption) {} + +// AddEvent does nothing. +func (nonRecordingSpan) AddEvent(string, ...trace.EventOption) {} + +// SetName does nothing. +func (nonRecordingSpan) SetName(string) {} + +func (s nonRecordingSpan) TracerProvider() trace.TracerProvider { return s.tracer.provider } diff --git a/vendor/go.opentelemetry.io/otel/internal/rawhelpers.go b/vendor/go.opentelemetry.io/otel/internal/rawhelpers.go new file mode 100644 index 000000000..e07e79400 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/rawhelpers.go @@ -0,0 +1,55 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package internal // import "go.opentelemetry.io/otel/internal" + +import ( + "math" + "unsafe" +) + +func BoolToRaw(b bool) uint64 { // nolint:revive // b is not a control flag. + if b { + return 1 + } + return 0 +} + +func RawToBool(r uint64) bool { + return r != 0 +} + +func Int64ToRaw(i int64) uint64 { + return uint64(i) +} + +func RawToInt64(r uint64) int64 { + return int64(r) +} + +func Float64ToRaw(f float64) uint64 { + return math.Float64bits(f) +} + +func RawToFloat64(r uint64) float64 { + return math.Float64frombits(r) +} + +func RawPtrToFloat64Ptr(r *uint64) *float64 { + return (*float64)(unsafe.Pointer(r)) +} + +func RawPtrToInt64Ptr(r *uint64) *int64 { + return (*int64)(unsafe.Pointer(r)) +} diff --git a/vendor/go.opentelemetry.io/otel/internal_logging.go b/vendor/go.opentelemetry.io/otel/internal_logging.go new file mode 100644 index 000000000..c4f8acd5d --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal_logging.go @@ -0,0 +1,26 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otel // import "go.opentelemetry.io/otel" + +import ( + "github.com/go-logr/logr" + + "go.opentelemetry.io/otel/internal/global" +) + +// SetLogger configures the logger used internally to opentelemetry. +func SetLogger(logger logr.Logger) { + global.SetLogger(logger) +} diff --git a/vendor/go.opentelemetry.io/otel/metric.go b/vendor/go.opentelemetry.io/otel/metric.go new file mode 100644 index 000000000..f95517195 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/metric.go @@ -0,0 +1,53 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otel // import "go.opentelemetry.io/otel" + +import ( + "go.opentelemetry.io/otel/internal/global" + "go.opentelemetry.io/otel/metric" +) + +// Meter returns a Meter from the global MeterProvider. The name must be the +// name of the library providing instrumentation. This name may be the same as +// the instrumented code only if that code provides built-in instrumentation. +// If the name is empty, then a implementation defined default name will be +// used instead. +// +// If this is called before a global MeterProvider is registered the returned +// Meter will be a No-op implementation of a Meter. When a global MeterProvider +// is registered for the first time, the returned Meter, and all the +// instruments it has created or will create, are recreated automatically from +// the new MeterProvider. +// +// This is short for GetMeterProvider().Meter(name). +func Meter(name string, opts ...metric.MeterOption) metric.Meter { + return GetMeterProvider().Meter(name, opts...) +} + +// GetMeterProvider returns the registered global meter provider. +// +// If no global GetMeterProvider has been registered, a No-op GetMeterProvider +// implementation is returned. When a global GetMeterProvider is registered for +// the first time, the returned GetMeterProvider, and all the Meters it has +// created or will create, are recreated automatically from the new +// GetMeterProvider. +func GetMeterProvider() metric.MeterProvider { + return global.MeterProvider() +} + +// SetMeterProvider registers mp as the global MeterProvider. +func SetMeterProvider(mp metric.MeterProvider) { + global.SetMeterProvider(mp) +} diff --git a/vendor/go.opentelemetry.io/otel/metric/LICENSE b/vendor/go.opentelemetry.io/otel/metric/LICENSE new file mode 100644 index 000000000..261eeb9e9 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/metric/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go b/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go new file mode 100644 index 000000000..072baa8e8 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go @@ -0,0 +1,271 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package metric // import "go.opentelemetry.io/otel/metric" + +import ( + "context" + + "go.opentelemetry.io/otel/metric/embedded" +) + +// Float64Observable describes a set of instruments used asynchronously to +// record float64 measurements once per collection cycle. Observations of +// these instruments are only made within a callback. +// +// Warning: Methods may be added to this interface in minor releases. +type Float64Observable interface { + Observable + + float64Observable() +} + +// Float64ObservableCounter is an instrument used to asynchronously record +// increasing float64 measurements once per collection cycle. Observations are +// only made within a callback for this instrument. The value observed is +// assumed the to be the cumulative sum of the count. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for +// unimplemented methods. +type Float64ObservableCounter interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Float64ObservableCounter + + Float64Observable +} + +// Float64ObservableCounterConfig contains options for asynchronous counter +// instruments that record int64 values. +type Float64ObservableCounterConfig struct { + description string + unit string + callbacks []Float64Callback +} + +// NewFloat64ObservableCounterConfig returns a new +// [Float64ObservableCounterConfig] with all opts applied. +func NewFloat64ObservableCounterConfig(opts ...Float64ObservableCounterOption) Float64ObservableCounterConfig { + var config Float64ObservableCounterConfig + for _, o := range opts { + config = o.applyFloat64ObservableCounter(config) + } + return config +} + +// Description returns the configured description. +func (c Float64ObservableCounterConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Float64ObservableCounterConfig) Unit() string { + return c.unit +} + +// Callbacks returns the configured callbacks. +func (c Float64ObservableCounterConfig) Callbacks() []Float64Callback { + return c.callbacks +} + +// Float64ObservableCounterOption applies options to a +// [Float64ObservableCounterConfig]. See [Float64ObservableOption] and +// [InstrumentOption] for other options that can be used as a +// Float64ObservableCounterOption. +type Float64ObservableCounterOption interface { + applyFloat64ObservableCounter(Float64ObservableCounterConfig) Float64ObservableCounterConfig +} + +// Float64ObservableUpDownCounter is an instrument used to asynchronously +// record float64 measurements once per collection cycle. Observations are only +// made within a callback for this instrument. The value observed is assumed +// the to be the cumulative sum of the count. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Float64ObservableUpDownCounter interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Float64ObservableUpDownCounter + + Float64Observable +} + +// Float64ObservableUpDownCounterConfig contains options for asynchronous +// counter instruments that record int64 values. +type Float64ObservableUpDownCounterConfig struct { + description string + unit string + callbacks []Float64Callback +} + +// NewFloat64ObservableUpDownCounterConfig returns a new +// [Float64ObservableUpDownCounterConfig] with all opts applied. +func NewFloat64ObservableUpDownCounterConfig(opts ...Float64ObservableUpDownCounterOption) Float64ObservableUpDownCounterConfig { + var config Float64ObservableUpDownCounterConfig + for _, o := range opts { + config = o.applyFloat64ObservableUpDownCounter(config) + } + return config +} + +// Description returns the configured description. +func (c Float64ObservableUpDownCounterConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Float64ObservableUpDownCounterConfig) Unit() string { + return c.unit +} + +// Callbacks returns the configured callbacks. +func (c Float64ObservableUpDownCounterConfig) Callbacks() []Float64Callback { + return c.callbacks +} + +// Float64ObservableUpDownCounterOption applies options to a +// [Float64ObservableUpDownCounterConfig]. See [Float64ObservableOption] and +// [InstrumentOption] for other options that can be used as a +// Float64ObservableUpDownCounterOption. +type Float64ObservableUpDownCounterOption interface { + applyFloat64ObservableUpDownCounter(Float64ObservableUpDownCounterConfig) Float64ObservableUpDownCounterConfig +} + +// Float64ObservableGauge is an instrument used to asynchronously record +// instantaneous float64 measurements once per collection cycle. Observations +// are only made within a callback for this instrument. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Float64ObservableGauge interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Float64ObservableGauge + + Float64Observable +} + +// Float64ObservableGaugeConfig contains options for asynchronous counter +// instruments that record int64 values. +type Float64ObservableGaugeConfig struct { + description string + unit string + callbacks []Float64Callback +} + +// NewFloat64ObservableGaugeConfig returns a new [Float64ObservableGaugeConfig] +// with all opts applied. +func NewFloat64ObservableGaugeConfig(opts ...Float64ObservableGaugeOption) Float64ObservableGaugeConfig { + var config Float64ObservableGaugeConfig + for _, o := range opts { + config = o.applyFloat64ObservableGauge(config) + } + return config +} + +// Description returns the configured description. +func (c Float64ObservableGaugeConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Float64ObservableGaugeConfig) Unit() string { + return c.unit +} + +// Callbacks returns the configured callbacks. +func (c Float64ObservableGaugeConfig) Callbacks() []Float64Callback { + return c.callbacks +} + +// Float64ObservableGaugeOption applies options to a +// [Float64ObservableGaugeConfig]. See [Float64ObservableOption] and +// [InstrumentOption] for other options that can be used as a +// Float64ObservableGaugeOption. +type Float64ObservableGaugeOption interface { + applyFloat64ObservableGauge(Float64ObservableGaugeConfig) Float64ObservableGaugeConfig +} + +// Float64Observer is a recorder of float64 measurements. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Float64Observer interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Float64Observer + + // Observe records the float64 value. + // + // Use the WithAttributeSet (or, if performance is not a concern, + // the WithAttributes) option to include measurement attributes. + Observe(value float64, options ...ObserveOption) +} + +// Float64Callback is a function registered with a Meter that makes +// observations for a Float64Observerable instrument it is registered with. +// Calls to the Float64Observer record measurement values for the +// Float64Observable. +// +// The function needs to complete in a finite amount of time and the deadline +// of the passed context is expected to be honored. +// +// The function needs to make unique observations across all registered +// Float64Callbacks. Meaning, it should not report measurements with the same +// attributes as another Float64Callbacks also registered for the same +// instrument. +// +// The function needs to be concurrent safe. +type Float64Callback func(context.Context, Float64Observer) error + +// Float64ObservableOption applies options to float64 Observer instruments. +type Float64ObservableOption interface { + Float64ObservableCounterOption + Float64ObservableUpDownCounterOption + Float64ObservableGaugeOption +} + +type float64CallbackOpt struct { + cback Float64Callback +} + +func (o float64CallbackOpt) applyFloat64ObservableCounter(cfg Float64ObservableCounterConfig) Float64ObservableCounterConfig { + cfg.callbacks = append(cfg.callbacks, o.cback) + return cfg +} + +func (o float64CallbackOpt) applyFloat64ObservableUpDownCounter(cfg Float64ObservableUpDownCounterConfig) Float64ObservableUpDownCounterConfig { + cfg.callbacks = append(cfg.callbacks, o.cback) + return cfg +} + +func (o float64CallbackOpt) applyFloat64ObservableGauge(cfg Float64ObservableGaugeConfig) Float64ObservableGaugeConfig { + cfg.callbacks = append(cfg.callbacks, o.cback) + return cfg +} + +// WithFloat64Callback adds callback to be called for an instrument. +func WithFloat64Callback(callback Float64Callback) Float64ObservableOption { + return float64CallbackOpt{callback} +} diff --git a/vendor/go.opentelemetry.io/otel/metric/asyncint64.go b/vendor/go.opentelemetry.io/otel/metric/asyncint64.go new file mode 100644 index 000000000..9bd6ebf02 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/metric/asyncint64.go @@ -0,0 +1,269 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package metric // import "go.opentelemetry.io/otel/metric" + +import ( + "context" + + "go.opentelemetry.io/otel/metric/embedded" +) + +// Int64Observable describes a set of instruments used asynchronously to record +// int64 measurements once per collection cycle. Observations of these +// instruments are only made within a callback. +// +// Warning: Methods may be added to this interface in minor releases. +type Int64Observable interface { + Observable + + int64Observable() +} + +// Int64ObservableCounter is an instrument used to asynchronously record +// increasing int64 measurements once per collection cycle. Observations are +// only made within a callback for this instrument. The value observed is +// assumed the to be the cumulative sum of the count. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Int64ObservableCounter interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Int64ObservableCounter + + Int64Observable +} + +// Int64ObservableCounterConfig contains options for asynchronous counter +// instruments that record int64 values. +type Int64ObservableCounterConfig struct { + description string + unit string + callbacks []Int64Callback +} + +// NewInt64ObservableCounterConfig returns a new [Int64ObservableCounterConfig] +// with all opts applied. +func NewInt64ObservableCounterConfig(opts ...Int64ObservableCounterOption) Int64ObservableCounterConfig { + var config Int64ObservableCounterConfig + for _, o := range opts { + config = o.applyInt64ObservableCounter(config) + } + return config +} + +// Description returns the configured description. +func (c Int64ObservableCounterConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Int64ObservableCounterConfig) Unit() string { + return c.unit +} + +// Callbacks returns the configured callbacks. +func (c Int64ObservableCounterConfig) Callbacks() []Int64Callback { + return c.callbacks +} + +// Int64ObservableCounterOption applies options to a +// [Int64ObservableCounterConfig]. See [Int64ObservableOption] and +// [InstrumentOption] for other options that can be used as an +// Int64ObservableCounterOption. +type Int64ObservableCounterOption interface { + applyInt64ObservableCounter(Int64ObservableCounterConfig) Int64ObservableCounterConfig +} + +// Int64ObservableUpDownCounter is an instrument used to asynchronously record +// int64 measurements once per collection cycle. Observations are only made +// within a callback for this instrument. The value observed is assumed the to +// be the cumulative sum of the count. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Int64ObservableUpDownCounter interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Int64ObservableUpDownCounter + + Int64Observable +} + +// Int64ObservableUpDownCounterConfig contains options for asynchronous counter +// instruments that record int64 values. +type Int64ObservableUpDownCounterConfig struct { + description string + unit string + callbacks []Int64Callback +} + +// NewInt64ObservableUpDownCounterConfig returns a new +// [Int64ObservableUpDownCounterConfig] with all opts applied. +func NewInt64ObservableUpDownCounterConfig(opts ...Int64ObservableUpDownCounterOption) Int64ObservableUpDownCounterConfig { + var config Int64ObservableUpDownCounterConfig + for _, o := range opts { + config = o.applyInt64ObservableUpDownCounter(config) + } + return config +} + +// Description returns the configured description. +func (c Int64ObservableUpDownCounterConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Int64ObservableUpDownCounterConfig) Unit() string { + return c.unit +} + +// Callbacks returns the configured callbacks. +func (c Int64ObservableUpDownCounterConfig) Callbacks() []Int64Callback { + return c.callbacks +} + +// Int64ObservableUpDownCounterOption applies options to a +// [Int64ObservableUpDownCounterConfig]. See [Int64ObservableOption] and +// [InstrumentOption] for other options that can be used as an +// Int64ObservableUpDownCounterOption. +type Int64ObservableUpDownCounterOption interface { + applyInt64ObservableUpDownCounter(Int64ObservableUpDownCounterConfig) Int64ObservableUpDownCounterConfig +} + +// Int64ObservableGauge is an instrument used to asynchronously record +// instantaneous int64 measurements once per collection cycle. Observations are +// only made within a callback for this instrument. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Int64ObservableGauge interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Int64ObservableGauge + + Int64Observable +} + +// Int64ObservableGaugeConfig contains options for asynchronous counter +// instruments that record int64 values. +type Int64ObservableGaugeConfig struct { + description string + unit string + callbacks []Int64Callback +} + +// NewInt64ObservableGaugeConfig returns a new [Int64ObservableGaugeConfig] +// with all opts applied. +func NewInt64ObservableGaugeConfig(opts ...Int64ObservableGaugeOption) Int64ObservableGaugeConfig { + var config Int64ObservableGaugeConfig + for _, o := range opts { + config = o.applyInt64ObservableGauge(config) + } + return config +} + +// Description returns the configured description. +func (c Int64ObservableGaugeConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Int64ObservableGaugeConfig) Unit() string { + return c.unit +} + +// Callbacks returns the configured callbacks. +func (c Int64ObservableGaugeConfig) Callbacks() []Int64Callback { + return c.callbacks +} + +// Int64ObservableGaugeOption applies options to a +// [Int64ObservableGaugeConfig]. See [Int64ObservableOption] and +// [InstrumentOption] for other options that can be used as an +// Int64ObservableGaugeOption. +type Int64ObservableGaugeOption interface { + applyInt64ObservableGauge(Int64ObservableGaugeConfig) Int64ObservableGaugeConfig +} + +// Int64Observer is a recorder of int64 measurements. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Int64Observer interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Int64Observer + + // Observe records the int64 value. + // + // Use the WithAttributeSet (or, if performance is not a concern, + // the WithAttributes) option to include measurement attributes. + Observe(value int64, options ...ObserveOption) +} + +// Int64Callback is a function registered with a Meter that makes observations +// for an Int64Observerable instrument it is registered with. Calls to the +// Int64Observer record measurement values for the Int64Observable. +// +// The function needs to complete in a finite amount of time and the deadline +// of the passed context is expected to be honored. +// +// The function needs to make unique observations across all registered +// Int64Callbacks. Meaning, it should not report measurements with the same +// attributes as another Int64Callbacks also registered for the same +// instrument. +// +// The function needs to be concurrent safe. +type Int64Callback func(context.Context, Int64Observer) error + +// Int64ObservableOption applies options to int64 Observer instruments. +type Int64ObservableOption interface { + Int64ObservableCounterOption + Int64ObservableUpDownCounterOption + Int64ObservableGaugeOption +} + +type int64CallbackOpt struct { + cback Int64Callback +} + +func (o int64CallbackOpt) applyInt64ObservableCounter(cfg Int64ObservableCounterConfig) Int64ObservableCounterConfig { + cfg.callbacks = append(cfg.callbacks, o.cback) + return cfg +} + +func (o int64CallbackOpt) applyInt64ObservableUpDownCounter(cfg Int64ObservableUpDownCounterConfig) Int64ObservableUpDownCounterConfig { + cfg.callbacks = append(cfg.callbacks, o.cback) + return cfg +} + +func (o int64CallbackOpt) applyInt64ObservableGauge(cfg Int64ObservableGaugeConfig) Int64ObservableGaugeConfig { + cfg.callbacks = append(cfg.callbacks, o.cback) + return cfg +} + +// WithInt64Callback adds callback to be called for an instrument. +func WithInt64Callback(callback Int64Callback) Int64ObservableOption { + return int64CallbackOpt{callback} +} diff --git a/vendor/go.opentelemetry.io/otel/metric/config.go b/vendor/go.opentelemetry.io/otel/metric/config.go new file mode 100644 index 000000000..778ad2d74 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/metric/config.go @@ -0,0 +1,92 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package metric // import "go.opentelemetry.io/otel/metric" + +import "go.opentelemetry.io/otel/attribute" + +// MeterConfig contains options for Meters. +type MeterConfig struct { + instrumentationVersion string + schemaURL string + attrs attribute.Set + + // Ensure forward compatibility by explicitly making this not comparable. + noCmp [0]func() //nolint: unused // This is indeed used. +} + +// InstrumentationVersion returns the version of the library providing +// instrumentation. +func (cfg MeterConfig) InstrumentationVersion() string { + return cfg.instrumentationVersion +} + +// InstrumentationAttributes returns the attributes associated with the library +// providing instrumentation. +func (cfg MeterConfig) InstrumentationAttributes() attribute.Set { + return cfg.attrs +} + +// SchemaURL is the schema_url of the library providing instrumentation. +func (cfg MeterConfig) SchemaURL() string { + return cfg.schemaURL +} + +// MeterOption is an interface for applying Meter options. +type MeterOption interface { + // applyMeter is used to set a MeterOption value of a MeterConfig. + applyMeter(MeterConfig) MeterConfig +} + +// NewMeterConfig creates a new MeterConfig and applies +// all the given options. +func NewMeterConfig(opts ...MeterOption) MeterConfig { + var config MeterConfig + for _, o := range opts { + config = o.applyMeter(config) + } + return config +} + +type meterOptionFunc func(MeterConfig) MeterConfig + +func (fn meterOptionFunc) applyMeter(cfg MeterConfig) MeterConfig { + return fn(cfg) +} + +// WithInstrumentationVersion sets the instrumentation version. +func WithInstrumentationVersion(version string) MeterOption { + return meterOptionFunc(func(config MeterConfig) MeterConfig { + config.instrumentationVersion = version + return config + }) +} + +// WithInstrumentationAttributes sets the instrumentation attributes. +// +// The passed attributes will be de-duplicated. +func WithInstrumentationAttributes(attr ...attribute.KeyValue) MeterOption { + return meterOptionFunc(func(config MeterConfig) MeterConfig { + config.attrs = attribute.NewSet(attr...) + return config + }) +} + +// WithSchemaURL sets the schema URL. +func WithSchemaURL(schemaURL string) MeterOption { + return meterOptionFunc(func(config MeterConfig) MeterConfig { + config.schemaURL = schemaURL + return config + }) +} diff --git a/vendor/go.opentelemetry.io/otel/metric/doc.go b/vendor/go.opentelemetry.io/otel/metric/doc.go new file mode 100644 index 000000000..54716e13b --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/metric/doc.go @@ -0,0 +1,170 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* +Package metric provides the OpenTelemetry API used to measure metrics about +source code operation. + +This API is separate from its implementation so the instrumentation built from +it is reusable. See [go.opentelemetry.io/otel/sdk/metric] for the official +OpenTelemetry implementation of this API. + +All measurements made with this package are made via instruments. These +instruments are created by a [Meter] which itself is created by a +[MeterProvider]. Applications need to accept a [MeterProvider] implementation +as a starting point when instrumenting. This can be done directly, or by using +the OpenTelemetry global MeterProvider via [GetMeterProvider]. Using an +appropriately named [Meter] from the accepted [MeterProvider], instrumentation +can then be built from the [Meter]'s instruments. + +# Instruments + +Each instrument is designed to make measurements of a particular type. Broadly, +all instruments fall into two overlapping logical categories: asynchronous or +synchronous, and int64 or float64. + +All synchronous instruments ([Int64Counter], [Int64UpDownCounter], +[Int64Histogram], [Float64Counter], [Float64UpDownCounter], and +[Float64Histogram]) are used to measure the operation and performance of source +code during the source code execution. These instruments only make measurements +when the source code they instrument is run. + +All asynchronous instruments ([Int64ObservableCounter], +[Int64ObservableUpDownCounter], [Int64ObservableGauge], +[Float64ObservableCounter], [Float64ObservableUpDownCounter], and +[Float64ObservableGauge]) are used to measure metrics outside of the execution +of source code. They are said to make "observations" via a callback function +called once every measurement collection cycle. + +Each instrument is also grouped by the value type it measures. Either int64 or +float64. The value being measured will dictate which instrument in these +categories to use. + +Outside of these two broad categories, instruments are described by the +function they are designed to serve. All Counters ([Int64Counter], +[Float64Counter], [Int64ObservableCounter], and [Float64ObservableCounter]) are +designed to measure values that never decrease in value, but instead only +incrementally increase in value. UpDownCounters ([Int64UpDownCounter], +[Float64UpDownCounter], [Int64ObservableUpDownCounter], and +[Float64ObservableUpDownCounter]) on the other hand, are designed to measure +values that can increase and decrease. When more information needs to be +conveyed about all the synchronous measurements made during a collection cycle, +a Histogram ([Int64Histogram] and [Float64Histogram]) should be used. Finally, +when just the most recent measurement needs to be conveyed about an +asynchronous measurement, a Gauge ([Int64ObservableGauge] and +[Float64ObservableGauge]) should be used. + +See the [OpenTelemetry documentation] for more information about instruments +and their intended use. + +# Measurements + +Measurements are made by recording values and information about the values with +an instrument. How these measurements are recorded depends on the instrument. + +Measurements for synchronous instruments ([Int64Counter], [Int64UpDownCounter], +[Int64Histogram], [Float64Counter], [Float64UpDownCounter], and +[Float64Histogram]) are recorded using the instrument methods directly. All +counter instruments have an Add method that is used to measure an increment +value, and all histogram instruments have a Record method to measure a data +point. + +Asynchronous instruments ([Int64ObservableCounter], +[Int64ObservableUpDownCounter], [Int64ObservableGauge], +[Float64ObservableCounter], [Float64ObservableUpDownCounter], and +[Float64ObservableGauge]) record measurements within a callback function. The +callback is registered with the Meter which ensures the callback is called once +per collection cycle. A callback can be registered two ways: during the +instrument's creation using an option, or later using the RegisterCallback +method of the [Meter] that created the instrument. + +If the following criteria are met, an option ([WithInt64Callback] or +[WithFloat64Callback]) can be used during the asynchronous instrument's +creation to register a callback ([Int64Callback] or [Float64Callback], +respectively): + + - The measurement process is known when the instrument is created + - Only that instrument will make a measurement within the callback + - The callback never needs to be unregistered + +If the criteria are not met, use the RegisterCallback method of the [Meter] that +created the instrument to register a [Callback]. + +# API Implementations + +This package does not conform to the standard Go versioning policy, all of its +interfaces may have methods added to them without a package major version bump. +This non-standard API evolution could surprise an uninformed implementation +author. They could unknowingly build their implementation in a way that would +result in a runtime panic for their users that update to the new API. + +The API is designed to help inform an instrumentation author about this +non-standard API evolution. It requires them to choose a default behavior for +unimplemented interface methods. There are three behavior choices they can +make: + + - Compilation failure + - Panic + - Default to another implementation + +All interfaces in this API embed a corresponding interface from +[go.opentelemetry.io/otel/metric/embedded]. If an author wants the default +behavior of their implementations to be a compilation failure, signaling to +their users they need to update to the latest version of that implementation, +they need to embed the corresponding interface from +[go.opentelemetry.io/otel/metric/embedded] in their implementation. For +example, + + import "go.opentelemetry.io/otel/metric/embedded" + + type MeterProvider struct { + embedded.MeterProvider + // ... + } + +If an author wants the default behavior of their implementations to a panic, +they need to embed the API interface directly. + + import "go.opentelemetry.io/otel/metric" + + type MeterProvider struct { + metric.MeterProvider + // ... + } + +This is not a recommended behavior as it could lead to publishing packages that +contain runtime panics when users update other package that use newer versions +of [go.opentelemetry.io/otel/metric]. + +Finally, an author can embed another implementation in theirs. The embedded +implementation will be used for methods not defined by the author. For example, +an author who wants to default to silently dropping the call can use +[go.opentelemetry.io/otel/metric/noop]: + + import "go.opentelemetry.io/otel/metric/noop" + + type MeterProvider struct { + noop.MeterProvider + // ... + } + +It is strongly recommended that authors only embed +[go.opentelemetry.io/otel/metric/noop] if they choose this default behavior. +That implementation is the only one OpenTelemetry authors can guarantee will +fully implement all the API interfaces when a user updates their API. + +[OpenTelemetry documentation]: https://opentelemetry.io/docs/concepts/signals/metrics/ +[GetMeterProvider]: https://pkg.go.dev/go.opentelemetry.io/otel#GetMeterProvider +*/ +package metric // import "go.opentelemetry.io/otel/metric" diff --git a/vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go b/vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go new file mode 100644 index 000000000..ae0bdbd2e --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go @@ -0,0 +1,234 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package embedded provides interfaces embedded within the [OpenTelemetry +// metric API]. +// +// Implementers of the [OpenTelemetry metric API] can embed the relevant type +// from this package into their implementation directly. Doing so will result +// in a compilation error for users when the [OpenTelemetry metric API] is +// extended (which is something that can happen without a major version bump of +// the API package). +// +// [OpenTelemetry metric API]: https://pkg.go.dev/go.opentelemetry.io/otel/metric +package embedded // import "go.opentelemetry.io/otel/metric/embedded" + +// MeterProvider is embedded in +// [go.opentelemetry.io/otel/metric.MeterProvider]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.MeterProvider] if you want users to +// experience a compilation error, signaling they need to update to your latest +// implementation, when the [go.opentelemetry.io/otel/metric.MeterProvider] +// interface is extended (which is something that can happen without a major +// version bump of the API package). +type MeterProvider interface{ meterProvider() } + +// Meter is embedded in [go.opentelemetry.io/otel/metric.Meter]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Meter] if you want users to experience a +// compilation error, signaling they need to update to your latest +// implementation, when the [go.opentelemetry.io/otel/metric.Meter] interface +// is extended (which is something that can happen without a major version bump +// of the API package). +type Meter interface{ meter() } + +// Float64Observer is embedded in +// [go.opentelemetry.io/otel/metric.Float64Observer]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Float64Observer] if you want +// users to experience a compilation error, signaling they need to update to +// your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Float64Observer] interface is +// extended (which is something that can happen without a major version bump of +// the API package). +type Float64Observer interface{ float64Observer() } + +// Int64Observer is embedded in +// [go.opentelemetry.io/otel/metric.Int64Observer]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Int64Observer] if you want users +// to experience a compilation error, signaling they need to update to your +// latest implementation, when the +// [go.opentelemetry.io/otel/metric.Int64Observer] interface is +// extended (which is something that can happen without a major version bump of +// the API package). +type Int64Observer interface{ int64Observer() } + +// Observer is embedded in [go.opentelemetry.io/otel/metric.Observer]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Observer] if you want users to experience a +// compilation error, signaling they need to update to your latest +// implementation, when the [go.opentelemetry.io/otel/metric.Observer] +// interface is extended (which is something that can happen without a major +// version bump of the API package). +type Observer interface{ observer() } + +// Registration is embedded in [go.opentelemetry.io/otel/metric.Registration]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Registration] if you want users to +// experience a compilation error, signaling they need to update to your latest +// implementation, when the [go.opentelemetry.io/otel/metric.Registration] +// interface is extended (which is something that can happen without a major +// version bump of the API package). +type Registration interface{ registration() } + +// Float64Counter is embedded in +// [go.opentelemetry.io/otel/metric.Float64Counter]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Float64Counter] if you want +// users to experience a compilation error, signaling they need to update to +// your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Float64Counter] interface is +// extended (which is something that can happen without a major version bump of +// the API package). +type Float64Counter interface{ float64Counter() } + +// Float64Histogram is embedded in +// [go.opentelemetry.io/otel/metric.Float64Histogram]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Float64Histogram] if you want +// users to experience a compilation error, signaling they need to update to +// your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Float64Histogram] interface is +// extended (which is something that can happen without a major version bump of +// the API package). +type Float64Histogram interface{ float64Histogram() } + +// Float64ObservableCounter is embedded in +// [go.opentelemetry.io/otel/metric.Float64ObservableCounter]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Float64ObservableCounter] if you +// want users to experience a compilation error, signaling they need to update +// to your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Float64ObservableCounter] +// interface is extended (which is something that can happen without a major +// version bump of the API package). +type Float64ObservableCounter interface{ float64ObservableCounter() } + +// Float64ObservableGauge is embedded in +// [go.opentelemetry.io/otel/metric.Float64ObservableGauge]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Float64ObservableGauge] if you +// want users to experience a compilation error, signaling they need to update +// to your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Float64ObservableGauge] +// interface is extended (which is something that can happen without a major +// version bump of the API package). +type Float64ObservableGauge interface{ float64ObservableGauge() } + +// Float64ObservableUpDownCounter is embedded in +// [go.opentelemetry.io/otel/metric.Float64ObservableUpDownCounter]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Float64ObservableUpDownCounter] +// if you want users to experience a compilation error, signaling they need to +// update to your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Float64ObservableUpDownCounter] +// interface is extended (which is something that can happen without a major +// version bump of the API package). +type Float64ObservableUpDownCounter interface{ float64ObservableUpDownCounter() } + +// Float64UpDownCounter is embedded in +// [go.opentelemetry.io/otel/metric.Float64UpDownCounter]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Float64UpDownCounter] if you +// want users to experience a compilation error, signaling they need to update +// to your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Float64UpDownCounter] interface +// is extended (which is something that can happen without a major version bump +// of the API package). +type Float64UpDownCounter interface{ float64UpDownCounter() } + +// Int64Counter is embedded in +// [go.opentelemetry.io/otel/metric.Int64Counter]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Int64Counter] if you want users +// to experience a compilation error, signaling they need to update to your +// latest implementation, when the +// [go.opentelemetry.io/otel/metric.Int64Counter] interface is +// extended (which is something that can happen without a major version bump of +// the API package). +type Int64Counter interface{ int64Counter() } + +// Int64Histogram is embedded in +// [go.opentelemetry.io/otel/metric.Int64Histogram]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Int64Histogram] if you want +// users to experience a compilation error, signaling they need to update to +// your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Int64Histogram] interface is +// extended (which is something that can happen without a major version bump of +// the API package). +type Int64Histogram interface{ int64Histogram() } + +// Int64ObservableCounter is embedded in +// [go.opentelemetry.io/otel/metric.Int64ObservableCounter]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Int64ObservableCounter] if you +// want users to experience a compilation error, signaling they need to update +// to your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Int64ObservableCounter] +// interface is extended (which is something that can happen without a major +// version bump of the API package). +type Int64ObservableCounter interface{ int64ObservableCounter() } + +// Int64ObservableGauge is embedded in +// [go.opentelemetry.io/otel/metric.Int64ObservableGauge]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Int64ObservableGauge] if you +// want users to experience a compilation error, signaling they need to update +// to your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Int64ObservableGauge] interface +// is extended (which is something that can happen without a major version bump +// of the API package). +type Int64ObservableGauge interface{ int64ObservableGauge() } + +// Int64ObservableUpDownCounter is embedded in +// [go.opentelemetry.io/otel/metric.Int64ObservableUpDownCounter]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Int64ObservableUpDownCounter] if +// you want users to experience a compilation error, signaling they need to +// update to your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Int64ObservableUpDownCounter] +// interface is extended (which is something that can happen without a major +// version bump of the API package). +type Int64ObservableUpDownCounter interface{ int64ObservableUpDownCounter() } + +// Int64UpDownCounter is embedded in +// [go.opentelemetry.io/otel/metric.Int64UpDownCounter]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Int64UpDownCounter] if you want +// users to experience a compilation error, signaling they need to update to +// your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Int64UpDownCounter] interface is +// extended (which is something that can happen without a major version bump of +// the API package). +type Int64UpDownCounter interface{ int64UpDownCounter() } diff --git a/vendor/go.opentelemetry.io/otel/metric/instrument.go b/vendor/go.opentelemetry.io/otel/metric/instrument.go new file mode 100644 index 000000000..be89cd533 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/metric/instrument.go @@ -0,0 +1,357 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package metric // import "go.opentelemetry.io/otel/metric" + +import "go.opentelemetry.io/otel/attribute" + +// Observable is used as a grouping mechanism for all instruments that are +// updated within a Callback. +type Observable interface { + observable() +} + +// InstrumentOption applies options to all instruments. +type InstrumentOption interface { + Int64CounterOption + Int64UpDownCounterOption + Int64HistogramOption + Int64ObservableCounterOption + Int64ObservableUpDownCounterOption + Int64ObservableGaugeOption + + Float64CounterOption + Float64UpDownCounterOption + Float64HistogramOption + Float64ObservableCounterOption + Float64ObservableUpDownCounterOption + Float64ObservableGaugeOption +} + +// HistogramOption applies options to histogram instruments. +type HistogramOption interface { + Int64HistogramOption + Float64HistogramOption +} + +type descOpt string + +func (o descOpt) applyFloat64Counter(c Float64CounterConfig) Float64CounterConfig { + c.description = string(o) + return c +} + +func (o descOpt) applyFloat64UpDownCounter(c Float64UpDownCounterConfig) Float64UpDownCounterConfig { + c.description = string(o) + return c +} + +func (o descOpt) applyFloat64Histogram(c Float64HistogramConfig) Float64HistogramConfig { + c.description = string(o) + return c +} + +func (o descOpt) applyFloat64ObservableCounter(c Float64ObservableCounterConfig) Float64ObservableCounterConfig { + c.description = string(o) + return c +} + +func (o descOpt) applyFloat64ObservableUpDownCounter(c Float64ObservableUpDownCounterConfig) Float64ObservableUpDownCounterConfig { + c.description = string(o) + return c +} + +func (o descOpt) applyFloat64ObservableGauge(c Float64ObservableGaugeConfig) Float64ObservableGaugeConfig { + c.description = string(o) + return c +} + +func (o descOpt) applyInt64Counter(c Int64CounterConfig) Int64CounterConfig { + c.description = string(o) + return c +} + +func (o descOpt) applyInt64UpDownCounter(c Int64UpDownCounterConfig) Int64UpDownCounterConfig { + c.description = string(o) + return c +} + +func (o descOpt) applyInt64Histogram(c Int64HistogramConfig) Int64HistogramConfig { + c.description = string(o) + return c +} + +func (o descOpt) applyInt64ObservableCounter(c Int64ObservableCounterConfig) Int64ObservableCounterConfig { + c.description = string(o) + return c +} + +func (o descOpt) applyInt64ObservableUpDownCounter(c Int64ObservableUpDownCounterConfig) Int64ObservableUpDownCounterConfig { + c.description = string(o) + return c +} + +func (o descOpt) applyInt64ObservableGauge(c Int64ObservableGaugeConfig) Int64ObservableGaugeConfig { + c.description = string(o) + return c +} + +// WithDescription sets the instrument description. +func WithDescription(desc string) InstrumentOption { return descOpt(desc) } + +type unitOpt string + +func (o unitOpt) applyFloat64Counter(c Float64CounterConfig) Float64CounterConfig { + c.unit = string(o) + return c +} + +func (o unitOpt) applyFloat64UpDownCounter(c Float64UpDownCounterConfig) Float64UpDownCounterConfig { + c.unit = string(o) + return c +} + +func (o unitOpt) applyFloat64Histogram(c Float64HistogramConfig) Float64HistogramConfig { + c.unit = string(o) + return c +} + +func (o unitOpt) applyFloat64ObservableCounter(c Float64ObservableCounterConfig) Float64ObservableCounterConfig { + c.unit = string(o) + return c +} + +func (o unitOpt) applyFloat64ObservableUpDownCounter(c Float64ObservableUpDownCounterConfig) Float64ObservableUpDownCounterConfig { + c.unit = string(o) + return c +} + +func (o unitOpt) applyFloat64ObservableGauge(c Float64ObservableGaugeConfig) Float64ObservableGaugeConfig { + c.unit = string(o) + return c +} + +func (o unitOpt) applyInt64Counter(c Int64CounterConfig) Int64CounterConfig { + c.unit = string(o) + return c +} + +func (o unitOpt) applyInt64UpDownCounter(c Int64UpDownCounterConfig) Int64UpDownCounterConfig { + c.unit = string(o) + return c +} + +func (o unitOpt) applyInt64Histogram(c Int64HistogramConfig) Int64HistogramConfig { + c.unit = string(o) + return c +} + +func (o unitOpt) applyInt64ObservableCounter(c Int64ObservableCounterConfig) Int64ObservableCounterConfig { + c.unit = string(o) + return c +} + +func (o unitOpt) applyInt64ObservableUpDownCounter(c Int64ObservableUpDownCounterConfig) Int64ObservableUpDownCounterConfig { + c.unit = string(o) + return c +} + +func (o unitOpt) applyInt64ObservableGauge(c Int64ObservableGaugeConfig) Int64ObservableGaugeConfig { + c.unit = string(o) + return c +} + +// WithUnit sets the instrument unit. +// +// The unit u should be defined using the appropriate [UCUM](https://ucum.org) case-sensitive code. +func WithUnit(u string) InstrumentOption { return unitOpt(u) } + +// WithExplicitBucketBoundaries sets the instrument explicit bucket boundaries. +// +// This option is considered "advisory", and may be ignored by API implementations. +func WithExplicitBucketBoundaries(bounds ...float64) HistogramOption { return bucketOpt(bounds) } + +type bucketOpt []float64 + +func (o bucketOpt) applyFloat64Histogram(c Float64HistogramConfig) Float64HistogramConfig { + c.explicitBucketBoundaries = o + return c +} + +func (o bucketOpt) applyInt64Histogram(c Int64HistogramConfig) Int64HistogramConfig { + c.explicitBucketBoundaries = o + return c +} + +// AddOption applies options to an addition measurement. See +// [MeasurementOption] for other options that can be used as an AddOption. +type AddOption interface { + applyAdd(AddConfig) AddConfig +} + +// AddConfig contains options for an addition measurement. +type AddConfig struct { + attrs attribute.Set +} + +// NewAddConfig returns a new [AddConfig] with all opts applied. +func NewAddConfig(opts []AddOption) AddConfig { + config := AddConfig{attrs: *attribute.EmptySet()} + for _, o := range opts { + config = o.applyAdd(config) + } + return config +} + +// Attributes returns the configured attribute set. +func (c AddConfig) Attributes() attribute.Set { + return c.attrs +} + +// RecordOption applies options to an addition measurement. See +// [MeasurementOption] for other options that can be used as a RecordOption. +type RecordOption interface { + applyRecord(RecordConfig) RecordConfig +} + +// RecordConfig contains options for a recorded measurement. +type RecordConfig struct { + attrs attribute.Set +} + +// NewRecordConfig returns a new [RecordConfig] with all opts applied. +func NewRecordConfig(opts []RecordOption) RecordConfig { + config := RecordConfig{attrs: *attribute.EmptySet()} + for _, o := range opts { + config = o.applyRecord(config) + } + return config +} + +// Attributes returns the configured attribute set. +func (c RecordConfig) Attributes() attribute.Set { + return c.attrs +} + +// ObserveOption applies options to an addition measurement. See +// [MeasurementOption] for other options that can be used as a ObserveOption. +type ObserveOption interface { + applyObserve(ObserveConfig) ObserveConfig +} + +// ObserveConfig contains options for an observed measurement. +type ObserveConfig struct { + attrs attribute.Set +} + +// NewObserveConfig returns a new [ObserveConfig] with all opts applied. +func NewObserveConfig(opts []ObserveOption) ObserveConfig { + config := ObserveConfig{attrs: *attribute.EmptySet()} + for _, o := range opts { + config = o.applyObserve(config) + } + return config +} + +// Attributes returns the configured attribute set. +func (c ObserveConfig) Attributes() attribute.Set { + return c.attrs +} + +// MeasurementOption applies options to all instrument measurement. +type MeasurementOption interface { + AddOption + RecordOption + ObserveOption +} + +type attrOpt struct { + set attribute.Set +} + +// mergeSets returns the union of keys between a and b. Any duplicate keys will +// use the value associated with b. +func mergeSets(a, b attribute.Set) attribute.Set { + // NewMergeIterator uses the first value for any duplicates. + iter := attribute.NewMergeIterator(&b, &a) + merged := make([]attribute.KeyValue, 0, a.Len()+b.Len()) + for iter.Next() { + merged = append(merged, iter.Attribute()) + } + return attribute.NewSet(merged...) +} + +func (o attrOpt) applyAdd(c AddConfig) AddConfig { + switch { + case o.set.Len() == 0: + case c.attrs.Len() == 0: + c.attrs = o.set + default: + c.attrs = mergeSets(c.attrs, o.set) + } + return c +} + +func (o attrOpt) applyRecord(c RecordConfig) RecordConfig { + switch { + case o.set.Len() == 0: + case c.attrs.Len() == 0: + c.attrs = o.set + default: + c.attrs = mergeSets(c.attrs, o.set) + } + return c +} + +func (o attrOpt) applyObserve(c ObserveConfig) ObserveConfig { + switch { + case o.set.Len() == 0: + case c.attrs.Len() == 0: + c.attrs = o.set + default: + c.attrs = mergeSets(c.attrs, o.set) + } + return c +} + +// WithAttributeSet sets the attribute Set associated with a measurement is +// made with. +// +// If multiple WithAttributeSet or WithAttributes options are passed the +// attributes will be merged together in the order they are passed. Attributes +// with duplicate keys will use the last value passed. +func WithAttributeSet(attributes attribute.Set) MeasurementOption { + return attrOpt{set: attributes} +} + +// WithAttributes converts attributes into an attribute Set and sets the Set to +// be associated with a measurement. This is shorthand for: +// +// cp := make([]attribute.KeyValue, len(attributes)) +// copy(cp, attributes) +// WithAttributes(attribute.NewSet(cp...)) +// +// [attribute.NewSet] may modify the passed attributes so this will make a copy +// of attributes before creating a set in order to ensure this function is +// concurrent safe. This makes this option function less optimized in +// comparison to [WithAttributeSet]. Therefore, [WithAttributeSet] should be +// preferred for performance sensitive code. +// +// See [WithAttributeSet] for information about how multiple WithAttributes are +// merged. +func WithAttributes(attributes ...attribute.KeyValue) MeasurementOption { + cp := make([]attribute.KeyValue, len(attributes)) + copy(cp, attributes) + return attrOpt{set: attribute.NewSet(cp...)} +} diff --git a/vendor/go.opentelemetry.io/otel/metric/meter.go b/vendor/go.opentelemetry.io/otel/metric/meter.go new file mode 100644 index 000000000..2520bc74a --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/metric/meter.go @@ -0,0 +1,212 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package metric // import "go.opentelemetry.io/otel/metric" + +import ( + "context" + + "go.opentelemetry.io/otel/metric/embedded" +) + +// MeterProvider provides access to named Meter instances, for instrumenting +// an application or package. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type MeterProvider interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.MeterProvider + + // Meter returns a new Meter with the provided name and configuration. + // + // A Meter should be scoped at most to a single package. The name needs to + // be unique so it does not collide with other names used by + // an application, nor other applications. To achieve this, the import path + // of the instrumentation package is recommended to be used as name. + // + // If the name is empty, then an implementation defined default name will + // be used instead. + Meter(name string, opts ...MeterOption) Meter +} + +// Meter provides access to instrument instances for recording metrics. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Meter interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Meter + + // Int64Counter returns a new Int64Counter instrument identified by name + // and configured with options. The instrument is used to synchronously + // record increasing int64 measurements during a computational operation. + Int64Counter(name string, options ...Int64CounterOption) (Int64Counter, error) + // Int64UpDownCounter returns a new Int64UpDownCounter instrument + // identified by name and configured with options. The instrument is used + // to synchronously record int64 measurements during a computational + // operation. + Int64UpDownCounter(name string, options ...Int64UpDownCounterOption) (Int64UpDownCounter, error) + // Int64Histogram returns a new Int64Histogram instrument identified by + // name and configured with options. The instrument is used to + // synchronously record the distribution of int64 measurements during a + // computational operation. + Int64Histogram(name string, options ...Int64HistogramOption) (Int64Histogram, error) + // Int64ObservableCounter returns a new Int64ObservableCounter identified + // by name and configured with options. The instrument is used to + // asynchronously record increasing int64 measurements once per a + // measurement collection cycle. + // + // Measurements for the returned instrument are made via a callback. Use + // the WithInt64Callback option to register the callback here, or use the + // RegisterCallback method of this Meter to register one later. See the + // Measurements section of the package documentation for more information. + Int64ObservableCounter(name string, options ...Int64ObservableCounterOption) (Int64ObservableCounter, error) + // Int64ObservableUpDownCounter returns a new Int64ObservableUpDownCounter + // instrument identified by name and configured with options. The + // instrument is used to asynchronously record int64 measurements once per + // a measurement collection cycle. + // + // Measurements for the returned instrument are made via a callback. Use + // the WithInt64Callback option to register the callback here, or use the + // RegisterCallback method of this Meter to register one later. See the + // Measurements section of the package documentation for more information. + Int64ObservableUpDownCounter(name string, options ...Int64ObservableUpDownCounterOption) (Int64ObservableUpDownCounter, error) + // Int64ObservableGauge returns a new Int64ObservableGauge instrument + // identified by name and configured with options. The instrument is used + // to asynchronously record instantaneous int64 measurements once per a + // measurement collection cycle. + // + // Measurements for the returned instrument are made via a callback. Use + // the WithInt64Callback option to register the callback here, or use the + // RegisterCallback method of this Meter to register one later. See the + // Measurements section of the package documentation for more information. + Int64ObservableGauge(name string, options ...Int64ObservableGaugeOption) (Int64ObservableGauge, error) + + // Float64Counter returns a new Float64Counter instrument identified by + // name and configured with options. The instrument is used to + // synchronously record increasing float64 measurements during a + // computational operation. + Float64Counter(name string, options ...Float64CounterOption) (Float64Counter, error) + // Float64UpDownCounter returns a new Float64UpDownCounter instrument + // identified by name and configured with options. The instrument is used + // to synchronously record float64 measurements during a computational + // operation. + Float64UpDownCounter(name string, options ...Float64UpDownCounterOption) (Float64UpDownCounter, error) + // Float64Histogram returns a new Float64Histogram instrument identified by + // name and configured with options. The instrument is used to + // synchronously record the distribution of float64 measurements during a + // computational operation. + Float64Histogram(name string, options ...Float64HistogramOption) (Float64Histogram, error) + // Float64ObservableCounter returns a new Float64ObservableCounter + // instrument identified by name and configured with options. The + // instrument is used to asynchronously record increasing float64 + // measurements once per a measurement collection cycle. + // + // Measurements for the returned instrument are made via a callback. Use + // the WithFloat64Callback option to register the callback here, or use the + // RegisterCallback method of this Meter to register one later. See the + // Measurements section of the package documentation for more information. + Float64ObservableCounter(name string, options ...Float64ObservableCounterOption) (Float64ObservableCounter, error) + // Float64ObservableUpDownCounter returns a new + // Float64ObservableUpDownCounter instrument identified by name and + // configured with options. The instrument is used to asynchronously record + // float64 measurements once per a measurement collection cycle. + // + // Measurements for the returned instrument are made via a callback. Use + // the WithFloat64Callback option to register the callback here, or use the + // RegisterCallback method of this Meter to register one later. See the + // Measurements section of the package documentation for more information. + Float64ObservableUpDownCounter(name string, options ...Float64ObservableUpDownCounterOption) (Float64ObservableUpDownCounter, error) + // Float64ObservableGauge returns a new Float64ObservableGauge instrument + // identified by name and configured with options. The instrument is used + // to asynchronously record instantaneous float64 measurements once per a + // measurement collection cycle. + // + // Measurements for the returned instrument are made via a callback. Use + // the WithFloat64Callback option to register the callback here, or use the + // RegisterCallback method of this Meter to register one later. See the + // Measurements section of the package documentation for more information. + Float64ObservableGauge(name string, options ...Float64ObservableGaugeOption) (Float64ObservableGauge, error) + + // RegisterCallback registers f to be called during the collection of a + // measurement cycle. + // + // If Unregister of the returned Registration is called, f needs to be + // unregistered and not called during collection. + // + // The instruments f is registered with are the only instruments that f may + // observe values for. + // + // If no instruments are passed, f should not be registered nor called + // during collection. + // + // The function f needs to be concurrent safe. + RegisterCallback(f Callback, instruments ...Observable) (Registration, error) +} + +// Callback is a function registered with a Meter that makes observations for +// the set of instruments it is registered with. The Observer parameter is used +// to record measurement observations for these instruments. +// +// The function needs to complete in a finite amount of time and the deadline +// of the passed context is expected to be honored. +// +// The function needs to make unique observations across all registered +// Callbacks. Meaning, it should not report measurements for an instrument with +// the same attributes as another Callback will report. +// +// The function needs to be concurrent safe. +type Callback func(context.Context, Observer) error + +// Observer records measurements for multiple instruments in a Callback. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Observer interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Observer + + // ObserveFloat64 records the float64 value for obsrv. + ObserveFloat64(obsrv Float64Observable, value float64, opts ...ObserveOption) + // ObserveInt64 records the int64 value for obsrv. + ObserveInt64(obsrv Int64Observable, value int64, opts ...ObserveOption) +} + +// Registration is an token representing the unique registration of a callback +// for a set of instruments with a Meter. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Registration interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Registration + + // Unregister removes the callback registration from a Meter. + // + // This method needs to be idempotent and concurrent safe. + Unregister() error +} diff --git a/vendor/go.opentelemetry.io/otel/metric/syncfloat64.go b/vendor/go.opentelemetry.io/otel/metric/syncfloat64.go new file mode 100644 index 000000000..0a4825ae6 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/metric/syncfloat64.go @@ -0,0 +1,185 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package metric // import "go.opentelemetry.io/otel/metric" + +import ( + "context" + + "go.opentelemetry.io/otel/metric/embedded" +) + +// Float64Counter is an instrument that records increasing float64 values. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Float64Counter interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Float64Counter + + // Add records a change to the counter. + // + // Use the WithAttributeSet (or, if performance is not a concern, + // the WithAttributes) option to include measurement attributes. + Add(ctx context.Context, incr float64, options ...AddOption) +} + +// Float64CounterConfig contains options for synchronous counter instruments that +// record int64 values. +type Float64CounterConfig struct { + description string + unit string +} + +// NewFloat64CounterConfig returns a new [Float64CounterConfig] with all opts +// applied. +func NewFloat64CounterConfig(opts ...Float64CounterOption) Float64CounterConfig { + var config Float64CounterConfig + for _, o := range opts { + config = o.applyFloat64Counter(config) + } + return config +} + +// Description returns the configured description. +func (c Float64CounterConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Float64CounterConfig) Unit() string { + return c.unit +} + +// Float64CounterOption applies options to a [Float64CounterConfig]. See +// [InstrumentOption] for other options that can be used as a +// Float64CounterOption. +type Float64CounterOption interface { + applyFloat64Counter(Float64CounterConfig) Float64CounterConfig +} + +// Float64UpDownCounter is an instrument that records increasing or decreasing +// float64 values. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Float64UpDownCounter interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Float64UpDownCounter + + // Add records a change to the counter. + // + // Use the WithAttributeSet (or, if performance is not a concern, + // the WithAttributes) option to include measurement attributes. + Add(ctx context.Context, incr float64, options ...AddOption) +} + +// Float64UpDownCounterConfig contains options for synchronous counter +// instruments that record int64 values. +type Float64UpDownCounterConfig struct { + description string + unit string +} + +// NewFloat64UpDownCounterConfig returns a new [Float64UpDownCounterConfig] +// with all opts applied. +func NewFloat64UpDownCounterConfig(opts ...Float64UpDownCounterOption) Float64UpDownCounterConfig { + var config Float64UpDownCounterConfig + for _, o := range opts { + config = o.applyFloat64UpDownCounter(config) + } + return config +} + +// Description returns the configured description. +func (c Float64UpDownCounterConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Float64UpDownCounterConfig) Unit() string { + return c.unit +} + +// Float64UpDownCounterOption applies options to a +// [Float64UpDownCounterConfig]. See [InstrumentOption] for other options that +// can be used as a Float64UpDownCounterOption. +type Float64UpDownCounterOption interface { + applyFloat64UpDownCounter(Float64UpDownCounterConfig) Float64UpDownCounterConfig +} + +// Float64Histogram is an instrument that records a distribution of float64 +// values. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Float64Histogram interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Float64Histogram + + // Record adds an additional value to the distribution. + // + // Use the WithAttributeSet (or, if performance is not a concern, + // the WithAttributes) option to include measurement attributes. + Record(ctx context.Context, incr float64, options ...RecordOption) +} + +// Float64HistogramConfig contains options for synchronous counter instruments +// that record int64 values. +type Float64HistogramConfig struct { + description string + unit string + explicitBucketBoundaries []float64 +} + +// NewFloat64HistogramConfig returns a new [Float64HistogramConfig] with all +// opts applied. +func NewFloat64HistogramConfig(opts ...Float64HistogramOption) Float64HistogramConfig { + var config Float64HistogramConfig + for _, o := range opts { + config = o.applyFloat64Histogram(config) + } + return config +} + +// Description returns the configured description. +func (c Float64HistogramConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Float64HistogramConfig) Unit() string { + return c.unit +} + +// ExplicitBucketBoundaries returns the configured explicit bucket boundaries. +func (c Float64HistogramConfig) ExplicitBucketBoundaries() []float64 { + return c.explicitBucketBoundaries +} + +// Float64HistogramOption applies options to a [Float64HistogramConfig]. See +// [InstrumentOption] for other options that can be used as a +// Float64HistogramOption. +type Float64HistogramOption interface { + applyFloat64Histogram(Float64HistogramConfig) Float64HistogramConfig +} diff --git a/vendor/go.opentelemetry.io/otel/metric/syncint64.go b/vendor/go.opentelemetry.io/otel/metric/syncint64.go new file mode 100644 index 000000000..56667d32f --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/metric/syncint64.go @@ -0,0 +1,185 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package metric // import "go.opentelemetry.io/otel/metric" + +import ( + "context" + + "go.opentelemetry.io/otel/metric/embedded" +) + +// Int64Counter is an instrument that records increasing int64 values. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Int64Counter interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Int64Counter + + // Add records a change to the counter. + // + // Use the WithAttributeSet (or, if performance is not a concern, + // the WithAttributes) option to include measurement attributes. + Add(ctx context.Context, incr int64, options ...AddOption) +} + +// Int64CounterConfig contains options for synchronous counter instruments that +// record int64 values. +type Int64CounterConfig struct { + description string + unit string +} + +// NewInt64CounterConfig returns a new [Int64CounterConfig] with all opts +// applied. +func NewInt64CounterConfig(opts ...Int64CounterOption) Int64CounterConfig { + var config Int64CounterConfig + for _, o := range opts { + config = o.applyInt64Counter(config) + } + return config +} + +// Description returns the configured description. +func (c Int64CounterConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Int64CounterConfig) Unit() string { + return c.unit +} + +// Int64CounterOption applies options to a [Int64CounterConfig]. See +// [InstrumentOption] for other options that can be used as an +// Int64CounterOption. +type Int64CounterOption interface { + applyInt64Counter(Int64CounterConfig) Int64CounterConfig +} + +// Int64UpDownCounter is an instrument that records increasing or decreasing +// int64 values. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Int64UpDownCounter interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Int64UpDownCounter + + // Add records a change to the counter. + // + // Use the WithAttributeSet (or, if performance is not a concern, + // the WithAttributes) option to include measurement attributes. + Add(ctx context.Context, incr int64, options ...AddOption) +} + +// Int64UpDownCounterConfig contains options for synchronous counter +// instruments that record int64 values. +type Int64UpDownCounterConfig struct { + description string + unit string +} + +// NewInt64UpDownCounterConfig returns a new [Int64UpDownCounterConfig] with +// all opts applied. +func NewInt64UpDownCounterConfig(opts ...Int64UpDownCounterOption) Int64UpDownCounterConfig { + var config Int64UpDownCounterConfig + for _, o := range opts { + config = o.applyInt64UpDownCounter(config) + } + return config +} + +// Description returns the configured description. +func (c Int64UpDownCounterConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Int64UpDownCounterConfig) Unit() string { + return c.unit +} + +// Int64UpDownCounterOption applies options to a [Int64UpDownCounterConfig]. +// See [InstrumentOption] for other options that can be used as an +// Int64UpDownCounterOption. +type Int64UpDownCounterOption interface { + applyInt64UpDownCounter(Int64UpDownCounterConfig) Int64UpDownCounterConfig +} + +// Int64Histogram is an instrument that records a distribution of int64 +// values. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Int64Histogram interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Int64Histogram + + // Record adds an additional value to the distribution. + // + // Use the WithAttributeSet (or, if performance is not a concern, + // the WithAttributes) option to include measurement attributes. + Record(ctx context.Context, incr int64, options ...RecordOption) +} + +// Int64HistogramConfig contains options for synchronous counter instruments +// that record int64 values. +type Int64HistogramConfig struct { + description string + unit string + explicitBucketBoundaries []float64 +} + +// NewInt64HistogramConfig returns a new [Int64HistogramConfig] with all opts +// applied. +func NewInt64HistogramConfig(opts ...Int64HistogramOption) Int64HistogramConfig { + var config Int64HistogramConfig + for _, o := range opts { + config = o.applyInt64Histogram(config) + } + return config +} + +// Description returns the configured description. +func (c Int64HistogramConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Int64HistogramConfig) Unit() string { + return c.unit +} + +// ExplicitBucketBoundaries returns the configured explicit bucket boundaries. +func (c Int64HistogramConfig) ExplicitBucketBoundaries() []float64 { + return c.explicitBucketBoundaries +} + +// Int64HistogramOption applies options to a [Int64HistogramConfig]. See +// [InstrumentOption] for other options that can be used as an +// Int64HistogramOption. +type Int64HistogramOption interface { + applyInt64Histogram(Int64HistogramConfig) Int64HistogramConfig +} diff --git a/vendor/go.opentelemetry.io/otel/propagation.go b/vendor/go.opentelemetry.io/otel/propagation.go new file mode 100644 index 000000000..d29aaa32c --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/propagation.go @@ -0,0 +1,31 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otel // import "go.opentelemetry.io/otel" + +import ( + "go.opentelemetry.io/otel/internal/global" + "go.opentelemetry.io/otel/propagation" +) + +// GetTextMapPropagator returns the global TextMapPropagator. If none has been +// set, a No-Op TextMapPropagator is returned. +func GetTextMapPropagator() propagation.TextMapPropagator { + return global.TextMapPropagator() +} + +// SetTextMapPropagator sets propagator as the global TextMapPropagator. +func SetTextMapPropagator(propagator propagation.TextMapPropagator) { + global.SetTextMapPropagator(propagator) +} diff --git a/vendor/go.opentelemetry.io/otel/propagation/baggage.go b/vendor/go.opentelemetry.io/otel/propagation/baggage.go new file mode 100644 index 000000000..303cdf1cb --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/propagation/baggage.go @@ -0,0 +1,58 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package propagation // import "go.opentelemetry.io/otel/propagation" + +import ( + "context" + + "go.opentelemetry.io/otel/baggage" +) + +const baggageHeader = "baggage" + +// Baggage is a propagator that supports the W3C Baggage format. +// +// This propagates user-defined baggage associated with a trace. The complete +// specification is defined at https://www.w3.org/TR/baggage/. +type Baggage struct{} + +var _ TextMapPropagator = Baggage{} + +// Inject sets baggage key-values from ctx into the carrier. +func (b Baggage) Inject(ctx context.Context, carrier TextMapCarrier) { + bStr := baggage.FromContext(ctx).String() + if bStr != "" { + carrier.Set(baggageHeader, bStr) + } +} + +// Extract returns a copy of parent with the baggage from the carrier added. +func (b Baggage) Extract(parent context.Context, carrier TextMapCarrier) context.Context { + bStr := carrier.Get(baggageHeader) + if bStr == "" { + return parent + } + + bag, err := baggage.Parse(bStr) + if err != nil { + return parent + } + return baggage.ContextWithBaggage(parent, bag) +} + +// Fields returns the keys who's values are set with Inject. +func (b Baggage) Fields() []string { + return []string{baggageHeader} +} diff --git a/vendor/go.opentelemetry.io/otel/propagation/doc.go b/vendor/go.opentelemetry.io/otel/propagation/doc.go new file mode 100644 index 000000000..c119eb285 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/propagation/doc.go @@ -0,0 +1,24 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* +Package propagation contains OpenTelemetry context propagators. + +OpenTelemetry propagators are used to extract and inject context data from and +into messages exchanged by applications. The propagator supported by this +package is the W3C Trace Context encoding +(https://www.w3.org/TR/trace-context/), and W3C Baggage +(https://www.w3.org/TR/baggage/). +*/ +package propagation // import "go.opentelemetry.io/otel/propagation" diff --git a/vendor/go.opentelemetry.io/otel/propagation/propagation.go b/vendor/go.opentelemetry.io/otel/propagation/propagation.go new file mode 100644 index 000000000..c94438f73 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/propagation/propagation.go @@ -0,0 +1,153 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package propagation // import "go.opentelemetry.io/otel/propagation" + +import ( + "context" + "net/http" +) + +// TextMapCarrier is the storage medium used by a TextMapPropagator. +type TextMapCarrier interface { + // DO NOT CHANGE: any modification will not be backwards compatible and + // must never be done outside of a new major release. + + // Get returns the value associated with the passed key. + Get(key string) string + // DO NOT CHANGE: any modification will not be backwards compatible and + // must never be done outside of a new major release. + + // Set stores the key-value pair. + Set(key string, value string) + // DO NOT CHANGE: any modification will not be backwards compatible and + // must never be done outside of a new major release. + + // Keys lists the keys stored in this carrier. + Keys() []string + // DO NOT CHANGE: any modification will not be backwards compatible and + // must never be done outside of a new major release. +} + +// MapCarrier is a TextMapCarrier that uses a map held in memory as a storage +// medium for propagated key-value pairs. +type MapCarrier map[string]string + +// Compile time check that MapCarrier implements the TextMapCarrier. +var _ TextMapCarrier = MapCarrier{} + +// Get returns the value associated with the passed key. +func (c MapCarrier) Get(key string) string { + return c[key] +} + +// Set stores the key-value pair. +func (c MapCarrier) Set(key, value string) { + c[key] = value +} + +// Keys lists the keys stored in this carrier. +func (c MapCarrier) Keys() []string { + keys := make([]string, 0, len(c)) + for k := range c { + keys = append(keys, k) + } + return keys +} + +// HeaderCarrier adapts http.Header to satisfy the TextMapCarrier interface. +type HeaderCarrier http.Header + +// Get returns the value associated with the passed key. +func (hc HeaderCarrier) Get(key string) string { + return http.Header(hc).Get(key) +} + +// Set stores the key-value pair. +func (hc HeaderCarrier) Set(key string, value string) { + http.Header(hc).Set(key, value) +} + +// Keys lists the keys stored in this carrier. +func (hc HeaderCarrier) Keys() []string { + keys := make([]string, 0, len(hc)) + for k := range hc { + keys = append(keys, k) + } + return keys +} + +// TextMapPropagator propagates cross-cutting concerns as key-value text +// pairs within a carrier that travels in-band across process boundaries. +type TextMapPropagator interface { + // DO NOT CHANGE: any modification will not be backwards compatible and + // must never be done outside of a new major release. + + // Inject set cross-cutting concerns from the Context into the carrier. + Inject(ctx context.Context, carrier TextMapCarrier) + // DO NOT CHANGE: any modification will not be backwards compatible and + // must never be done outside of a new major release. + + // Extract reads cross-cutting concerns from the carrier into a Context. + Extract(ctx context.Context, carrier TextMapCarrier) context.Context + // DO NOT CHANGE: any modification will not be backwards compatible and + // must never be done outside of a new major release. + + // Fields returns the keys whose values are set with Inject. + Fields() []string + // DO NOT CHANGE: any modification will not be backwards compatible and + // must never be done outside of a new major release. +} + +type compositeTextMapPropagator []TextMapPropagator + +func (p compositeTextMapPropagator) Inject(ctx context.Context, carrier TextMapCarrier) { + for _, i := range p { + i.Inject(ctx, carrier) + } +} + +func (p compositeTextMapPropagator) Extract(ctx context.Context, carrier TextMapCarrier) context.Context { + for _, i := range p { + ctx = i.Extract(ctx, carrier) + } + return ctx +} + +func (p compositeTextMapPropagator) Fields() []string { + unique := make(map[string]struct{}) + for _, i := range p { + for _, k := range i.Fields() { + unique[k] = struct{}{} + } + } + + fields := make([]string, 0, len(unique)) + for k := range unique { + fields = append(fields, k) + } + return fields +} + +// NewCompositeTextMapPropagator returns a unified TextMapPropagator from the +// group of passed TextMapPropagator. This allows different cross-cutting +// concerns to be propagates in a unified manner. +// +// The returned TextMapPropagator will inject and extract cross-cutting +// concerns in the order the TextMapPropagators were provided. Additionally, +// the Fields method will return a de-duplicated slice of the keys that are +// set with the Inject method. +func NewCompositeTextMapPropagator(p ...TextMapPropagator) TextMapPropagator { + return compositeTextMapPropagator(p) +} diff --git a/vendor/go.opentelemetry.io/otel/propagation/trace_context.go b/vendor/go.opentelemetry.io/otel/propagation/trace_context.go new file mode 100644 index 000000000..75a8f3435 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/propagation/trace_context.go @@ -0,0 +1,161 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package propagation // import "go.opentelemetry.io/otel/propagation" + +import ( + "context" + "encoding/hex" + "fmt" + "regexp" + + "go.opentelemetry.io/otel/trace" +) + +const ( + supportedVersion = 0 + maxVersion = 254 + traceparentHeader = "traceparent" + tracestateHeader = "tracestate" +) + +// TraceContext is a propagator that supports the W3C Trace Context format +// (https://www.w3.org/TR/trace-context/) +// +// This propagator will propagate the traceparent and tracestate headers to +// guarantee traces are not broken. It is up to the users of this propagator +// to choose if they want to participate in a trace by modifying the +// traceparent header and relevant parts of the tracestate header containing +// their proprietary information. +type TraceContext struct{} + +var ( + _ TextMapPropagator = TraceContext{} + traceCtxRegExp = regexp.MustCompile("^(?P[0-9a-f]{2})-(?P[a-f0-9]{32})-(?P[a-f0-9]{16})-(?P[a-f0-9]{2})(?:-.*)?$") +) + +// Inject set tracecontext from the Context into the carrier. +func (tc TraceContext) Inject(ctx context.Context, carrier TextMapCarrier) { + sc := trace.SpanContextFromContext(ctx) + if !sc.IsValid() { + return + } + + if ts := sc.TraceState().String(); ts != "" { + carrier.Set(tracestateHeader, ts) + } + + // Clear all flags other than the trace-context supported sampling bit. + flags := sc.TraceFlags() & trace.FlagsSampled + + h := fmt.Sprintf("%.2x-%s-%s-%s", + supportedVersion, + sc.TraceID(), + sc.SpanID(), + flags) + carrier.Set(traceparentHeader, h) +} + +// Extract reads tracecontext from the carrier into a returned Context. +// +// The returned Context will be a copy of ctx and contain the extracted +// tracecontext as the remote SpanContext. If the extracted tracecontext is +// invalid, the passed ctx will be returned directly instead. +func (tc TraceContext) Extract(ctx context.Context, carrier TextMapCarrier) context.Context { + sc := tc.extract(carrier) + if !sc.IsValid() { + return ctx + } + return trace.ContextWithRemoteSpanContext(ctx, sc) +} + +func (tc TraceContext) extract(carrier TextMapCarrier) trace.SpanContext { + h := carrier.Get(traceparentHeader) + if h == "" { + return trace.SpanContext{} + } + + matches := traceCtxRegExp.FindStringSubmatch(h) + + if len(matches) == 0 { + return trace.SpanContext{} + } + + if len(matches) < 5 { // four subgroups plus the overall match + return trace.SpanContext{} + } + + if len(matches[1]) != 2 { + return trace.SpanContext{} + } + ver, err := hex.DecodeString(matches[1]) + if err != nil { + return trace.SpanContext{} + } + version := int(ver[0]) + if version > maxVersion { + return trace.SpanContext{} + } + + if version == 0 && len(matches) != 5 { // four subgroups plus the overall match + return trace.SpanContext{} + } + + if len(matches[2]) != 32 { + return trace.SpanContext{} + } + + var scc trace.SpanContextConfig + + scc.TraceID, err = trace.TraceIDFromHex(matches[2][:32]) + if err != nil { + return trace.SpanContext{} + } + + if len(matches[3]) != 16 { + return trace.SpanContext{} + } + scc.SpanID, err = trace.SpanIDFromHex(matches[3]) + if err != nil { + return trace.SpanContext{} + } + + if len(matches[4]) != 2 { + return trace.SpanContext{} + } + opts, err := hex.DecodeString(matches[4]) + if err != nil || len(opts) < 1 || (version == 0 && opts[0] > 2) { + return trace.SpanContext{} + } + // Clear all flags other than the trace-context supported sampling bit. + scc.TraceFlags = trace.TraceFlags(opts[0]) & trace.FlagsSampled + + // Ignore the error returned here. Failure to parse tracestate MUST NOT + // affect the parsing of traceparent according to the W3C tracecontext + // specification. + scc.TraceState, _ = trace.ParseTraceState(carrier.Get(tracestateHeader)) + scc.Remote = true + + sc := trace.NewSpanContext(scc) + if !sc.IsValid() { + return trace.SpanContext{} + } + + return sc +} + +// Fields returns the keys who's values are set with Inject. +func (tc TraceContext) Fields() []string { + return []string{traceparentHeader, tracestateHeader} +} diff --git a/vendor/go.opentelemetry.io/otel/requirements.txt b/vendor/go.opentelemetry.io/otel/requirements.txt new file mode 100644 index 000000000..e0a43e138 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/requirements.txt @@ -0,0 +1 @@ +codespell==2.2.6 diff --git a/vendor/go.opentelemetry.io/otel/trace.go b/vendor/go.opentelemetry.io/otel/trace.go new file mode 100644 index 000000000..caf7249de --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/trace.go @@ -0,0 +1,47 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otel // import "go.opentelemetry.io/otel" + +import ( + "go.opentelemetry.io/otel/internal/global" + "go.opentelemetry.io/otel/trace" +) + +// Tracer creates a named tracer that implements Tracer interface. +// If the name is an empty string then provider uses default name. +// +// This is short for GetTracerProvider().Tracer(name, opts...) +func Tracer(name string, opts ...trace.TracerOption) trace.Tracer { + return GetTracerProvider().Tracer(name, opts...) +} + +// GetTracerProvider returns the registered global trace provider. +// If none is registered then an instance of NoopTracerProvider is returned. +// +// Use the trace provider to create a named tracer. E.g. +// +// tracer := otel.GetTracerProvider().Tracer("example.com/foo") +// +// or +// +// tracer := otel.Tracer("example.com/foo") +func GetTracerProvider() trace.TracerProvider { + return global.TracerProvider() +} + +// SetTracerProvider registers `tp` as the global trace provider. +func SetTracerProvider(tp trace.TracerProvider) { + global.SetTracerProvider(tp) +} diff --git a/vendor/go.opentelemetry.io/otel/trace/LICENSE b/vendor/go.opentelemetry.io/otel/trace/LICENSE new file mode 100644 index 000000000..261eeb9e9 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/trace/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/go.opentelemetry.io/otel/trace/config.go b/vendor/go.opentelemetry.io/otel/trace/config.go new file mode 100644 index 000000000..3aadc66cf --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/trace/config.go @@ -0,0 +1,334 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package trace // import "go.opentelemetry.io/otel/trace" + +import ( + "time" + + "go.opentelemetry.io/otel/attribute" +) + +// TracerConfig is a group of options for a Tracer. +type TracerConfig struct { + instrumentationVersion string + // Schema URL of the telemetry emitted by the Tracer. + schemaURL string + attrs attribute.Set +} + +// InstrumentationVersion returns the version of the library providing instrumentation. +func (t *TracerConfig) InstrumentationVersion() string { + return t.instrumentationVersion +} + +// InstrumentationAttributes returns the attributes associated with the library +// providing instrumentation. +func (t *TracerConfig) InstrumentationAttributes() attribute.Set { + return t.attrs +} + +// SchemaURL returns the Schema URL of the telemetry emitted by the Tracer. +func (t *TracerConfig) SchemaURL() string { + return t.schemaURL +} + +// NewTracerConfig applies all the options to a returned TracerConfig. +func NewTracerConfig(options ...TracerOption) TracerConfig { + var config TracerConfig + for _, option := range options { + config = option.apply(config) + } + return config +} + +// TracerOption applies an option to a TracerConfig. +type TracerOption interface { + apply(TracerConfig) TracerConfig +} + +type tracerOptionFunc func(TracerConfig) TracerConfig + +func (fn tracerOptionFunc) apply(cfg TracerConfig) TracerConfig { + return fn(cfg) +} + +// SpanConfig is a group of options for a Span. +type SpanConfig struct { + attributes []attribute.KeyValue + timestamp time.Time + links []Link + newRoot bool + spanKind SpanKind + stackTrace bool +} + +// Attributes describe the associated qualities of a Span. +func (cfg *SpanConfig) Attributes() []attribute.KeyValue { + return cfg.attributes +} + +// Timestamp is a time in a Span life-cycle. +func (cfg *SpanConfig) Timestamp() time.Time { + return cfg.timestamp +} + +// StackTrace checks whether stack trace capturing is enabled. +func (cfg *SpanConfig) StackTrace() bool { + return cfg.stackTrace +} + +// Links are the associations a Span has with other Spans. +func (cfg *SpanConfig) Links() []Link { + return cfg.links +} + +// NewRoot identifies a Span as the root Span for a new trace. This is +// commonly used when an existing trace crosses trust boundaries and the +// remote parent span context should be ignored for security. +func (cfg *SpanConfig) NewRoot() bool { + return cfg.newRoot +} + +// SpanKind is the role a Span has in a trace. +func (cfg *SpanConfig) SpanKind() SpanKind { + return cfg.spanKind +} + +// NewSpanStartConfig applies all the options to a returned SpanConfig. +// No validation is performed on the returned SpanConfig (e.g. no uniqueness +// checking or bounding of data), it is left to the SDK to perform this +// action. +func NewSpanStartConfig(options ...SpanStartOption) SpanConfig { + var c SpanConfig + for _, option := range options { + c = option.applySpanStart(c) + } + return c +} + +// NewSpanEndConfig applies all the options to a returned SpanConfig. +// No validation is performed on the returned SpanConfig (e.g. no uniqueness +// checking or bounding of data), it is left to the SDK to perform this +// action. +func NewSpanEndConfig(options ...SpanEndOption) SpanConfig { + var c SpanConfig + for _, option := range options { + c = option.applySpanEnd(c) + } + return c +} + +// SpanStartOption applies an option to a SpanConfig. These options are applicable +// only when the span is created. +type SpanStartOption interface { + applySpanStart(SpanConfig) SpanConfig +} + +type spanOptionFunc func(SpanConfig) SpanConfig + +func (fn spanOptionFunc) applySpanStart(cfg SpanConfig) SpanConfig { + return fn(cfg) +} + +// SpanEndOption applies an option to a SpanConfig. These options are +// applicable only when the span is ended. +type SpanEndOption interface { + applySpanEnd(SpanConfig) SpanConfig +} + +// EventConfig is a group of options for an Event. +type EventConfig struct { + attributes []attribute.KeyValue + timestamp time.Time + stackTrace bool +} + +// Attributes describe the associated qualities of an Event. +func (cfg *EventConfig) Attributes() []attribute.KeyValue { + return cfg.attributes +} + +// Timestamp is a time in an Event life-cycle. +func (cfg *EventConfig) Timestamp() time.Time { + return cfg.timestamp +} + +// StackTrace checks whether stack trace capturing is enabled. +func (cfg *EventConfig) StackTrace() bool { + return cfg.stackTrace +} + +// NewEventConfig applies all the EventOptions to a returned EventConfig. If no +// timestamp option is passed, the returned EventConfig will have a Timestamp +// set to the call time, otherwise no validation is performed on the returned +// EventConfig. +func NewEventConfig(options ...EventOption) EventConfig { + var c EventConfig + for _, option := range options { + c = option.applyEvent(c) + } + if c.timestamp.IsZero() { + c.timestamp = time.Now() + } + return c +} + +// EventOption applies span event options to an EventConfig. +type EventOption interface { + applyEvent(EventConfig) EventConfig +} + +// SpanOption are options that can be used at both the beginning and end of a span. +type SpanOption interface { + SpanStartOption + SpanEndOption +} + +// SpanStartEventOption are options that can be used at the start of a span, or with an event. +type SpanStartEventOption interface { + SpanStartOption + EventOption +} + +// SpanEndEventOption are options that can be used at the end of a span, or with an event. +type SpanEndEventOption interface { + SpanEndOption + EventOption +} + +type attributeOption []attribute.KeyValue + +func (o attributeOption) applySpan(c SpanConfig) SpanConfig { + c.attributes = append(c.attributes, []attribute.KeyValue(o)...) + return c +} +func (o attributeOption) applySpanStart(c SpanConfig) SpanConfig { return o.applySpan(c) } +func (o attributeOption) applyEvent(c EventConfig) EventConfig { + c.attributes = append(c.attributes, []attribute.KeyValue(o)...) + return c +} + +var _ SpanStartEventOption = attributeOption{} + +// WithAttributes adds the attributes related to a span life-cycle event. +// These attributes are used to describe the work a Span represents when this +// option is provided to a Span's start or end events. Otherwise, these +// attributes provide additional information about the event being recorded +// (e.g. error, state change, processing progress, system event). +// +// If multiple of these options are passed the attributes of each successive +// option will extend the attributes instead of overwriting. There is no +// guarantee of uniqueness in the resulting attributes. +func WithAttributes(attributes ...attribute.KeyValue) SpanStartEventOption { + return attributeOption(attributes) +} + +// SpanEventOption are options that can be used with an event or a span. +type SpanEventOption interface { + SpanOption + EventOption +} + +type timestampOption time.Time + +func (o timestampOption) applySpan(c SpanConfig) SpanConfig { + c.timestamp = time.Time(o) + return c +} +func (o timestampOption) applySpanStart(c SpanConfig) SpanConfig { return o.applySpan(c) } +func (o timestampOption) applySpanEnd(c SpanConfig) SpanConfig { return o.applySpan(c) } +func (o timestampOption) applyEvent(c EventConfig) EventConfig { + c.timestamp = time.Time(o) + return c +} + +var _ SpanEventOption = timestampOption{} + +// WithTimestamp sets the time of a Span or Event life-cycle moment (e.g. +// started, stopped, errored). +func WithTimestamp(t time.Time) SpanEventOption { + return timestampOption(t) +} + +type stackTraceOption bool + +func (o stackTraceOption) applyEvent(c EventConfig) EventConfig { + c.stackTrace = bool(o) + return c +} + +func (o stackTraceOption) applySpan(c SpanConfig) SpanConfig { + c.stackTrace = bool(o) + return c +} +func (o stackTraceOption) applySpanEnd(c SpanConfig) SpanConfig { return o.applySpan(c) } + +// WithStackTrace sets the flag to capture the error with stack trace (e.g. true, false). +func WithStackTrace(b bool) SpanEndEventOption { + return stackTraceOption(b) +} + +// WithLinks adds links to a Span. The links are added to the existing Span +// links, i.e. this does not overwrite. Links with invalid span context are ignored. +func WithLinks(links ...Link) SpanStartOption { + return spanOptionFunc(func(cfg SpanConfig) SpanConfig { + cfg.links = append(cfg.links, links...) + return cfg + }) +} + +// WithNewRoot specifies that the Span should be treated as a root Span. Any +// existing parent span context will be ignored when defining the Span's trace +// identifiers. +func WithNewRoot() SpanStartOption { + return spanOptionFunc(func(cfg SpanConfig) SpanConfig { + cfg.newRoot = true + return cfg + }) +} + +// WithSpanKind sets the SpanKind of a Span. +func WithSpanKind(kind SpanKind) SpanStartOption { + return spanOptionFunc(func(cfg SpanConfig) SpanConfig { + cfg.spanKind = kind + return cfg + }) +} + +// WithInstrumentationVersion sets the instrumentation version. +func WithInstrumentationVersion(version string) TracerOption { + return tracerOptionFunc(func(cfg TracerConfig) TracerConfig { + cfg.instrumentationVersion = version + return cfg + }) +} + +// WithInstrumentationAttributes sets the instrumentation attributes. +// +// The passed attributes will be de-duplicated. +func WithInstrumentationAttributes(attr ...attribute.KeyValue) TracerOption { + return tracerOptionFunc(func(config TracerConfig) TracerConfig { + config.attrs = attribute.NewSet(attr...) + return config + }) +} + +// WithSchemaURL sets the schema URL for the Tracer. +func WithSchemaURL(schemaURL string) TracerOption { + return tracerOptionFunc(func(cfg TracerConfig) TracerConfig { + cfg.schemaURL = schemaURL + return cfg + }) +} diff --git a/vendor/go.opentelemetry.io/otel/trace/context.go b/vendor/go.opentelemetry.io/otel/trace/context.go new file mode 100644 index 000000000..76f9a083c --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/trace/context.go @@ -0,0 +1,61 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package trace // import "go.opentelemetry.io/otel/trace" + +import "context" + +type traceContextKeyType int + +const currentSpanKey traceContextKeyType = iota + +// ContextWithSpan returns a copy of parent with span set as the current Span. +func ContextWithSpan(parent context.Context, span Span) context.Context { + return context.WithValue(parent, currentSpanKey, span) +} + +// ContextWithSpanContext returns a copy of parent with sc as the current +// Span. The Span implementation that wraps sc is non-recording and performs +// no operations other than to return sc as the SpanContext from the +// SpanContext method. +func ContextWithSpanContext(parent context.Context, sc SpanContext) context.Context { + return ContextWithSpan(parent, nonRecordingSpan{sc: sc}) +} + +// ContextWithRemoteSpanContext returns a copy of parent with rsc set explicly +// as a remote SpanContext and as the current Span. The Span implementation +// that wraps rsc is non-recording and performs no operations other than to +// return rsc as the SpanContext from the SpanContext method. +func ContextWithRemoteSpanContext(parent context.Context, rsc SpanContext) context.Context { + return ContextWithSpanContext(parent, rsc.WithRemote(true)) +} + +// SpanFromContext returns the current Span from ctx. +// +// If no Span is currently set in ctx an implementation of a Span that +// performs no operations is returned. +func SpanFromContext(ctx context.Context) Span { + if ctx == nil { + return noopSpan{} + } + if span, ok := ctx.Value(currentSpanKey).(Span); ok { + return span + } + return noopSpan{} +} + +// SpanContextFromContext returns the current Span's SpanContext. +func SpanContextFromContext(ctx context.Context) SpanContext { + return SpanFromContext(ctx).SpanContext() +} diff --git a/vendor/go.opentelemetry.io/otel/trace/doc.go b/vendor/go.opentelemetry.io/otel/trace/doc.go new file mode 100644 index 000000000..440f3d756 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/trace/doc.go @@ -0,0 +1,130 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* +Package trace provides an implementation of the tracing part of the +OpenTelemetry API. + +To participate in distributed traces a Span needs to be created for the +operation being performed as part of a traced workflow. In its simplest form: + + var tracer trace.Tracer + + func init() { + tracer = otel.Tracer("instrumentation/package/name") + } + + func operation(ctx context.Context) { + var span trace.Span + ctx, span = tracer.Start(ctx, "operation") + defer span.End() + // ... + } + +A Tracer is unique to the instrumentation and is used to create Spans. +Instrumentation should be designed to accept a TracerProvider from which it +can create its own unique Tracer. Alternatively, the registered global +TracerProvider from the go.opentelemetry.io/otel package can be used as +a default. + + const ( + name = "instrumentation/package/name" + version = "0.1.0" + ) + + type Instrumentation struct { + tracer trace.Tracer + } + + func NewInstrumentation(tp trace.TracerProvider) *Instrumentation { + if tp == nil { + tp = otel.TracerProvider() + } + return &Instrumentation{ + tracer: tp.Tracer(name, trace.WithInstrumentationVersion(version)), + } + } + + func operation(ctx context.Context, inst *Instrumentation) { + var span trace.Span + ctx, span = inst.tracer.Start(ctx, "operation") + defer span.End() + // ... + } + +# API Implementations + +This package does not conform to the standard Go versioning policy; all of its +interfaces may have methods added to them without a package major version bump. +This non-standard API evolution could surprise an uninformed implementation +author. They could unknowingly build their implementation in a way that would +result in a runtime panic for their users that update to the new API. + +The API is designed to help inform an instrumentation author about this +non-standard API evolution. It requires them to choose a default behavior for +unimplemented interface methods. There are three behavior choices they can +make: + + - Compilation failure + - Panic + - Default to another implementation + +All interfaces in this API embed a corresponding interface from +[go.opentelemetry.io/otel/trace/embedded]. If an author wants the default +behavior of their implementations to be a compilation failure, signaling to +their users they need to update to the latest version of that implementation, +they need to embed the corresponding interface from +[go.opentelemetry.io/otel/trace/embedded] in their implementation. For +example, + + import "go.opentelemetry.io/otel/trace/embedded" + + type TracerProvider struct { + embedded.TracerProvider + // ... + } + +If an author wants the default behavior of their implementations to panic, they +can embed the API interface directly. + + import "go.opentelemetry.io/otel/trace" + + type TracerProvider struct { + trace.TracerProvider + // ... + } + +This option is not recommended. It will lead to publishing packages that +contain runtime panics when users update to newer versions of +[go.opentelemetry.io/otel/trace], which may be done with a trasitive +dependency. + +Finally, an author can embed another implementation in theirs. The embedded +implementation will be used for methods not defined by the author. For example, +an author who wants to default to silently dropping the call can use +[go.opentelemetry.io/otel/trace/noop]: + + import "go.opentelemetry.io/otel/trace/noop" + + type TracerProvider struct { + noop.TracerProvider + // ... + } + +It is strongly recommended that authors only embed +[go.opentelemetry.io/otel/trace/noop] if they choose this default behavior. +That implementation is the only one OpenTelemetry authors can guarantee will +fully implement all the API interfaces when a user updates their API. +*/ +package trace // import "go.opentelemetry.io/otel/trace" diff --git a/vendor/go.opentelemetry.io/otel/trace/embedded/embedded.go b/vendor/go.opentelemetry.io/otel/trace/embedded/embedded.go new file mode 100644 index 000000000..898db5a75 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/trace/embedded/embedded.go @@ -0,0 +1,56 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package embedded provides interfaces embedded within the [OpenTelemetry +// trace API]. +// +// Implementers of the [OpenTelemetry trace API] can embed the relevant type +// from this package into their implementation directly. Doing so will result +// in a compilation error for users when the [OpenTelemetry trace API] is +// extended (which is something that can happen without a major version bump of +// the API package). +// +// [OpenTelemetry trace API]: https://pkg.go.dev/go.opentelemetry.io/otel/trace +package embedded // import "go.opentelemetry.io/otel/trace/embedded" + +// TracerProvider is embedded in +// [go.opentelemetry.io/otel/trace.TracerProvider]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/trace.TracerProvider] if you want users to +// experience a compilation error, signaling they need to update to your latest +// implementation, when the [go.opentelemetry.io/otel/trace.TracerProvider] +// interface is extended (which is something that can happen without a major +// version bump of the API package). +type TracerProvider interface{ tracerProvider() } + +// Tracer is embedded in [go.opentelemetry.io/otel/trace.Tracer]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/trace.Tracer] if you want users to experience a +// compilation error, signaling they need to update to your latest +// implementation, when the [go.opentelemetry.io/otel/trace.Tracer] interface +// is extended (which is something that can happen without a major version bump +// of the API package). +type Tracer interface{ tracer() } + +// Span is embedded in [go.opentelemetry.io/otel/trace.Span]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/trace.Span] if you want users to experience a +// compilation error, signaling they need to update to your latest +// implementation, when the [go.opentelemetry.io/otel/trace.Span] interface is +// extended (which is something that can happen without a major version bump of +// the API package). +type Span interface{ span() } diff --git a/vendor/go.opentelemetry.io/otel/trace/nonrecording.go b/vendor/go.opentelemetry.io/otel/trace/nonrecording.go new file mode 100644 index 000000000..88fcb8161 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/trace/nonrecording.go @@ -0,0 +1,27 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package trace // import "go.opentelemetry.io/otel/trace" + +// nonRecordingSpan is a minimal implementation of a Span that wraps a +// SpanContext. It performs no operations other than to return the wrapped +// SpanContext. +type nonRecordingSpan struct { + noopSpan + + sc SpanContext +} + +// SpanContext returns the wrapped SpanContext. +func (s nonRecordingSpan) SpanContext() SpanContext { return s.sc } diff --git a/vendor/go.opentelemetry.io/otel/trace/noop.go b/vendor/go.opentelemetry.io/otel/trace/noop.go new file mode 100644 index 000000000..c125491ca --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/trace/noop.go @@ -0,0 +1,93 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package trace // import "go.opentelemetry.io/otel/trace" + +import ( + "context" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/codes" + "go.opentelemetry.io/otel/trace/embedded" +) + +// NewNoopTracerProvider returns an implementation of TracerProvider that +// performs no operations. The Tracer and Spans created from the returned +// TracerProvider also perform no operations. +// +// Deprecated: Use [go.opentelemetry.io/otel/trace/noop.NewTracerProvider] +// instead. +func NewNoopTracerProvider() TracerProvider { + return noopTracerProvider{} +} + +type noopTracerProvider struct{ embedded.TracerProvider } + +var _ TracerProvider = noopTracerProvider{} + +// Tracer returns noop implementation of Tracer. +func (p noopTracerProvider) Tracer(string, ...TracerOption) Tracer { + return noopTracer{} +} + +// noopTracer is an implementation of Tracer that performs no operations. +type noopTracer struct{ embedded.Tracer } + +var _ Tracer = noopTracer{} + +// Start carries forward a non-recording Span, if one is present in the context, otherwise it +// creates a no-op Span. +func (t noopTracer) Start(ctx context.Context, name string, _ ...SpanStartOption) (context.Context, Span) { + span := SpanFromContext(ctx) + if _, ok := span.(nonRecordingSpan); !ok { + // span is likely already a noopSpan, but let's be sure + span = noopSpan{} + } + return ContextWithSpan(ctx, span), span +} + +// noopSpan is an implementation of Span that performs no operations. +type noopSpan struct{ embedded.Span } + +var _ Span = noopSpan{} + +// SpanContext returns an empty span context. +func (noopSpan) SpanContext() SpanContext { return SpanContext{} } + +// IsRecording always returns false. +func (noopSpan) IsRecording() bool { return false } + +// SetStatus does nothing. +func (noopSpan) SetStatus(codes.Code, string) {} + +// SetError does nothing. +func (noopSpan) SetError(bool) {} + +// SetAttributes does nothing. +func (noopSpan) SetAttributes(...attribute.KeyValue) {} + +// End does nothing. +func (noopSpan) End(...SpanEndOption) {} + +// RecordError does nothing. +func (noopSpan) RecordError(error, ...EventOption) {} + +// AddEvent does nothing. +func (noopSpan) AddEvent(string, ...EventOption) {} + +// SetName does nothing. +func (noopSpan) SetName(string) {} + +// TracerProvider returns a no-op TracerProvider. +func (noopSpan) TracerProvider() TracerProvider { return noopTracerProvider{} } diff --git a/vendor/go.opentelemetry.io/otel/trace/trace.go b/vendor/go.opentelemetry.io/otel/trace/trace.go new file mode 100644 index 000000000..26a4b2260 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/trace/trace.go @@ -0,0 +1,577 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package trace // import "go.opentelemetry.io/otel/trace" + +import ( + "bytes" + "context" + "encoding/hex" + "encoding/json" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/codes" + "go.opentelemetry.io/otel/trace/embedded" +) + +const ( + // FlagsSampled is a bitmask with the sampled bit set. A SpanContext + // with the sampling bit set means the span is sampled. + FlagsSampled = TraceFlags(0x01) + + errInvalidHexID errorConst = "trace-id and span-id can only contain [0-9a-f] characters, all lowercase" + + errInvalidTraceIDLength errorConst = "hex encoded trace-id must have length equals to 32" + errNilTraceID errorConst = "trace-id can't be all zero" + + errInvalidSpanIDLength errorConst = "hex encoded span-id must have length equals to 16" + errNilSpanID errorConst = "span-id can't be all zero" +) + +type errorConst string + +func (e errorConst) Error() string { + return string(e) +} + +// TraceID is a unique identity of a trace. +// nolint:revive // revive complains about stutter of `trace.TraceID`. +type TraceID [16]byte + +var ( + nilTraceID TraceID + _ json.Marshaler = nilTraceID +) + +// IsValid checks whether the trace TraceID is valid. A valid trace ID does +// not consist of zeros only. +func (t TraceID) IsValid() bool { + return !bytes.Equal(t[:], nilTraceID[:]) +} + +// MarshalJSON implements a custom marshal function to encode TraceID +// as a hex string. +func (t TraceID) MarshalJSON() ([]byte, error) { + return json.Marshal(t.String()) +} + +// String returns the hex string representation form of a TraceID. +func (t TraceID) String() string { + return hex.EncodeToString(t[:]) +} + +// SpanID is a unique identity of a span in a trace. +type SpanID [8]byte + +var ( + nilSpanID SpanID + _ json.Marshaler = nilSpanID +) + +// IsValid checks whether the SpanID is valid. A valid SpanID does not consist +// of zeros only. +func (s SpanID) IsValid() bool { + return !bytes.Equal(s[:], nilSpanID[:]) +} + +// MarshalJSON implements a custom marshal function to encode SpanID +// as a hex string. +func (s SpanID) MarshalJSON() ([]byte, error) { + return json.Marshal(s.String()) +} + +// String returns the hex string representation form of a SpanID. +func (s SpanID) String() string { + return hex.EncodeToString(s[:]) +} + +// TraceIDFromHex returns a TraceID from a hex string if it is compliant with +// the W3C trace-context specification. See more at +// https://www.w3.org/TR/trace-context/#trace-id +// nolint:revive // revive complains about stutter of `trace.TraceIDFromHex`. +func TraceIDFromHex(h string) (TraceID, error) { + t := TraceID{} + if len(h) != 32 { + return t, errInvalidTraceIDLength + } + + if err := decodeHex(h, t[:]); err != nil { + return t, err + } + + if !t.IsValid() { + return t, errNilTraceID + } + return t, nil +} + +// SpanIDFromHex returns a SpanID from a hex string if it is compliant +// with the w3c trace-context specification. +// See more at https://www.w3.org/TR/trace-context/#parent-id +func SpanIDFromHex(h string) (SpanID, error) { + s := SpanID{} + if len(h) != 16 { + return s, errInvalidSpanIDLength + } + + if err := decodeHex(h, s[:]); err != nil { + return s, err + } + + if !s.IsValid() { + return s, errNilSpanID + } + return s, nil +} + +func decodeHex(h string, b []byte) error { + for _, r := range h { + switch { + case 'a' <= r && r <= 'f': + continue + case '0' <= r && r <= '9': + continue + default: + return errInvalidHexID + } + } + + decoded, err := hex.DecodeString(h) + if err != nil { + return err + } + + copy(b, decoded) + return nil +} + +// TraceFlags contains flags that can be set on a SpanContext. +type TraceFlags byte //nolint:revive // revive complains about stutter of `trace.TraceFlags`. + +// IsSampled returns if the sampling bit is set in the TraceFlags. +func (tf TraceFlags) IsSampled() bool { + return tf&FlagsSampled == FlagsSampled +} + +// WithSampled sets the sampling bit in a new copy of the TraceFlags. +func (tf TraceFlags) WithSampled(sampled bool) TraceFlags { // nolint:revive // sampled is not a control flag. + if sampled { + return tf | FlagsSampled + } + + return tf &^ FlagsSampled +} + +// MarshalJSON implements a custom marshal function to encode TraceFlags +// as a hex string. +func (tf TraceFlags) MarshalJSON() ([]byte, error) { + return json.Marshal(tf.String()) +} + +// String returns the hex string representation form of TraceFlags. +func (tf TraceFlags) String() string { + return hex.EncodeToString([]byte{byte(tf)}[:]) +} + +// SpanContextConfig contains mutable fields usable for constructing +// an immutable SpanContext. +type SpanContextConfig struct { + TraceID TraceID + SpanID SpanID + TraceFlags TraceFlags + TraceState TraceState + Remote bool +} + +// NewSpanContext constructs a SpanContext using values from the provided +// SpanContextConfig. +func NewSpanContext(config SpanContextConfig) SpanContext { + return SpanContext{ + traceID: config.TraceID, + spanID: config.SpanID, + traceFlags: config.TraceFlags, + traceState: config.TraceState, + remote: config.Remote, + } +} + +// SpanContext contains identifying trace information about a Span. +type SpanContext struct { + traceID TraceID + spanID SpanID + traceFlags TraceFlags + traceState TraceState + remote bool +} + +var _ json.Marshaler = SpanContext{} + +// IsValid returns if the SpanContext is valid. A valid span context has a +// valid TraceID and SpanID. +func (sc SpanContext) IsValid() bool { + return sc.HasTraceID() && sc.HasSpanID() +} + +// IsRemote indicates whether the SpanContext represents a remotely-created Span. +func (sc SpanContext) IsRemote() bool { + return sc.remote +} + +// WithRemote returns a copy of sc with the Remote property set to remote. +func (sc SpanContext) WithRemote(remote bool) SpanContext { + return SpanContext{ + traceID: sc.traceID, + spanID: sc.spanID, + traceFlags: sc.traceFlags, + traceState: sc.traceState, + remote: remote, + } +} + +// TraceID returns the TraceID from the SpanContext. +func (sc SpanContext) TraceID() TraceID { + return sc.traceID +} + +// HasTraceID checks if the SpanContext has a valid TraceID. +func (sc SpanContext) HasTraceID() bool { + return sc.traceID.IsValid() +} + +// WithTraceID returns a new SpanContext with the TraceID replaced. +func (sc SpanContext) WithTraceID(traceID TraceID) SpanContext { + return SpanContext{ + traceID: traceID, + spanID: sc.spanID, + traceFlags: sc.traceFlags, + traceState: sc.traceState, + remote: sc.remote, + } +} + +// SpanID returns the SpanID from the SpanContext. +func (sc SpanContext) SpanID() SpanID { + return sc.spanID +} + +// HasSpanID checks if the SpanContext has a valid SpanID. +func (sc SpanContext) HasSpanID() bool { + return sc.spanID.IsValid() +} + +// WithSpanID returns a new SpanContext with the SpanID replaced. +func (sc SpanContext) WithSpanID(spanID SpanID) SpanContext { + return SpanContext{ + traceID: sc.traceID, + spanID: spanID, + traceFlags: sc.traceFlags, + traceState: sc.traceState, + remote: sc.remote, + } +} + +// TraceFlags returns the flags from the SpanContext. +func (sc SpanContext) TraceFlags() TraceFlags { + return sc.traceFlags +} + +// IsSampled returns if the sampling bit is set in the SpanContext's TraceFlags. +func (sc SpanContext) IsSampled() bool { + return sc.traceFlags.IsSampled() +} + +// WithTraceFlags returns a new SpanContext with the TraceFlags replaced. +func (sc SpanContext) WithTraceFlags(flags TraceFlags) SpanContext { + return SpanContext{ + traceID: sc.traceID, + spanID: sc.spanID, + traceFlags: flags, + traceState: sc.traceState, + remote: sc.remote, + } +} + +// TraceState returns the TraceState from the SpanContext. +func (sc SpanContext) TraceState() TraceState { + return sc.traceState +} + +// WithTraceState returns a new SpanContext with the TraceState replaced. +func (sc SpanContext) WithTraceState(state TraceState) SpanContext { + return SpanContext{ + traceID: sc.traceID, + spanID: sc.spanID, + traceFlags: sc.traceFlags, + traceState: state, + remote: sc.remote, + } +} + +// Equal is a predicate that determines whether two SpanContext values are equal. +func (sc SpanContext) Equal(other SpanContext) bool { + return sc.traceID == other.traceID && + sc.spanID == other.spanID && + sc.traceFlags == other.traceFlags && + sc.traceState.String() == other.traceState.String() && + sc.remote == other.remote +} + +// MarshalJSON implements a custom marshal function to encode a SpanContext. +func (sc SpanContext) MarshalJSON() ([]byte, error) { + return json.Marshal(SpanContextConfig{ + TraceID: sc.traceID, + SpanID: sc.spanID, + TraceFlags: sc.traceFlags, + TraceState: sc.traceState, + Remote: sc.remote, + }) +} + +// Span is the individual component of a trace. It represents a single named +// and timed operation of a workflow that is traced. A Tracer is used to +// create a Span and it is then up to the operation the Span represents to +// properly end the Span when the operation itself ends. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Span interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Span + + // End completes the Span. The Span is considered complete and ready to be + // delivered through the rest of the telemetry pipeline after this method + // is called. Therefore, updates to the Span are not allowed after this + // method has been called. + End(options ...SpanEndOption) + + // AddEvent adds an event with the provided name and options. + AddEvent(name string, options ...EventOption) + + // IsRecording returns the recording state of the Span. It will return + // true if the Span is active and events can be recorded. + IsRecording() bool + + // RecordError will record err as an exception span event for this span. An + // additional call to SetStatus is required if the Status of the Span should + // be set to Error, as this method does not change the Span status. If this + // span is not being recorded or err is nil then this method does nothing. + RecordError(err error, options ...EventOption) + + // SpanContext returns the SpanContext of the Span. The returned SpanContext + // is usable even after the End method has been called for the Span. + SpanContext() SpanContext + + // SetStatus sets the status of the Span in the form of a code and a + // description, provided the status hasn't already been set to a higher + // value before (OK > Error > Unset). The description is only included in a + // status when the code is for an error. + SetStatus(code codes.Code, description string) + + // SetName sets the Span name. + SetName(name string) + + // SetAttributes sets kv as attributes of the Span. If a key from kv + // already exists for an attribute of the Span it will be overwritten with + // the value contained in kv. + SetAttributes(kv ...attribute.KeyValue) + + // TracerProvider returns a TracerProvider that can be used to generate + // additional Spans on the same telemetry pipeline as the current Span. + TracerProvider() TracerProvider +} + +// Link is the relationship between two Spans. The relationship can be within +// the same Trace or across different Traces. +// +// For example, a Link is used in the following situations: +// +// 1. Batch Processing: A batch of operations may contain operations +// associated with one or more traces/spans. Since there can only be one +// parent SpanContext, a Link is used to keep reference to the +// SpanContext of all operations in the batch. +// 2. Public Endpoint: A SpanContext for an in incoming client request on a +// public endpoint should be considered untrusted. In such a case, a new +// trace with its own identity and sampling decision needs to be created, +// but this new trace needs to be related to the original trace in some +// form. A Link is used to keep reference to the original SpanContext and +// track the relationship. +type Link struct { + // SpanContext of the linked Span. + SpanContext SpanContext + + // Attributes describe the aspects of the link. + Attributes []attribute.KeyValue +} + +// LinkFromContext returns a link encapsulating the SpanContext in the provided ctx. +func LinkFromContext(ctx context.Context, attrs ...attribute.KeyValue) Link { + return Link{ + SpanContext: SpanContextFromContext(ctx), + Attributes: attrs, + } +} + +// SpanKind is the role a Span plays in a Trace. +type SpanKind int + +// As a convenience, these match the proto definition, see +// https://github.com/open-telemetry/opentelemetry-proto/blob/30d237e1ff3ab7aa50e0922b5bebdd93505090af/opentelemetry/proto/trace/v1/trace.proto#L101-L129 +// +// The unspecified value is not a valid `SpanKind`. Use `ValidateSpanKind()` +// to coerce a span kind to a valid value. +const ( + // SpanKindUnspecified is an unspecified SpanKind and is not a valid + // SpanKind. SpanKindUnspecified should be replaced with SpanKindInternal + // if it is received. + SpanKindUnspecified SpanKind = 0 + // SpanKindInternal is a SpanKind for a Span that represents an internal + // operation within an application. + SpanKindInternal SpanKind = 1 + // SpanKindServer is a SpanKind for a Span that represents the operation + // of handling a request from a client. + SpanKindServer SpanKind = 2 + // SpanKindClient is a SpanKind for a Span that represents the operation + // of client making a request to a server. + SpanKindClient SpanKind = 3 + // SpanKindProducer is a SpanKind for a Span that represents the operation + // of a producer sending a message to a message broker. Unlike + // SpanKindClient and SpanKindServer, there is often no direct + // relationship between this kind of Span and a SpanKindConsumer kind. A + // SpanKindProducer Span will end once the message is accepted by the + // message broker which might not overlap with the processing of that + // message. + SpanKindProducer SpanKind = 4 + // SpanKindConsumer is a SpanKind for a Span that represents the operation + // of a consumer receiving a message from a message broker. Like + // SpanKindProducer Spans, there is often no direct relationship between + // this Span and the Span that produced the message. + SpanKindConsumer SpanKind = 5 +) + +// ValidateSpanKind returns a valid span kind value. This will coerce +// invalid values into the default value, SpanKindInternal. +func ValidateSpanKind(spanKind SpanKind) SpanKind { + switch spanKind { + case SpanKindInternal, + SpanKindServer, + SpanKindClient, + SpanKindProducer, + SpanKindConsumer: + // valid + return spanKind + default: + return SpanKindInternal + } +} + +// String returns the specified name of the SpanKind in lower-case. +func (sk SpanKind) String() string { + switch sk { + case SpanKindInternal: + return "internal" + case SpanKindServer: + return "server" + case SpanKindClient: + return "client" + case SpanKindProducer: + return "producer" + case SpanKindConsumer: + return "consumer" + default: + return "unspecified" + } +} + +// Tracer is the creator of Spans. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Tracer interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Tracer + + // Start creates a span and a context.Context containing the newly-created span. + // + // If the context.Context provided in `ctx` contains a Span then the newly-created + // Span will be a child of that span, otherwise it will be a root span. This behavior + // can be overridden by providing `WithNewRoot()` as a SpanOption, causing the + // newly-created Span to be a root span even if `ctx` contains a Span. + // + // When creating a Span it is recommended to provide all known span attributes using + // the `WithAttributes()` SpanOption as samplers will only have access to the + // attributes provided when a Span is created. + // + // Any Span that is created MUST also be ended. This is the responsibility of the user. + // Implementations of this API may leak memory or other resources if Spans are not ended. + Start(ctx context.Context, spanName string, opts ...SpanStartOption) (context.Context, Span) +} + +// TracerProvider provides Tracers that are used by instrumentation code to +// trace computational workflows. +// +// A TracerProvider is the collection destination of all Spans from Tracers it +// provides, it represents a unique telemetry collection pipeline. How that +// pipeline is defined, meaning how those Spans are collected, processed, and +// where they are exported, depends on its implementation. Instrumentation +// authors do not need to define this implementation, rather just use the +// provided Tracers to instrument code. +// +// Commonly, instrumentation code will accept a TracerProvider implementation +// at runtime from its users or it can simply use the globally registered one +// (see https://pkg.go.dev/go.opentelemetry.io/otel#GetTracerProvider). +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type TracerProvider interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.TracerProvider + + // Tracer returns a unique Tracer scoped to be used by instrumentation code + // to trace computational workflows. The scope and identity of that + // instrumentation code is uniquely defined by the name and options passed. + // + // The passed name needs to uniquely identify instrumentation code. + // Therefore, it is recommended that name is the Go package name of the + // library providing instrumentation (note: not the code being + // instrumented). Instrumentation libraries can have multiple versions, + // therefore, the WithInstrumentationVersion option should be used to + // distinguish these different codebases. Additionally, instrumentation + // libraries may sometimes use traces to communicate different domains of + // workflow data (i.e. using spans to communicate workflow events only). If + // this is the case, the WithScopeAttributes option should be used to + // uniquely identify Tracers that handle the different domains of workflow + // data. + // + // If the same name and options are passed multiple times, the same Tracer + // will be returned (it is up to the implementation if this will be the + // same underlying instance of that Tracer or not). It is not necessary to + // call this multiple times with the same name and options to get an + // up-to-date Tracer. All implementations will ensure any TracerProvider + // configuration changes are propagated to all provided Tracers. + // + // If name is empty, then an implementation defined default name will be + // used instead. + // + // This method is safe to call concurrently. + Tracer(name string, options ...TracerOption) Tracer +} diff --git a/vendor/go.opentelemetry.io/otel/trace/tracestate.go b/vendor/go.opentelemetry.io/otel/trace/tracestate.go new file mode 100644 index 000000000..d1e47ca2f --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/trace/tracestate.go @@ -0,0 +1,222 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package trace // import "go.opentelemetry.io/otel/trace" + +import ( + "encoding/json" + "fmt" + "regexp" + "strings" +) + +const ( + maxListMembers = 32 + + listDelimiter = "," + + // based on the W3C Trace Context specification, see + // https://www.w3.org/TR/trace-context-1/#tracestate-header + noTenantKeyFormat = `[a-z][_0-9a-z\-\*\/]*` + withTenantKeyFormat = `[a-z0-9][_0-9a-z\-\*\/]*@[a-z][_0-9a-z\-\*\/]*` + valueFormat = `[\x20-\x2b\x2d-\x3c\x3e-\x7e]*[\x21-\x2b\x2d-\x3c\x3e-\x7e]` + + errInvalidKey errorConst = "invalid tracestate key" + errInvalidValue errorConst = "invalid tracestate value" + errInvalidMember errorConst = "invalid tracestate list-member" + errMemberNumber errorConst = "too many list-members in tracestate" + errDuplicate errorConst = "duplicate list-member in tracestate" +) + +var ( + noTenantKeyRe = regexp.MustCompile(`^` + noTenantKeyFormat + `$`) + withTenantKeyRe = regexp.MustCompile(`^` + withTenantKeyFormat + `$`) + valueRe = regexp.MustCompile(`^` + valueFormat + `$`) + memberRe = regexp.MustCompile(`^\s*((?:` + noTenantKeyFormat + `)|(?:` + withTenantKeyFormat + `))=(` + valueFormat + `)\s*$`) +) + +type member struct { + Key string + Value string +} + +func newMember(key, value string) (member, error) { + if len(key) > 256 { + return member{}, fmt.Errorf("%w: %s", errInvalidKey, key) + } + if !noTenantKeyRe.MatchString(key) { + if !withTenantKeyRe.MatchString(key) { + return member{}, fmt.Errorf("%w: %s", errInvalidKey, key) + } + atIndex := strings.LastIndex(key, "@") + if atIndex > 241 || len(key)-1-atIndex > 14 { + return member{}, fmt.Errorf("%w: %s", errInvalidKey, key) + } + } + if len(value) > 256 || !valueRe.MatchString(value) { + return member{}, fmt.Errorf("%w: %s", errInvalidValue, value) + } + return member{Key: key, Value: value}, nil +} + +func parseMember(m string) (member, error) { + matches := memberRe.FindStringSubmatch(m) + if len(matches) != 3 { + return member{}, fmt.Errorf("%w: %s", errInvalidMember, m) + } + result, e := newMember(matches[1], matches[2]) + if e != nil { + return member{}, fmt.Errorf("%w: %s", errInvalidMember, m) + } + return result, nil +} + +// String encodes member into a string compliant with the W3C Trace Context +// specification. +func (m member) String() string { + return fmt.Sprintf("%s=%s", m.Key, m.Value) +} + +// TraceState provides additional vendor-specific trace identification +// information across different distributed tracing systems. It represents an +// immutable list consisting of key/value pairs, each pair is referred to as a +// list-member. +// +// TraceState conforms to the W3C Trace Context specification +// (https://www.w3.org/TR/trace-context-1). All operations that create or copy +// a TraceState do so by validating all input and will only produce TraceState +// that conform to the specification. Specifically, this means that all +// list-member's key/value pairs are valid, no duplicate list-members exist, +// and the maximum number of list-members (32) is not exceeded. +type TraceState struct { //nolint:revive // revive complains about stutter of `trace.TraceState` + // list is the members in order. + list []member +} + +var _ json.Marshaler = TraceState{} + +// ParseTraceState attempts to decode a TraceState from the passed +// string. It returns an error if the input is invalid according to the W3C +// Trace Context specification. +func ParseTraceState(tracestate string) (TraceState, error) { + if tracestate == "" { + return TraceState{}, nil + } + + wrapErr := func(err error) error { + return fmt.Errorf("failed to parse tracestate: %w", err) + } + + var members []member + found := make(map[string]struct{}) + for _, memberStr := range strings.Split(tracestate, listDelimiter) { + if len(memberStr) == 0 { + continue + } + + m, err := parseMember(memberStr) + if err != nil { + return TraceState{}, wrapErr(err) + } + + if _, ok := found[m.Key]; ok { + return TraceState{}, wrapErr(errDuplicate) + } + found[m.Key] = struct{}{} + + members = append(members, m) + if n := len(members); n > maxListMembers { + return TraceState{}, wrapErr(errMemberNumber) + } + } + + return TraceState{list: members}, nil +} + +// MarshalJSON marshals the TraceState into JSON. +func (ts TraceState) MarshalJSON() ([]byte, error) { + return json.Marshal(ts.String()) +} + +// String encodes the TraceState into a string compliant with the W3C +// Trace Context specification. The returned string will be invalid if the +// TraceState contains any invalid members. +func (ts TraceState) String() string { + members := make([]string, len(ts.list)) + for i, m := range ts.list { + members[i] = m.String() + } + return strings.Join(members, listDelimiter) +} + +// Get returns the value paired with key from the corresponding TraceState +// list-member if it exists, otherwise an empty string is returned. +func (ts TraceState) Get(key string) string { + for _, member := range ts.list { + if member.Key == key { + return member.Value + } + } + + return "" +} + +// Insert adds a new list-member defined by the key/value pair to the +// TraceState. If a list-member already exists for the given key, that +// list-member's value is updated. The new or updated list-member is always +// moved to the beginning of the TraceState as specified by the W3C Trace +// Context specification. +// +// If key or value are invalid according to the W3C Trace Context +// specification an error is returned with the original TraceState. +// +// If adding a new list-member means the TraceState would have more members +// then is allowed, the new list-member will be inserted and the right-most +// list-member will be dropped in the returned TraceState. +func (ts TraceState) Insert(key, value string) (TraceState, error) { + m, err := newMember(key, value) + if err != nil { + return ts, err + } + + cTS := ts.Delete(key) + if cTS.Len()+1 <= maxListMembers { + cTS.list = append(cTS.list, member{}) + } + // When the number of members exceeds capacity, drop the "right-most". + copy(cTS.list[1:], cTS.list) + cTS.list[0] = m + + return cTS, nil +} + +// Delete returns a copy of the TraceState with the list-member identified by +// key removed. +func (ts TraceState) Delete(key string) TraceState { + members := make([]member, ts.Len()) + copy(members, ts.list) + for i, member := range ts.list { + if member.Key == key { + members = append(members[:i], members[i+1:]...) + // TraceState should contain no duplicate members. + break + } + } + return TraceState{list: members} +} + +// Len returns the number of list-members in the TraceState. +func (ts TraceState) Len() int { + return len(ts.list) +} diff --git a/vendor/go.opentelemetry.io/otel/verify_examples.sh b/vendor/go.opentelemetry.io/otel/verify_examples.sh new file mode 100644 index 000000000..dbb61a422 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/verify_examples.sh @@ -0,0 +1,85 @@ +#!/bin/bash + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -euo pipefail + +cd $(dirname $0) +TOOLS_DIR=$(pwd)/.tools + +if [ -z "${GOPATH}" ] ; then + printf "GOPATH is not defined.\n" + exit -1 +fi + +if [ ! -d "${GOPATH}" ] ; then + printf "GOPATH ${GOPATH} is invalid \n" + exit -1 +fi + +# Pre-requisites +if ! git diff --quiet; then \ + git status + printf "\n\nError: working tree is not clean\n" + exit -1 +fi + +if [ "$(git tag --contains $(git log -1 --pretty=format:"%H"))" = "" ] ; then + printf "$(git log -1)" + printf "\n\nError: HEAD is not pointing to a tagged version" +fi + +make ${TOOLS_DIR}/gojq + +DIR_TMP="${GOPATH}/src/oteltmp/" +rm -rf $DIR_TMP +mkdir -p $DIR_TMP + +printf "Copy examples to ${DIR_TMP}\n" +cp -a ./example ${DIR_TMP} + +# Update go.mod files +printf "Update go.mod: rename module and remove replace\n" + +PACKAGE_DIRS=$(find . -mindepth 2 -type f -name 'go.mod' -exec dirname {} \; | egrep 'example' | sed 's/^\.\///' | sort) + +for dir in $PACKAGE_DIRS; do + printf " Update go.mod for $dir\n" + (cd "${DIR_TMP}/${dir}" && \ + # replaces is ("mod1" "mod2" …) + replaces=($(go mod edit -json | ${TOOLS_DIR}/gojq '.Replace[].Old.Path')) && \ + # strip double quotes + replaces=("${replaces[@]%\"}") && \ + replaces=("${replaces[@]#\"}") && \ + # make an array (-dropreplace=mod1 -dropreplace=mod2 …) + dropreplaces=("${replaces[@]/#/-dropreplace=}") && \ + go mod edit -module "oteltmp/${dir}" "${dropreplaces[@]}" && \ + go mod tidy) +done +printf "Update done:\n\n" + +# Build directories that contain main package. These directories are different than +# directories that contain go.mod files. +printf "Build examples:\n" +EXAMPLES=$(./get_main_pkgs.sh ./example) +for ex in $EXAMPLES; do + printf " Build $ex in ${DIR_TMP}/${ex}\n" + (cd "${DIR_TMP}/${ex}" && \ + go build .) +done + +# Cleanup +printf "Remove copied files.\n" +rm -rf $DIR_TMP diff --git a/vendor/go.opentelemetry.io/otel/version.go b/vendor/go.opentelemetry.io/otel/version.go new file mode 100644 index 000000000..e2f743585 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/version.go @@ -0,0 +1,20 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otel // import "go.opentelemetry.io/otel" + +// Version is the current release version of OpenTelemetry in use. +func Version() string { + return "1.21.0" +} diff --git a/vendor/go.opentelemetry.io/otel/versions.yaml b/vendor/go.opentelemetry.io/otel/versions.yaml new file mode 100644 index 000000000..3c153c9d6 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/versions.yaml @@ -0,0 +1,52 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +module-sets: + stable-v1: + version: v1.21.0 + modules: + - go.opentelemetry.io/otel + - go.opentelemetry.io/otel/bridge/opentracing + - go.opentelemetry.io/otel/bridge/opentracing/test + - go.opentelemetry.io/otel/example/dice + - go.opentelemetry.io/otel/example/namedtracer + - go.opentelemetry.io/otel/example/otel-collector + - go.opentelemetry.io/otel/example/passthrough + - go.opentelemetry.io/otel/example/zipkin + - go.opentelemetry.io/otel/exporters/otlp/otlptrace + - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc + - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp + - go.opentelemetry.io/otel/exporters/stdout/stdouttrace + - go.opentelemetry.io/otel/exporters/zipkin + - go.opentelemetry.io/otel/metric + - go.opentelemetry.io/otel/sdk + - go.opentelemetry.io/otel/sdk/metric + - go.opentelemetry.io/otel/trace + experimental-metrics: + version: v0.44.0 + modules: + - go.opentelemetry.io/otel/bridge/opencensus + - go.opentelemetry.io/otel/bridge/opencensus/test + - go.opentelemetry.io/otel/example/opencensus + - go.opentelemetry.io/otel/example/prometheus + - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc + - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp + - go.opentelemetry.io/otel/exporters/prometheus + - go.opentelemetry.io/otel/exporters/stdout/stdoutmetric + experimental-schema: + version: v0.0.7 + modules: + - go.opentelemetry.io/otel/schema +excluded-modules: + - go.opentelemetry.io/otel/internal/tools diff --git a/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go b/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go index 595480112..e9e97d451 100644 --- a/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go +++ b/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go @@ -430,7 +430,7 @@ type ClientHeader struct { MethodName string `protobuf:"bytes,2,opt,name=method_name,json=methodName,proto3" json:"method_name,omitempty"` // A single process may be used to run multiple virtual // servers with different identities. - // The authority is the name of such a server identitiy. + // The authority is the name of such a server identity. // It is typically a portion of the URI in the form of // or : . Authority string `protobuf:"bytes,3,opt,name=authority,proto3" json:"authority,omitempty"` diff --git a/vendor/google.golang.org/grpc/clientconn.go b/vendor/google.golang.org/grpc/clientconn.go index e6f2625b6..f6e815e6b 100644 --- a/vendor/google.golang.org/grpc/clientconn.go +++ b/vendor/google.golang.org/grpc/clientconn.go @@ -1860,27 +1860,15 @@ func (cc *ClientConn) determineAuthority() error { } endpoint := cc.parsedTarget.Endpoint() - target := cc.target - switch { - case authorityFromDialOption != "": + if authorityFromDialOption != "" { cc.authority = authorityFromDialOption - case authorityFromCreds != "": + } else if authorityFromCreds != "" { cc.authority = authorityFromCreds - case strings.HasPrefix(target, "unix:") || strings.HasPrefix(target, "unix-abstract:"): - // TODO: remove when the unix resolver implements optional interface to - // return channel authority. - cc.authority = "localhost" - case strings.HasPrefix(endpoint, ":"): + } else if auth, ok := cc.resolverBuilder.(resolver.AuthorityOverrider); ok { + cc.authority = auth.OverrideAuthority(cc.parsedTarget) + } else if strings.HasPrefix(endpoint, ":") { cc.authority = "localhost" + endpoint - default: - // TODO: Define an optional interface on the resolver builder to return - // the channel authority given the user's dial target. For resolvers - // which don't implement this interface, we will use the endpoint from - // "scheme://authority/endpoint" as the default authority. - // Escape the endpoint to handle use cases where the endpoint - // might not be a valid authority by default. - // For example an endpoint which has multiple paths like - // 'a/b/c', which is not a valid authority by default. + } else { cc.authority = encodeAuthority(endpoint) } channelz.Infof(logger, cc.channelzID, "Channel authority set to %q", cc.authority) diff --git a/vendor/google.golang.org/grpc/internal/internal.go b/vendor/google.golang.org/grpc/internal/internal.go index 2549fe8e3..6c7ea6a53 100644 --- a/vendor/google.golang.org/grpc/internal/internal.go +++ b/vendor/google.golang.org/grpc/internal/internal.go @@ -57,7 +57,7 @@ var ( // GetXDSHandshakeInfoForTesting returns a pointer to the xds.HandshakeInfo // stored in the passed in attributes. This is set by // credentials/xds/xds.go. - GetXDSHandshakeInfoForTesting any // func (*attributes.Attributes) *xds.HandshakeInfo + GetXDSHandshakeInfoForTesting any // func (*attributes.Attributes) *unsafe.Pointer // GetServerCredentials returns the transport credentials configured on a // gRPC server. An xDS-enabled server needs to know what type of credentials // is configured on the underlying gRPC server. This is set by server.go. @@ -68,11 +68,6 @@ var ( // This is used in the 1.0 release of gcp/observability, and thus must not be // deleted or changed. CanonicalString any // func (codes.Code) string - // DrainServerTransports initiates a graceful close of existing connections - // on a gRPC server accepted on the provided listener address. An - // xDS-enabled server invokes this method on a grpc.Server when a particular - // listener moves to "not-serving" mode. - DrainServerTransports any // func(*grpc.Server, string) // IsRegisteredMethod returns whether the passed in method is registered as // a method on the server. IsRegisteredMethod any // func(*grpc.Server, string) bool @@ -188,6 +183,19 @@ var ( ExitIdleModeForTesting any // func(*grpc.ClientConn) error ChannelzTurnOffForTesting func() + + // TriggerXDSResourceNameNotFoundForTesting triggers the resource-not-found + // error for a given resource type and name. This is usually triggered when + // the associated watch timer fires. For testing purposes, having this + // function makes events more predictable than relying on timer events. + TriggerXDSResourceNameNotFoundForTesting any // func(func(xdsresource.Type, string), string, string) error + + // TriggerXDSResourceNotFoundClient invokes the testing xDS Client singleton + // to invoke resource not found for a resource type name and resource name. + TriggerXDSResourceNameNotFoundClient any // func(string, string) error + + // FromOutgoingContextRaw returns the un-merged, intermediary contents of metadata.rawMD. + FromOutgoingContextRaw any // func(context.Context) (metadata.MD, [][]string, bool) ) // HealthChecker defines the signature of the client-side LB channel health checking function. diff --git a/vendor/google.golang.org/grpc/internal/resolver/unix/unix.go b/vendor/google.golang.org/grpc/internal/resolver/unix/unix.go index 160911687..27cd81af9 100644 --- a/vendor/google.golang.org/grpc/internal/resolver/unix/unix.go +++ b/vendor/google.golang.org/grpc/internal/resolver/unix/unix.go @@ -61,6 +61,10 @@ func (b *builder) Scheme() string { return b.scheme } +func (b *builder) OverrideAuthority(resolver.Target) string { + return "localhost" +} + type nopResolver struct { } diff --git a/vendor/google.golang.org/grpc/internal/tcp_keepalive_nonunix.go b/vendor/google.golang.org/grpc/internal/tcp_keepalive_others.go similarity index 96% rename from vendor/google.golang.org/grpc/internal/tcp_keepalive_nonunix.go rename to vendor/google.golang.org/grpc/internal/tcp_keepalive_others.go index aeffd3e1c..4f347edd4 100644 --- a/vendor/google.golang.org/grpc/internal/tcp_keepalive_nonunix.go +++ b/vendor/google.golang.org/grpc/internal/tcp_keepalive_others.go @@ -1,4 +1,4 @@ -//go:build !unix +//go:build !unix && !windows /* * Copyright 2023 gRPC authors. diff --git a/vendor/google.golang.org/grpc/internal/tcp_keepalive_windows.go b/vendor/google.golang.org/grpc/internal/tcp_keepalive_windows.go new file mode 100644 index 000000000..fd7d43a89 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/tcp_keepalive_windows.go @@ -0,0 +1,54 @@ +//go:build windows + +/* + * Copyright 2023 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package internal + +import ( + "net" + "syscall" + "time" + + "golang.org/x/sys/windows" +) + +// NetDialerWithTCPKeepalive returns a net.Dialer that enables TCP keepalives on +// the underlying connection with OS default values for keepalive parameters. +// +// TODO: Once https://github.com/golang/go/issues/62254 lands, and the +// appropriate Go version becomes less than our least supported Go version, we +// should look into using the new API to make things more straightforward. +func NetDialerWithTCPKeepalive() *net.Dialer { + return &net.Dialer{ + // Setting a negative value here prevents the Go stdlib from overriding + // the values of TCP keepalive time and interval. It also prevents the + // Go stdlib from enabling TCP keepalives by default. + KeepAlive: time.Duration(-1), + // This method is called after the underlying network socket is created, + // but before dialing the socket (or calling its connect() method). The + // combination of unconditionally enabling TCP keepalives here, and + // disabling the overriding of TCP keepalive parameters by setting the + // KeepAlive field to a negative value above, results in OS defaults for + // the TCP keealive interval and time parameters. + Control: func(_, _ string, c syscall.RawConn) error { + return c.Control(func(fd uintptr) { + windows.SetsockoptInt(windows.Handle(fd), windows.SOL_SOCKET, windows.SO_KEEPALIVE, 1) + }) + }, + } +} diff --git a/vendor/google.golang.org/grpc/internal/transport/http2_client.go b/vendor/google.golang.org/grpc/internal/transport/http2_client.go index 59f67655a..c33ac5961 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http2_client.go +++ b/vendor/google.golang.org/grpc/internal/transport/http2_client.go @@ -59,6 +59,8 @@ import ( // atomically. var clientConnectionCounter uint64 +var metadataFromOutgoingContextRaw = internal.FromOutgoingContextRaw.(func(context.Context) (metadata.MD, [][]string, bool)) + // http2Client implements the ClientTransport interface with HTTP2. type http2Client struct { lastRead int64 // Keep this field 64-bit aligned. Accessed atomically. @@ -568,7 +570,7 @@ func (t *http2Client) createHeaderFields(ctx context.Context, callHdr *CallHdr) headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-trace-bin", Value: encodeBinHeader(b)}) } - if md, added, ok := metadata.FromOutgoingContextRaw(ctx); ok { + if md, added, ok := metadataFromOutgoingContextRaw(ctx); ok { var k string for k, vv := range md { // HTTP doesn't allow you to set pseudoheaders after non pseudoheaders were set. @@ -1323,10 +1325,8 @@ func (t *http2Client) handleGoAway(f *http2.GoAwayFrame) { for streamID, stream := range t.activeStreams { if streamID > id && streamID <= upperLimit { // The stream was unprocessed by the server. - if streamID > id && streamID <= upperLimit { - atomic.StoreUint32(&stream.unprocessed, 1) - streamsToClose = append(streamsToClose, stream) - } + atomic.StoreUint32(&stream.unprocessed, 1) + streamsToClose = append(streamsToClose, stream) } } t.mu.Unlock() diff --git a/vendor/google.golang.org/grpc/internal/transport/http2_server.go b/vendor/google.golang.org/grpc/internal/transport/http2_server.go index 680c9eba0..f6bac0e8a 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http2_server.go +++ b/vendor/google.golang.org/grpc/internal/transport/http2_server.go @@ -960,7 +960,12 @@ func (t *http2Server) WriteHeader(s *Stream, md metadata.MD) error { } } if err := t.writeHeaderLocked(s); err != nil { - return status.Convert(err).Err() + switch e := err.(type) { + case ConnectionError: + return status.Error(codes.Unavailable, e.Desc) + default: + return status.Convert(err).Err() + } } return nil } diff --git a/vendor/google.golang.org/grpc/metadata/metadata.go b/vendor/google.golang.org/grpc/metadata/metadata.go index 494468257..1e9485fd6 100644 --- a/vendor/google.golang.org/grpc/metadata/metadata.go +++ b/vendor/google.golang.org/grpc/metadata/metadata.go @@ -25,8 +25,14 @@ import ( "context" "fmt" "strings" + + "google.golang.org/grpc/internal" ) +func init() { + internal.FromOutgoingContextRaw = fromOutgoingContextRaw +} + // DecodeKeyValue returns k, v, nil. // // Deprecated: use k and v directly instead. @@ -238,16 +244,13 @@ func copyOf(v []string) []string { return vals } -// FromOutgoingContextRaw returns the un-merged, intermediary contents of rawMD. +// fromOutgoingContextRaw returns the un-merged, intermediary contents of rawMD. // // Remember to perform strings.ToLower on the keys, for both the returned MD (MD // is a map, there's no guarantee it's created using our helper functions) and // the extra kv pairs (AppendToOutgoingContext doesn't turn them into // lowercase). -// -// This is intended for gRPC-internal use ONLY. Users should use -// FromOutgoingContext instead. -func FromOutgoingContextRaw(ctx context.Context) (MD, [][]string, bool) { +func fromOutgoingContextRaw(ctx context.Context) (MD, [][]string, bool) { raw, ok := ctx.Value(mdOutgoingKey{}).(rawMD) if !ok { return nil, nil, false diff --git a/vendor/google.golang.org/grpc/reflection/README.md b/vendor/google.golang.org/grpc/reflection/README.md index 04b6371af..9ace83ccb 100644 --- a/vendor/google.golang.org/grpc/reflection/README.md +++ b/vendor/google.golang.org/grpc/reflection/README.md @@ -2,7 +2,7 @@ Package reflection implements server reflection service. -The service implemented is defined in: https://github.com/grpc/grpc/blob/master/src/proto/grpc/reflection/v1alpha/reflection.proto. +The service implemented is defined in: https://github.com/grpc/grpc/blob/master/src/proto/grpc/reflection/v1/reflection.proto. To register server reflection on a gRPC server: ```go diff --git a/vendor/google.golang.org/grpc/reflection/serverreflection.go b/vendor/google.golang.org/grpc/reflection/serverreflection.go index 76dae09d8..c3b408392 100644 --- a/vendor/google.golang.org/grpc/reflection/serverreflection.go +++ b/vendor/google.golang.org/grpc/reflection/serverreflection.go @@ -176,11 +176,20 @@ type serverReflectionServer struct { // wire format ([]byte). The fileDescriptors will include fd and all the // transitive dependencies of fd with names not in sentFileDescriptors. func (s *serverReflectionServer) fileDescWithDependencies(fd protoreflect.FileDescriptor, sentFileDescriptors map[string]bool) ([][]byte, error) { + if fd.IsPlaceholder() { + // If the given root file is a placeholder, treat it + // as missing instead of serializing it. + return nil, protoregistry.NotFound + } var r [][]byte queue := []protoreflect.FileDescriptor{fd} for len(queue) > 0 { currentfd := queue[0] queue = queue[1:] + if currentfd.IsPlaceholder() { + // Skip any missing files in the dependency graph. + continue + } if sent := sentFileDescriptors[currentfd.Path()]; len(r) == 0 || !sent { sentFileDescriptors[currentfd.Path()] = true fdProto := protodesc.ToFileDescriptorProto(currentfd) diff --git a/vendor/google.golang.org/grpc/resolver/resolver.go b/vendor/google.golang.org/grpc/resolver/resolver.go index bd1c7d01b..adf89dd9c 100644 --- a/vendor/google.golang.org/grpc/resolver/resolver.go +++ b/vendor/google.golang.org/grpc/resolver/resolver.go @@ -314,3 +314,13 @@ type Resolver interface { // Close closes the resolver. Close() } + +// AuthorityOverrider is implemented by Builders that wish to override the +// default authority for the ClientConn. +// By default, the authority used is target.Endpoint(). +type AuthorityOverrider interface { + // OverrideAuthority returns the authority to use for a ClientConn with the + // given target. The implementation must generate it without blocking, + // typically in line, and must keep it unchanged. + OverrideAuthority(Target) string +} diff --git a/vendor/google.golang.org/grpc/rpc_util.go b/vendor/google.golang.org/grpc/rpc_util.go index b7723aa09..a4b6bc687 100644 --- a/vendor/google.golang.org/grpc/rpc_util.go +++ b/vendor/google.golang.org/grpc/rpc_util.go @@ -640,14 +640,18 @@ func encode(c baseCodec, msg any) ([]byte, error) { return b, nil } -// compress returns the input bytes compressed by compressor or cp. If both -// compressors are nil, returns nil. +// compress returns the input bytes compressed by compressor or cp. +// If both compressors are nil, or if the message has zero length, returns nil, +// indicating no compression was done. // // TODO(dfawley): eliminate cp parameter by wrapping Compressor in an encoding.Compressor. func compress(in []byte, cp Compressor, compressor encoding.Compressor) ([]byte, error) { if compressor == nil && cp == nil { return nil, nil } + if len(in) == 0 { + return nil, nil + } wrapErr := func(err error) error { return status.Errorf(codes.Internal, "grpc: error while compressing: %v", err.Error()) } diff --git a/vendor/google.golang.org/grpc/server.go b/vendor/google.golang.org/grpc/server.go index 682fa1831..e89c5ac61 100644 --- a/vendor/google.golang.org/grpc/server.go +++ b/vendor/google.golang.org/grpc/server.go @@ -74,9 +74,6 @@ func init() { return srv.isRegisteredMethod(method) } internal.ServerFromContext = serverFromContext - internal.DrainServerTransports = func(srv *Server, addr string) { - srv.drainServerTransports(addr) - } internal.AddGlobalServerOptions = func(opt ...ServerOption) { globalServerOptions = append(globalServerOptions, opt...) } @@ -139,7 +136,8 @@ type Server struct { quit *grpcsync.Event done *grpcsync.Event channelzRemoveOnce sync.Once - serveWG sync.WaitGroup // counts active Serve goroutines for GracefulStop + serveWG sync.WaitGroup // counts active Serve goroutines for Stop/GracefulStop + handlersWG sync.WaitGroup // counts active method handler goroutines channelzID *channelz.Identifier czData *channelzData @@ -176,6 +174,7 @@ type serverOptions struct { headerTableSize *uint32 numServerWorkers uint32 recvBufferPool SharedBufferPool + waitForHandlers bool } var defaultServerOptions = serverOptions{ @@ -573,6 +572,21 @@ func NumStreamWorkers(numServerWorkers uint32) ServerOption { }) } +// WaitForHandlers cause Stop to wait until all outstanding method handlers have +// exited before returning. If false, Stop will return as soon as all +// connections have closed, but method handlers may still be running. By +// default, Stop does not wait for method handlers to return. +// +// # Experimental +// +// Notice: This API is EXPERIMENTAL and may be changed or removed in a +// later release. +func WaitForHandlers(w bool) ServerOption { + return newFuncServerOption(func(o *serverOptions) { + o.waitForHandlers = w + }) +} + // RecvBufferPool returns a ServerOption that configures the server // to use the provided shared buffer pool for parsing incoming messages. Depending // on the application's workload, this could result in reduced memory allocation. @@ -932,6 +946,12 @@ func (s *Server) handleRawConn(lisAddr string, rawConn net.Conn) { return } + if cc, ok := rawConn.(interface { + PassServerTransport(transport.ServerTransport) + }); ok { + cc.PassServerTransport(st) + } + if !s.addConn(lisAddr, st) { return } @@ -941,15 +961,6 @@ func (s *Server) handleRawConn(lisAddr string, rawConn net.Conn) { }() } -func (s *Server) drainServerTransports(addr string) { - s.mu.Lock() - conns := s.conns[addr] - for st := range conns { - st.Drain("") - } - s.mu.Unlock() -} - // newHTTP2Transport sets up a http/2 transport (using the // gRPC http2 server transport in transport/http2_server.go). func (s *Server) newHTTP2Transport(c net.Conn) transport.ServerTransport { @@ -1010,9 +1021,11 @@ func (s *Server) serveStreams(ctx context.Context, st transport.ServerTransport, streamQuota := newHandlerQuota(s.opts.maxConcurrentStreams) st.HandleStreams(ctx, func(stream *transport.Stream) { + s.handlersWG.Add(1) streamQuota.acquire() f := func() { defer streamQuota.release() + defer s.handlersWG.Done() s.handleStream(st, stream) } @@ -1911,6 +1924,10 @@ func (s *Server) stop(graceful bool) { s.serverWorkerChannelClose() } + if graceful || s.opts.waitForHandlers { + s.handlersWG.Wait() + } + if s.events != nil { s.events.Finish() s.events = nil diff --git a/vendor/google.golang.org/grpc/stream.go b/vendor/google.golang.org/grpc/stream.go index b14b2fbea..d621f52b1 100644 --- a/vendor/google.golang.org/grpc/stream.go +++ b/vendor/google.golang.org/grpc/stream.go @@ -48,6 +48,8 @@ import ( "google.golang.org/grpc/status" ) +var metadataFromOutgoingContextRaw = internal.FromOutgoingContextRaw.(func(context.Context) (metadata.MD, [][]string, bool)) + // StreamHandler defines the handler called by gRPC server to complete the // execution of a streaming RPC. // @@ -184,7 +186,7 @@ func newClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, meth // when the RPC completes. opts = append([]CallOption{OnFinish(func(error) { cc.idlenessMgr.OnCallEnd() })}, opts...) - if md, added, ok := metadata.FromOutgoingContextRaw(ctx); ok { + if md, added, ok := metadataFromOutgoingContextRaw(ctx); ok { // validate md if err := imetadata.Validate(md); err != nil { return nil, status.Error(codes.Internal, err.Error()) diff --git a/vendor/google.golang.org/grpc/version.go b/vendor/google.golang.org/grpc/version.go index dc2cea59c..1ad1ba2ad 100644 --- a/vendor/google.golang.org/grpc/version.go +++ b/vendor/google.golang.org/grpc/version.go @@ -19,4 +19,4 @@ package grpc // Version is the current grpc version. -const Version = "1.60.1" +const Version = "1.61.0" diff --git a/vendor/google.golang.org/grpc/vet.sh b/vendor/google.golang.org/grpc/vet.sh index 896dc38f5..5da38a409 100644 --- a/vendor/google.golang.org/grpc/vet.sh +++ b/vendor/google.golang.org/grpc/vet.sh @@ -88,7 +88,7 @@ not git grep -l 'x/net/context' -- "*.go" git grep -l '"math/rand"' -- "*.go" 2>&1 | not grep -v '^examples\|^interop/stress\|grpcrand\|^benchmark\|wrr_test' # - Do not use "interface{}"; use "any" instead. -git grep -l 'interface{}' -- "*.go" 2>&1 | not grep -v '\.pb\.go\|protoc-gen-go-grpc' +git grep -l 'interface{}' -- "*.go" 2>&1 | not grep -v '\.pb\.go\|protoc-gen-go-grpc\|grpc_testing_not_regenerate' # - Do not call grpclog directly. Use grpclog.Component instead. git grep -l -e 'grpclog.I' --or -e 'grpclog.W' --or -e 'grpclog.E' --or -e 'grpclog.F' --or -e 'grpclog.V' -- "*.go" | not grep -v '^grpclog/component.go\|^internal/grpctest/tlogger_test.go' @@ -127,7 +127,7 @@ staticcheck -go 1.19 -checks 'all' ./... > "${SC_OUT}" || true grep -v "(ST1000)" "${SC_OUT}" | grep -v "(SA1019)" | grep -v "(ST1003)" | not grep -v "(ST1019)\|\(other import of\)" # Exclude underscore checks for generated code. -grep "(ST1003)" "${SC_OUT}" | not grep -v '\(.pb.go:\)\|\(code_string_test.go:\)' +grep "(ST1003)" "${SC_OUT}" | not grep -v '\(.pb.go:\)\|\(code_string_test.go:\)\|\(grpc_testing_not_regenerate\)' # Error for duplicate imports not including grpc protos. grep "(ST1019)\|\(other import of\)" "${SC_OUT}" | not grep -Fv 'XXXXX PleaseIgnoreUnused @@ -152,6 +152,7 @@ grep "(SA1019)" "${SC_OUT}" | not grep -Fv 'XXXXX PleaseIgnoreUnused XXXXX Protobuf related deprecation errors: "github.com/golang/protobuf .pb.go: +grpc_testing_not_regenerate : ptypes. proto.RegisterType XXXXX gRPC internal usage deprecation errors: @@ -184,9 +185,6 @@ GetSafeRegexMatch GetSuffixMatch GetTlsCertificateCertificateProviderInstance GetValidationContextCertificateProviderInstance -XXXXX TODO: Remove the below deprecation usages: -CloseNotifier -Roots.Subjects XXXXX PleaseIgnoreUnused' echo SUCCESS diff --git a/vendor/modules.txt b/vendor/modules.txt index 49fcdc2d4..fab8adfed 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -28,10 +28,10 @@ github.com/aws/aws-sdk-go-v2/internal/shareddefaults github.com/aws/aws-sdk-go-v2/internal/strings github.com/aws/aws-sdk-go-v2/internal/sync/singleflight github.com/aws/aws-sdk-go-v2/internal/timeconv -# github.com/aws/aws-sdk-go-v2/config v1.26.2 +# github.com/aws/aws-sdk-go-v2/config v1.26.6 ## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/config -# github.com/aws/aws-sdk-go-v2/credentials v1.16.13 +# github.com/aws/aws-sdk-go-v2/credentials v1.16.16 ## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/credentials github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds @@ -40,7 +40,7 @@ github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client github.com/aws/aws-sdk-go-v2/credentials/processcreds github.com/aws/aws-sdk-go-v2/credentials/ssocreds github.com/aws/aws-sdk-go-v2/credentials/stscreds -# github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.10 +# github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.11 ## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/feature/ec2/imds github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config @@ -50,13 +50,13 @@ github.com/aws/aws-sdk-go-v2/internal/configsources # github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.10 ## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 -# github.com/aws/aws-sdk-go-v2/internal/ini v1.7.2 +# github.com/aws/aws-sdk-go-v2/internal/ini v1.7.3 ## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/internal/ini # github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4 ## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding -# github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.9 +# github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.10 ## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/service/internal/presigned-url # github.com/aws/aws-sdk-go-v2/service/sns v1.26.7 @@ -64,22 +64,22 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url github.com/aws/aws-sdk-go-v2/service/sns github.com/aws/aws-sdk-go-v2/service/sns/internal/endpoints github.com/aws/aws-sdk-go-v2/service/sns/types -# github.com/aws/aws-sdk-go-v2/service/sqs v1.29.6 +# github.com/aws/aws-sdk-go-v2/service/sqs v1.29.7 ## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/service/sqs github.com/aws/aws-sdk-go-v2/service/sqs/internal/endpoints github.com/aws/aws-sdk-go-v2/service/sqs/types -# github.com/aws/aws-sdk-go-v2/service/sso v1.18.5 +# github.com/aws/aws-sdk-go-v2/service/sso v1.18.7 ## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/service/sso github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints github.com/aws/aws-sdk-go-v2/service/sso/types -# github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.5 +# github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.7 ## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/service/ssooidc github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints github.com/aws/aws-sdk-go-v2/service/ssooidc/types -# github.com/aws/aws-sdk-go-v2/service/sts v1.26.6 +# github.com/aws/aws-sdk-go-v2/service/sts v1.26.7 ## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/service/sts github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints @@ -132,12 +132,12 @@ github.com/eapache/queue github.com/eclipse/paho.golang/autopaho github.com/eclipse/paho.golang/packets github.com/eclipse/paho.golang/paho -# github.com/elastic/elastic-transport-go/v8 v8.3.0 -## explicit; go 1.13 +# github.com/elastic/elastic-transport-go/v8 v8.4.0 +## explicit; go 1.20 github.com/elastic/elastic-transport-go/v8/elastictransport github.com/elastic/elastic-transport-go/v8/elastictransport/version -# github.com/elastic/go-elasticsearch/v8 v8.11.1 -## explicit; go 1.13 +# github.com/elastic/go-elasticsearch/v8 v8.12.0 +## explicit; go 1.20 github.com/elastic/go-elasticsearch/v8 github.com/elastic/go-elasticsearch/v8/esapi github.com/elastic/go-elasticsearch/v8/internal/version @@ -261,10 +261,12 @@ github.com/elastic/go-elasticsearch/v8/typedapi/eql/delete github.com/elastic/go-elasticsearch/v8/typedapi/eql/get github.com/elastic/go-elasticsearch/v8/typedapi/eql/getstatus github.com/elastic/go-elasticsearch/v8/typedapi/eql/search +github.com/elastic/go-elasticsearch/v8/typedapi/esql/query github.com/elastic/go-elasticsearch/v8/typedapi/features/getfeatures github.com/elastic/go-elasticsearch/v8/typedapi/features/resetfeatures github.com/elastic/go-elasticsearch/v8/typedapi/fleet/globalcheckpoints github.com/elastic/go-elasticsearch/v8/typedapi/fleet/msearch +github.com/elastic/go-elasticsearch/v8/typedapi/fleet/postsecret github.com/elastic/go-elasticsearch/v8/typedapi/fleet/search github.com/elastic/go-elasticsearch/v8/typedapi/graph/explore github.com/elastic/go-elasticsearch/v8/typedapi/ilm/deletelifecycle @@ -336,6 +338,10 @@ github.com/elastic/go-elasticsearch/v8/typedapi/indices/stats github.com/elastic/go-elasticsearch/v8/typedapi/indices/unfreeze github.com/elastic/go-elasticsearch/v8/typedapi/indices/updatealiases github.com/elastic/go-elasticsearch/v8/typedapi/indices/validatequery +github.com/elastic/go-elasticsearch/v8/typedapi/inference/deletemodel +github.com/elastic/go-elasticsearch/v8/typedapi/inference/getmodel +github.com/elastic/go-elasticsearch/v8/typedapi/inference/inference +github.com/elastic/go-elasticsearch/v8/typedapi/inference/putmodel github.com/elastic/go-elasticsearch/v8/typedapi/ingest/deletepipeline github.com/elastic/go-elasticsearch/v8/typedapi/ingest/geoipstats github.com/elastic/go-elasticsearch/v8/typedapi/ingest/getpipeline @@ -489,6 +495,7 @@ github.com/elastic/go-elasticsearch/v8/typedapi/security/getrole github.com/elastic/go-elasticsearch/v8/typedapi/security/getrolemapping github.com/elastic/go-elasticsearch/v8/typedapi/security/getserviceaccounts github.com/elastic/go-elasticsearch/v8/typedapi/security/getservicecredentials +github.com/elastic/go-elasticsearch/v8/typedapi/security/getsettings github.com/elastic/go-elasticsearch/v8/typedapi/security/gettoken github.com/elastic/go-elasticsearch/v8/typedapi/security/getuser github.com/elastic/go-elasticsearch/v8/typedapi/security/getuserprivileges @@ -514,6 +521,7 @@ github.com/elastic/go-elasticsearch/v8/typedapi/security/samlprepareauthenticati github.com/elastic/go-elasticsearch/v8/typedapi/security/samlserviceprovidermetadata github.com/elastic/go-elasticsearch/v8/typedapi/security/suggestuserprofiles github.com/elastic/go-elasticsearch/v8/typedapi/security/updateapikey +github.com/elastic/go-elasticsearch/v8/typedapi/security/updatesettings github.com/elastic/go-elasticsearch/v8/typedapi/security/updateuserprofiledata github.com/elastic/go-elasticsearch/v8/typedapi/shutdown/deletenode github.com/elastic/go-elasticsearch/v8/typedapi/shutdown/getnode @@ -741,6 +749,7 @@ github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/stringdistance github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/suggestmode github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/suggestsort github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/synonymformat +github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/tasktype github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/templateformat github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/termsaggregationcollectmode github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/termsaggregationexecutionhint @@ -779,6 +788,13 @@ github.com/elastic/go-elasticsearch/v8/typedapi/watcher/stop github.com/elastic/go-elasticsearch/v8/typedapi/watcher/updatesettings github.com/elastic/go-elasticsearch/v8/typedapi/xpack/info github.com/elastic/go-elasticsearch/v8/typedapi/xpack/usage +# github.com/go-logr/logr v1.3.0 +## explicit; go 1.18 +github.com/go-logr/logr +github.com/go-logr/logr/funcr +# github.com/go-logr/stdr v1.2.2 +## explicit; go 1.16 +github.com/go-logr/stdr # github.com/go-redis/redis/extra/rediscmd v0.2.0 ## explicit; go 1.15 github.com/go-redis/redis/extra/rediscmd @@ -806,7 +822,7 @@ github.com/golang/protobuf/ptypes/timestamp # github.com/golang/snappy v0.0.4 ## explicit github.com/golang/snappy -# github.com/google/uuid v1.5.0 +# github.com/google/uuid v1.6.0 ## explicit github.com/google/uuid # github.com/gorilla/websocket v1.5.1 @@ -1029,6 +1045,25 @@ go.mongodb.org/mongo-driver/x/mongo/driver/operation go.mongodb.org/mongo-driver/x/mongo/driver/session go.mongodb.org/mongo-driver/x/mongo/driver/topology go.mongodb.org/mongo-driver/x/mongo/driver/wiremessage +# go.opentelemetry.io/otel v1.21.0 +## explicit; go 1.20 +go.opentelemetry.io/otel +go.opentelemetry.io/otel/attribute +go.opentelemetry.io/otel/baggage +go.opentelemetry.io/otel/codes +go.opentelemetry.io/otel/internal +go.opentelemetry.io/otel/internal/attribute +go.opentelemetry.io/otel/internal/baggage +go.opentelemetry.io/otel/internal/global +go.opentelemetry.io/otel/propagation +# go.opentelemetry.io/otel/metric v1.21.0 +## explicit; go 1.20 +go.opentelemetry.io/otel/metric +go.opentelemetry.io/otel/metric/embedded +# go.opentelemetry.io/otel/trace v1.21.0 +## explicit; go 1.20 +go.opentelemetry.io/otel/trace +go.opentelemetry.io/otel/trace/embedded # go.uber.org/atomic v1.11.0 ## explicit; go 1.18 go.uber.org/atomic @@ -1069,7 +1104,7 @@ golang.org/x/time/rate # google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f ## explicit; go 1.19 google.golang.org/genproto/googleapis/rpc/status -# google.golang.org/grpc v1.60.1 +# google.golang.org/grpc v1.61.0 ## explicit; go 1.19 google.golang.org/grpc google.golang.org/grpc/attributes