From 2ca3754d20bb9a18de6eb32b6f5d5ed33d100db8 Mon Sep 17 00:00:00 2001 From: delvedor Date: Wed, 13 Mar 2019 14:12:38 +0100 Subject: [PATCH] API generation --- api/api/bulk.js | 9 +++++++++ api/api/cat.aliases.js | 9 +++++++++ api/api/cat.allocation.js | 9 +++++++++ api/api/cat.count.js | 9 +++++++++ api/api/cat.fielddata.js | 9 +++++++++ api/api/cat.health.js | 9 +++++++++ api/api/cat.help.js | 9 +++++++++ api/api/cat.indices.js | 9 +++++++++ api/api/cat.master.js | 9 +++++++++ api/api/cat.nodeattrs.js | 9 +++++++++ api/api/cat.nodes.js | 9 +++++++++ api/api/cat.pending_tasks.js | 9 +++++++++ api/api/cat.plugins.js | 9 +++++++++ api/api/cat.recovery.js | 9 +++++++++ api/api/cat.repositories.js | 9 +++++++++ api/api/cat.segments.js | 9 +++++++++ api/api/cat.shards.js | 9 +++++++++ api/api/cat.snapshots.js | 9 +++++++++ api/api/cat.tasks.js | 9 +++++++++ api/api/cat.templates.js | 9 +++++++++ api/api/cat.thread_pool.js | 9 +++++++++ api/api/ccr.delete_auto_follow_pattern.js | 9 +++++++++ api/api/ccr.follow.js | 9 +++++++++ api/api/ccr.follow_info.js | 9 +++++++++ api/api/ccr.follow_stats.js | 9 +++++++++ api/api/ccr.get_auto_follow_pattern.js | 9 +++++++++ api/api/ccr.pause_follow.js | 9 +++++++++ api/api/ccr.put_auto_follow_pattern.js | 9 +++++++++ api/api/ccr.resume_follow.js | 9 +++++++++ api/api/ccr.stats.js | 9 +++++++++ api/api/ccr.unfollow.js | 9 +++++++++ api/api/clear_scroll.js | 9 +++++++++ api/api/cluster.allocation_explain.js | 9 +++++++++ api/api/cluster.get_settings.js | 9 +++++++++ api/api/cluster.health.js | 9 +++++++++ api/api/cluster.pending_tasks.js | 9 +++++++++ api/api/cluster.put_settings.js | 9 +++++++++ api/api/cluster.remote_info.js | 9 +++++++++ api/api/cluster.reroute.js | 9 +++++++++ api/api/cluster.state.js | 9 +++++++++ api/api/cluster.stats.js | 9 +++++++++ api/api/count.js | 9 +++++++++ api/api/create.js | 9 +++++++++ api/api/delete.js | 9 +++++++++ api/api/delete_by_query.js | 9 +++++++++ api/api/delete_by_query_rethrottle.js | 9 +++++++++ api/api/delete_script.js | 9 +++++++++ api/api/exists.js | 9 +++++++++ api/api/exists_source.js | 9 +++++++++ api/api/explain.js | 9 +++++++++ api/api/field_caps.js | 9 +++++++++ api/api/get.js | 9 +++++++++ api/api/get_script.js | 9 +++++++++ api/api/get_source.js | 9 +++++++++ api/api/ilm.delete_lifecycle.js | 9 +++++++++ api/api/ilm.explain_lifecycle.js | 9 +++++++++ api/api/ilm.get_lifecycle.js | 9 +++++++++ api/api/ilm.get_status.js | 9 +++++++++ api/api/ilm.move_to_step.js | 9 +++++++++ api/api/ilm.put_lifecycle.js | 9 +++++++++ api/api/ilm.remove_policy.js | 9 +++++++++ api/api/ilm.retry.js | 9 +++++++++ api/api/ilm.start.js | 9 +++++++++ api/api/ilm.stop.js | 9 +++++++++ api/api/index.js | 9 +++++++++ api/api/indices.analyze.js | 9 +++++++++ api/api/indices.clear_cache.js | 9 +++++++++ api/api/indices.close.js | 9 +++++++++ api/api/indices.create.js | 9 +++++++++ api/api/indices.delete.js | 9 +++++++++ api/api/indices.delete_alias.js | 9 +++++++++ api/api/indices.delete_template.js | 9 +++++++++ api/api/indices.exists.js | 9 +++++++++ api/api/indices.exists_alias.js | 9 +++++++++ api/api/indices.exists_template.js | 9 +++++++++ api/api/indices.exists_type.js | 9 +++++++++ api/api/indices.flush.js | 9 +++++++++ api/api/indices.flush_synced.js | 9 +++++++++ api/api/indices.forcemerge.js | 9 +++++++++ api/api/indices.freeze.js | 9 +++++++++ api/api/indices.get.js | 9 +++++++++ api/api/indices.get_alias.js | 9 +++++++++ api/api/indices.get_field_mapping.js | 9 +++++++++ api/api/indices.get_mapping.js | 9 +++++++++ api/api/indices.get_settings.js | 9 +++++++++ api/api/indices.get_template.js | 9 +++++++++ api/api/indices.get_upgrade.js | 9 +++++++++ api/api/indices.open.js | 9 +++++++++ api/api/indices.put_alias.js | 9 +++++++++ api/api/indices.put_mapping.js | 9 +++++++++ api/api/indices.put_settings.js | 9 +++++++++ api/api/indices.put_template.js | 9 +++++++++ api/api/indices.recovery.js | 9 +++++++++ api/api/indices.refresh.js | 9 +++++++++ api/api/indices.rollover.js | 9 +++++++++ api/api/indices.segments.js | 9 +++++++++ api/api/indices.shard_stores.js | 9 +++++++++ api/api/indices.shrink.js | 9 +++++++++ api/api/indices.split.js | 9 +++++++++ api/api/indices.stats.js | 9 +++++++++ api/api/indices.unfreeze.js | 9 +++++++++ api/api/indices.update_aliases.js | 9 +++++++++ api/api/indices.upgrade.js | 9 +++++++++ api/api/indices.validate_query.js | 9 +++++++++ api/api/info.js | 9 +++++++++ api/api/ingest.delete_pipeline.js | 9 +++++++++ api/api/ingest.get_pipeline.js | 9 +++++++++ api/api/ingest.processor_grok.js | 9 +++++++++ api/api/ingest.put_pipeline.js | 9 +++++++++ api/api/ingest.simulate.js | 9 +++++++++ api/api/mget.js | 9 +++++++++ api/api/ml.close_job.js | 9 +++++++++ api/api/ml.delete_calendar.js | 9 +++++++++ api/api/ml.delete_calendar_event.js | 9 +++++++++ api/api/ml.delete_calendar_job.js | 9 +++++++++ api/api/ml.delete_datafeed.js | 9 +++++++++ api/api/ml.delete_expired_data.js | 9 +++++++++ api/api/ml.delete_filter.js | 9 +++++++++ api/api/ml.delete_forecast.js | 9 +++++++++ api/api/ml.delete_job.js | 9 +++++++++ api/api/ml.delete_model_snapshot.js | 9 +++++++++ api/api/ml.find_file_structure.js | 9 +++++++++ api/api/ml.flush_job.js | 9 +++++++++ api/api/ml.forecast.js | 9 +++++++++ api/api/ml.get_buckets.js | 9 +++++++++ api/api/ml.get_calendar_events.js | 9 +++++++++ api/api/ml.get_calendars.js | 9 +++++++++ api/api/ml.get_categories.js | 9 +++++++++ api/api/ml.get_datafeed_stats.js | 9 +++++++++ api/api/ml.get_datafeeds.js | 9 +++++++++ api/api/ml.get_filters.js | 9 +++++++++ api/api/ml.get_influencers.js | 9 +++++++++ api/api/ml.get_job_stats.js | 9 +++++++++ api/api/ml.get_jobs.js | 9 +++++++++ api/api/ml.get_model_snapshots.js | 9 +++++++++ api/api/ml.get_overall_buckets.js | 9 +++++++++ api/api/ml.get_records.js | 9 +++++++++ api/api/ml.info.js | 9 +++++++++ api/api/ml.open_job.js | 9 +++++++++ api/api/ml.post_calendar_events.js | 9 +++++++++ api/api/ml.post_data.js | 9 +++++++++ api/api/ml.preview_datafeed.js | 9 +++++++++ api/api/ml.put_calendar.js | 9 +++++++++ api/api/ml.put_calendar_job.js | 9 +++++++++ api/api/ml.put_datafeed.js | 9 +++++++++ api/api/ml.put_filter.js | 9 +++++++++ api/api/ml.put_job.js | 9 +++++++++ api/api/ml.revert_model_snapshot.js | 9 +++++++++ api/api/ml.set_upgrade_mode.js | 9 +++++++++ api/api/ml.start_datafeed.js | 9 +++++++++ api/api/ml.stop_datafeed.js | 9 +++++++++ api/api/ml.update_datafeed.js | 9 +++++++++ api/api/ml.update_filter.js | 9 +++++++++ api/api/ml.update_job.js | 9 +++++++++ api/api/ml.update_model_snapshot.js | 9 +++++++++ api/api/ml.validate.js | 9 +++++++++ api/api/ml.validate_detector.js | 9 +++++++++ api/api/monitoring.bulk.js | 9 +++++++++ api/api/msearch.js | 9 +++++++++ api/api/msearch_template.js | 9 +++++++++ api/api/mtermvectors.js | 9 +++++++++ api/api/nodes.hot_threads.js | 9 +++++++++ api/api/nodes.info.js | 9 +++++++++ api/api/nodes.reload_secure_settings.js | 9 +++++++++ api/api/nodes.stats.js | 9 +++++++++ api/api/nodes.usage.js | 9 +++++++++ api/api/ping.js | 9 +++++++++ api/api/put_script.js | 9 +++++++++ api/api/rank_eval.js | 9 +++++++++ api/api/reindex.js | 9 +++++++++ api/api/reindex_rethrottle.js | 9 +++++++++ api/api/render_search_template.js | 9 +++++++++ api/api/scripts_painless_execute.js | 9 +++++++++ api/api/scroll.js | 9 +++++++++ api/api/search.js | 9 +++++++++ api/api/search_shards.js | 9 +++++++++ api/api/search_template.js | 9 +++++++++ api/api/security.authenticate.js | 9 +++++++++ api/api/security.change_password.js | 9 +++++++++ api/api/security.clear_cached_realms.js | 9 +++++++++ api/api/security.clear_cached_roles.js | 9 +++++++++ api/api/security.create_api_key.js | 9 +++++++++ api/api/security.delete_privileges.js | 9 +++++++++ api/api/security.delete_role.js | 9 +++++++++ api/api/security.delete_role_mapping.js | 9 +++++++++ api/api/security.delete_user.js | 9 +++++++++ api/api/security.disable_user.js | 9 +++++++++ api/api/security.enable_user.js | 9 +++++++++ api/api/security.get_api_key.js | 9 +++++++++ api/api/security.get_privileges.js | 9 +++++++++ api/api/security.get_role.js | 9 +++++++++ api/api/security.get_role_mapping.js | 9 +++++++++ api/api/security.get_token.js | 9 +++++++++ api/api/security.get_user.js | 9 +++++++++ api/api/security.get_user_privileges.js | 9 +++++++++ api/api/security.has_privileges.js | 9 +++++++++ api/api/security.invalidate_api_key.js | 9 +++++++++ api/api/security.invalidate_token.js | 9 +++++++++ api/api/security.put_privileges.js | 9 +++++++++ api/api/security.put_role.js | 9 +++++++++ api/api/security.put_role_mapping.js | 9 +++++++++ api/api/security.put_user.js | 9 +++++++++ api/api/snapshot.create.js | 9 +++++++++ api/api/snapshot.create_repository.js | 9 +++++++++ api/api/snapshot.delete.js | 9 +++++++++ api/api/snapshot.delete_repository.js | 9 +++++++++ api/api/snapshot.get.js | 9 +++++++++ api/api/snapshot.get_repository.js | 9 +++++++++ api/api/snapshot.restore.js | 9 +++++++++ api/api/snapshot.status.js | 9 +++++++++ api/api/snapshot.verify_repository.js | 9 +++++++++ api/api/ssl.certificates.js | 9 +++++++++ api/api/tasks.cancel.js | 9 +++++++++ api/api/tasks.get.js | 9 +++++++++ api/api/tasks.list.js | 9 +++++++++ api/api/termvectors.js | 9 +++++++++ api/api/update.js | 9 +++++++++ api/api/update_by_query.js | 9 +++++++++ api/api/update_by_query_rethrottle.js | 9 +++++++++ api/api/xpack.graph.explore.js | 9 +++++++++ api/api/xpack.info.js | 9 +++++++++ api/api/xpack.license.delete.js | 9 +++++++++ api/api/xpack.license.get.js | 9 +++++++++ api/api/xpack.license.get_basic_status.js | 9 +++++++++ api/api/xpack.license.get_trial_status.js | 9 +++++++++ api/api/xpack.license.post.js | 9 +++++++++ api/api/xpack.license.post_start_basic.js | 9 +++++++++ api/api/xpack.license.post_start_trial.js | 9 +++++++++ api/api/xpack.migration.deprecations.js | 9 +++++++++ api/api/xpack.migration.get_assistance.js | 9 +++++++++ api/api/xpack.migration.upgrade.js | 9 +++++++++ api/api/xpack.rollup.delete_job.js | 9 +++++++++ api/api/xpack.rollup.get_jobs.js | 9 +++++++++ api/api/xpack.rollup.get_rollup_caps.js | 9 +++++++++ api/api/xpack.rollup.get_rollup_index_caps.js | 9 +++++++++ api/api/xpack.rollup.put_job.js | 9 +++++++++ api/api/xpack.rollup.rollup_search.js | 9 +++++++++ api/api/xpack.rollup.start_job.js | 9 +++++++++ api/api/xpack.rollup.stop_job.js | 9 +++++++++ api/api/xpack.sql.clear_cursor.js | 9 +++++++++ api/api/xpack.sql.query.js | 9 +++++++++ api/api/xpack.sql.translate.js | 9 +++++++++ api/api/xpack.usage.js | 9 +++++++++ api/api/xpack.watcher.ack_watch.js | 9 +++++++++ api/api/xpack.watcher.activate_watch.js | 9 +++++++++ api/api/xpack.watcher.deactivate_watch.js | 9 +++++++++ api/api/xpack.watcher.delete_watch.js | 9 +++++++++ api/api/xpack.watcher.execute_watch.js | 9 +++++++++ api/api/xpack.watcher.get_watch.js | 9 +++++++++ api/api/xpack.watcher.put_watch.js | 9 +++++++++ api/api/xpack.watcher.start.js | 9 +++++++++ api/api/xpack.watcher.stats.js | 9 +++++++++ api/api/xpack.watcher.stop.js | 9 +++++++++ 253 files changed, 2277 insertions(+) diff --git a/api/api/bulk.js b/api/api/bulk.js index 957f215e0..419b56196 100644 --- a/api/api/bulk.js +++ b/api/api/bulk.js @@ -79,6 +79,15 @@ function buildBulk (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + bulk(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['body'] == null) { return callback( diff --git a/api/api/cat.aliases.js b/api/api/cat.aliases.js index 8627157db..9b28f6edd 100644 --- a/api/api/cat.aliases.js +++ b/api/api/cat.aliases.js @@ -71,6 +71,15 @@ function buildCatAliases (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + catAliases(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/cat.allocation.js b/api/api/cat.allocation.js index 767854188..98f257d96 100644 --- a/api/api/cat.allocation.js +++ b/api/api/cat.allocation.js @@ -73,6 +73,15 @@ function buildCatAllocation (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + catAllocation(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/cat.count.js b/api/api/cat.count.js index 6fa162c4a..c57074c9f 100644 --- a/api/api/cat.count.js +++ b/api/api/cat.count.js @@ -71,6 +71,15 @@ function buildCatCount (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + catCount(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/cat.fielddata.js b/api/api/cat.fielddata.js index 22c9377a5..6fb432d58 100644 --- a/api/api/cat.fielddata.js +++ b/api/api/cat.fielddata.js @@ -75,6 +75,15 @@ function buildCatFielddata (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + catFielddata(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/cat.health.js b/api/api/cat.health.js index eb255cc9a..0db6c289b 100644 --- a/api/api/cat.health.js +++ b/api/api/cat.health.js @@ -72,6 +72,15 @@ function buildCatHealth (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + catHealth(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/cat.help.js b/api/api/cat.help.js index ebea416e1..f85171721 100644 --- a/api/api/cat.help.js +++ b/api/api/cat.help.js @@ -59,6 +59,15 @@ function buildCatHelp (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + catHelp(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/cat.indices.js b/api/api/cat.indices.js index 2ff28920d..62f365588 100644 --- a/api/api/cat.indices.js +++ b/api/api/cat.indices.js @@ -77,6 +77,15 @@ function buildCatIndices (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + catIndices(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/cat.master.js b/api/api/cat.master.js index 432dbd775..31adac93f 100644 --- a/api/api/cat.master.js +++ b/api/api/cat.master.js @@ -70,6 +70,15 @@ function buildCatMaster (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + catMaster(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/cat.nodeattrs.js b/api/api/cat.nodeattrs.js index 2cebea1d7..9e97e6a24 100644 --- a/api/api/cat.nodeattrs.js +++ b/api/api/cat.nodeattrs.js @@ -70,6 +70,15 @@ function buildCatNodeattrs (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + catNodeattrs(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/cat.nodes.js b/api/api/cat.nodes.js index dfa320a08..bcd3c0662 100644 --- a/api/api/cat.nodes.js +++ b/api/api/cat.nodes.js @@ -73,6 +73,15 @@ function buildCatNodes (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + catNodes(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/cat.pending_tasks.js b/api/api/cat.pending_tasks.js index 4205042ae..f24bff525 100644 --- a/api/api/cat.pending_tasks.js +++ b/api/api/cat.pending_tasks.js @@ -70,6 +70,15 @@ function buildCatPendingTasks (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + catPendingTasks(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/cat.plugins.js b/api/api/cat.plugins.js index 6fa73552c..c55fcdd29 100644 --- a/api/api/cat.plugins.js +++ b/api/api/cat.plugins.js @@ -70,6 +70,15 @@ function buildCatPlugins (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + catPlugins(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/cat.recovery.js b/api/api/cat.recovery.js index 985ed4902..42e0c1e0c 100644 --- a/api/api/cat.recovery.js +++ b/api/api/cat.recovery.js @@ -71,6 +71,15 @@ function buildCatRecovery (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + catRecovery(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/cat.repositories.js b/api/api/cat.repositories.js index 742a2ce56..8e8b6f6c9 100644 --- a/api/api/cat.repositories.js +++ b/api/api/cat.repositories.js @@ -70,6 +70,15 @@ function buildCatRepositories (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + catRepositories(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/cat.segments.js b/api/api/cat.segments.js index 2e4e5f184..c10af3b23 100644 --- a/api/api/cat.segments.js +++ b/api/api/cat.segments.js @@ -68,6 +68,15 @@ function buildCatSegments (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + catSegments(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/cat.shards.js b/api/api/cat.shards.js index 482dd015f..5ae0d1b18 100644 --- a/api/api/cat.shards.js +++ b/api/api/cat.shards.js @@ -73,6 +73,15 @@ function buildCatShards (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + catShards(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/cat.snapshots.js b/api/api/cat.snapshots.js index eaded0a18..af82bc574 100644 --- a/api/api/cat.snapshots.js +++ b/api/api/cat.snapshots.js @@ -72,6 +72,15 @@ function buildCatSnapshots (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + catSnapshots(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/cat.tasks.js b/api/api/cat.tasks.js index 720459a6f..c8005d5e7 100644 --- a/api/api/cat.tasks.js +++ b/api/api/cat.tasks.js @@ -75,6 +75,15 @@ function buildCatTasks (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + catTasks(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/cat.templates.js b/api/api/cat.templates.js index f3a4f11f7..ff89cb284 100644 --- a/api/api/cat.templates.js +++ b/api/api/cat.templates.js @@ -71,6 +71,15 @@ function buildCatTemplates (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + catTemplates(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/cat.thread_pool.js b/api/api/cat.thread_pool.js index 44756ab39..0b07b0e0a 100644 --- a/api/api/cat.thread_pool.js +++ b/api/api/cat.thread_pool.js @@ -73,6 +73,15 @@ function buildCatThreadPool (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + catThreadPool(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/ccr.delete_auto_follow_pattern.js b/api/api/ccr.delete_auto_follow_pattern.js index 04cfe48b5..d5ebd1cfd 100644 --- a/api/api/ccr.delete_auto_follow_pattern.js +++ b/api/api/ccr.delete_auto_follow_pattern.js @@ -51,6 +51,15 @@ function buildCcrDeleteAutoFollowPattern (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ccrDeleteAutoFollowPattern(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['name'] == null) { return callback( diff --git a/api/api/ccr.follow.js b/api/api/ccr.follow.js index 6983bfea0..7c86848bf 100644 --- a/api/api/ccr.follow.js +++ b/api/api/ccr.follow.js @@ -53,6 +53,15 @@ function buildCcrFollow (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ccrFollow(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['index'] == null) { return callback( diff --git a/api/api/ccr.follow_info.js b/api/api/ccr.follow_info.js index 0a27de878..ec9923b1f 100644 --- a/api/api/ccr.follow_info.js +++ b/api/api/ccr.follow_info.js @@ -51,6 +51,15 @@ function buildCcrFollowInfo (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ccrFollowInfo(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // validate headers object if (options.headers != null && typeof options.headers !== 'object') { return callback( diff --git a/api/api/ccr.follow_stats.js b/api/api/ccr.follow_stats.js index c4f53e66c..62ee7f266 100644 --- a/api/api/ccr.follow_stats.js +++ b/api/api/ccr.follow_stats.js @@ -51,6 +51,15 @@ function buildCcrFollowStats (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ccrFollowStats(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // validate headers object if (options.headers != null && typeof options.headers !== 'object') { return callback( diff --git a/api/api/ccr.get_auto_follow_pattern.js b/api/api/ccr.get_auto_follow_pattern.js index 6e59191e1..261bce9ac 100644 --- a/api/api/ccr.get_auto_follow_pattern.js +++ b/api/api/ccr.get_auto_follow_pattern.js @@ -51,6 +51,15 @@ function buildCcrGetAutoFollowPattern (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ccrGetAutoFollowPattern(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // validate headers object if (options.headers != null && typeof options.headers !== 'object') { return callback( diff --git a/api/api/ccr.pause_follow.js b/api/api/ccr.pause_follow.js index 2e15a0430..81b0cde7b 100644 --- a/api/api/ccr.pause_follow.js +++ b/api/api/ccr.pause_follow.js @@ -51,6 +51,15 @@ function buildCcrPauseFollow (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ccrPauseFollow(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['index'] == null) { return callback( diff --git a/api/api/ccr.put_auto_follow_pattern.js b/api/api/ccr.put_auto_follow_pattern.js index d660fafc1..846a29445 100644 --- a/api/api/ccr.put_auto_follow_pattern.js +++ b/api/api/ccr.put_auto_follow_pattern.js @@ -52,6 +52,15 @@ function buildCcrPutAutoFollowPattern (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ccrPutAutoFollowPattern(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['name'] == null) { return callback( diff --git a/api/api/ccr.resume_follow.js b/api/api/ccr.resume_follow.js index e4fec5dc5..ac47bfac5 100644 --- a/api/api/ccr.resume_follow.js +++ b/api/api/ccr.resume_follow.js @@ -52,6 +52,15 @@ function buildCcrResumeFollow (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ccrResumeFollow(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['index'] == null) { return callback( diff --git a/api/api/ccr.stats.js b/api/api/ccr.stats.js index e127ae0ca..4de395d30 100644 --- a/api/api/ccr.stats.js +++ b/api/api/ccr.stats.js @@ -50,6 +50,15 @@ function buildCcrStats (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ccrStats(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // validate headers object if (options.headers != null && typeof options.headers !== 'object') { return callback( diff --git a/api/api/ccr.unfollow.js b/api/api/ccr.unfollow.js index 44af6a3a8..5886296b2 100644 --- a/api/api/ccr.unfollow.js +++ b/api/api/ccr.unfollow.js @@ -51,6 +51,15 @@ function buildCcrUnfollow (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ccrUnfollow(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['index'] == null) { return callback( diff --git a/api/api/clear_scroll.js b/api/api/clear_scroll.js index bcf7a5afc..d3e0ec0ac 100644 --- a/api/api/clear_scroll.js +++ b/api/api/clear_scroll.js @@ -57,6 +57,15 @@ function buildClearScroll (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + clearScroll(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // validate headers object if (options.headers != null && typeof options.headers !== 'object') { return callback( diff --git a/api/api/cluster.allocation_explain.js b/api/api/cluster.allocation_explain.js index 9463e1e90..2392e61c7 100644 --- a/api/api/cluster.allocation_explain.js +++ b/api/api/cluster.allocation_explain.js @@ -62,6 +62,15 @@ function buildClusterAllocationExplain (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + clusterAllocationExplain(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // validate headers object if (options.headers != null && typeof options.headers !== 'object') { return callback( diff --git a/api/api/cluster.get_settings.js b/api/api/cluster.get_settings.js index 8f7f13c41..d024742cb 100644 --- a/api/api/cluster.get_settings.js +++ b/api/api/cluster.get_settings.js @@ -66,6 +66,15 @@ function buildClusterGetSettings (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + clusterGetSettings(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/cluster.health.js b/api/api/cluster.health.js index 6ff729d8a..f8a75c1f4 100644 --- a/api/api/cluster.health.js +++ b/api/api/cluster.health.js @@ -83,6 +83,15 @@ function buildClusterHealth (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + clusterHealth(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/cluster.pending_tasks.js b/api/api/cluster.pending_tasks.js index 86023cb45..43ddbf53c 100644 --- a/api/api/cluster.pending_tasks.js +++ b/api/api/cluster.pending_tasks.js @@ -60,6 +60,15 @@ function buildClusterPendingTasks (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + clusterPendingTasks(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/cluster.put_settings.js b/api/api/cluster.put_settings.js index 110a5bf21..54ec859ed 100644 --- a/api/api/cluster.put_settings.js +++ b/api/api/cluster.put_settings.js @@ -64,6 +64,15 @@ function buildClusterPutSettings (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + clusterPutSettings(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['body'] == null) { return callback( diff --git a/api/api/cluster.remote_info.js b/api/api/cluster.remote_info.js index 93ba95308..95f965c44 100644 --- a/api/api/cluster.remote_info.js +++ b/api/api/cluster.remote_info.js @@ -55,6 +55,15 @@ function buildClusterRemoteInfo (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + clusterRemoteInfo(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/cluster.reroute.js b/api/api/cluster.reroute.js index 160b6b5b4..d106cd13c 100644 --- a/api/api/cluster.reroute.js +++ b/api/api/cluster.reroute.js @@ -71,6 +71,15 @@ function buildClusterReroute (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + clusterReroute(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // validate headers object if (options.headers != null && typeof options.headers !== 'object') { return callback( diff --git a/api/api/cluster.state.js b/api/api/cluster.state.js index 91f68781c..a8b350120 100644 --- a/api/api/cluster.state.js +++ b/api/api/cluster.state.js @@ -80,6 +80,15 @@ function buildClusterState (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + clusterState(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/cluster.stats.js b/api/api/cluster.stats.js index a07b2a324..b313c7827 100644 --- a/api/api/cluster.stats.js +++ b/api/api/cluster.stats.js @@ -61,6 +61,15 @@ function buildClusterStats (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + clusterStats(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/count.js b/api/api/count.js index 9dd09c294..536c07f62 100644 --- a/api/api/count.js +++ b/api/api/count.js @@ -94,6 +94,15 @@ function buildCount (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + count(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required url components if (params['type'] != null && (params['index'] == null)) { return callback( diff --git a/api/api/create.js b/api/api/create.js index eb18d517b..4b7a113da 100644 --- a/api/api/create.js +++ b/api/api/create.js @@ -77,6 +77,15 @@ function buildCreate (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + create(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['id'] == null) { return callback( diff --git a/api/api/delete.js b/api/api/delete.js index db3e90b35..dd78e7c19 100644 --- a/api/api/delete.js +++ b/api/api/delete.js @@ -80,6 +80,15 @@ function buildDelete (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + _delete(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['id'] == null) { return callback( diff --git a/api/api/delete_by_query.js b/api/api/delete_by_query.js index 559bcd201..cd0a34e9a 100644 --- a/api/api/delete_by_query.js +++ b/api/api/delete_by_query.js @@ -137,6 +137,15 @@ function buildDeleteByQuery (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + deleteByQuery(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['index'] == null) { return callback( diff --git a/api/api/delete_by_query_rethrottle.js b/api/api/delete_by_query_rethrottle.js index 3d9cb752f..089ccf67c 100644 --- a/api/api/delete_by_query_rethrottle.js +++ b/api/api/delete_by_query_rethrottle.js @@ -59,6 +59,15 @@ function buildDeleteByQueryRethrottle (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + deleteByQueryRethrottle(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['task_id'] == null && params['taskId'] == null) { return callback( diff --git a/api/api/delete_script.js b/api/api/delete_script.js index fed63e09d..804c4bd3e 100644 --- a/api/api/delete_script.js +++ b/api/api/delete_script.js @@ -61,6 +61,15 @@ function buildDeleteScript (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + deleteScript(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['id'] == null) { return callback( diff --git a/api/api/exists.js b/api/api/exists.js index 58dba35b1..b9b28eec3 100644 --- a/api/api/exists.js +++ b/api/api/exists.js @@ -84,6 +84,15 @@ function buildExists (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + exists(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['id'] == null) { return callback( diff --git a/api/api/exists_source.js b/api/api/exists_source.js index a4280b7eb..bd5a93303 100644 --- a/api/api/exists_source.js +++ b/api/api/exists_source.js @@ -81,6 +81,15 @@ function buildExistsSource (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + existsSource(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['id'] == null) { return callback( diff --git a/api/api/explain.js b/api/api/explain.js index cdba2dc5c..d37b203ab 100644 --- a/api/api/explain.js +++ b/api/api/explain.js @@ -90,6 +90,15 @@ function buildExplain (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + explain(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['id'] == null) { return callback( diff --git a/api/api/field_caps.js b/api/api/field_caps.js index 79f2ad7be..b8a091fb2 100644 --- a/api/api/field_caps.js +++ b/api/api/field_caps.js @@ -67,6 +67,15 @@ function buildFieldCaps (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + fieldCaps(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/get.js b/api/api/get.js index af04e37c5..d59494cc8 100644 --- a/api/api/get.js +++ b/api/api/get.js @@ -90,6 +90,15 @@ function buildGet (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + get(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['id'] == null) { return callback( diff --git a/api/api/get_script.js b/api/api/get_script.js index ef873a5ee..e0c42cfab 100644 --- a/api/api/get_script.js +++ b/api/api/get_script.js @@ -59,6 +59,15 @@ function buildGetScript (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + getScript(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['id'] == null) { return callback( diff --git a/api/api/get_source.js b/api/api/get_source.js index 18ad2e4e6..1ea12b53d 100644 --- a/api/api/get_source.js +++ b/api/api/get_source.js @@ -81,6 +81,15 @@ function buildGetSource (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + getSource(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['id'] == null) { return callback( diff --git a/api/api/ilm.delete_lifecycle.js b/api/api/ilm.delete_lifecycle.js index 8d2c2b6b5..fcab49377 100644 --- a/api/api/ilm.delete_lifecycle.js +++ b/api/api/ilm.delete_lifecycle.js @@ -51,6 +51,15 @@ function buildIlmDeleteLifecycle (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ilmDeleteLifecycle(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/ilm.explain_lifecycle.js b/api/api/ilm.explain_lifecycle.js index 377959873..0e25f2fa0 100644 --- a/api/api/ilm.explain_lifecycle.js +++ b/api/api/ilm.explain_lifecycle.js @@ -52,6 +52,15 @@ function buildIlmExplainLifecycle (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ilmExplainLifecycle(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/ilm.get_lifecycle.js b/api/api/ilm.get_lifecycle.js index d4aea2190..5b3a25a17 100644 --- a/api/api/ilm.get_lifecycle.js +++ b/api/api/ilm.get_lifecycle.js @@ -51,6 +51,15 @@ function buildIlmGetLifecycle (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ilmGetLifecycle(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/ilm.get_status.js b/api/api/ilm.get_status.js index 38df25c38..801ff5275 100644 --- a/api/api/ilm.get_status.js +++ b/api/api/ilm.get_status.js @@ -50,6 +50,15 @@ function buildIlmGetStatus (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ilmGetStatus(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/ilm.move_to_step.js b/api/api/ilm.move_to_step.js index 0f6b9274f..392421dbb 100644 --- a/api/api/ilm.move_to_step.js +++ b/api/api/ilm.move_to_step.js @@ -52,6 +52,15 @@ function buildIlmMoveToStep (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ilmMoveToStep(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // validate headers object if (options.headers != null && typeof options.headers !== 'object') { return callback( diff --git a/api/api/ilm.put_lifecycle.js b/api/api/ilm.put_lifecycle.js index de148ad62..dfbc27f82 100644 --- a/api/api/ilm.put_lifecycle.js +++ b/api/api/ilm.put_lifecycle.js @@ -52,6 +52,15 @@ function buildIlmPutLifecycle (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ilmPutLifecycle(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // validate headers object if (options.headers != null && typeof options.headers !== 'object') { return callback( diff --git a/api/api/ilm.remove_policy.js b/api/api/ilm.remove_policy.js index f0258c29c..c0d45128b 100644 --- a/api/api/ilm.remove_policy.js +++ b/api/api/ilm.remove_policy.js @@ -51,6 +51,15 @@ function buildIlmRemovePolicy (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ilmRemovePolicy(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/ilm.retry.js b/api/api/ilm.retry.js index 6568a0a40..337f19ecf 100644 --- a/api/api/ilm.retry.js +++ b/api/api/ilm.retry.js @@ -51,6 +51,15 @@ function buildIlmRetry (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ilmRetry(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/ilm.start.js b/api/api/ilm.start.js index 840700141..1b692b3c0 100644 --- a/api/api/ilm.start.js +++ b/api/api/ilm.start.js @@ -50,6 +50,15 @@ function buildIlmStart (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ilmStart(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/ilm.stop.js b/api/api/ilm.stop.js index 166ed28b1..be9dfdaef 100644 --- a/api/api/ilm.stop.js +++ b/api/api/ilm.stop.js @@ -50,6 +50,15 @@ function buildIlmStop (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ilmStop(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/index.js b/api/api/index.js index 213b41ac5..bb15a2ab3 100644 --- a/api/api/index.js +++ b/api/api/index.js @@ -86,6 +86,15 @@ function buildIndex (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + _index(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['index'] == null) { return callback( diff --git a/api/api/indices.analyze.js b/api/api/indices.analyze.js index b4d697bc8..c4ae2ea1f 100644 --- a/api/api/indices.analyze.js +++ b/api/api/indices.analyze.js @@ -59,6 +59,15 @@ function buildIndicesAnalyze (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesAnalyze(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // validate headers object if (options.headers != null && typeof options.headers !== 'object') { return callback( diff --git a/api/api/indices.clear_cache.js b/api/api/indices.clear_cache.js index 2d6b3be6b..55fcf8db1 100644 --- a/api/api/indices.clear_cache.js +++ b/api/api/indices.clear_cache.js @@ -75,6 +75,15 @@ function buildIndicesClearCache (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesClearCache(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/indices.close.js b/api/api/indices.close.js index 46a92f3a9..c021ed985 100644 --- a/api/api/indices.close.js +++ b/api/api/indices.close.js @@ -70,6 +70,15 @@ function buildIndicesClose (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesClose(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['index'] == null) { return callback( diff --git a/api/api/indices.create.js b/api/api/indices.create.js index fadcb4981..669e763e0 100644 --- a/api/api/indices.create.js +++ b/api/api/indices.create.js @@ -68,6 +68,15 @@ function buildIndicesCreate (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesCreate(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['index'] == null) { return callback( diff --git a/api/api/indices.delete.js b/api/api/indices.delete.js index 5a48c7794..8f7521a27 100644 --- a/api/api/indices.delete.js +++ b/api/api/indices.delete.js @@ -70,6 +70,15 @@ function buildIndicesDelete (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesDelete(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['index'] == null) { return callback( diff --git a/api/api/indices.delete_alias.js b/api/api/indices.delete_alias.js index 5b57fbb63..73cdac0f8 100644 --- a/api/api/indices.delete_alias.js +++ b/api/api/indices.delete_alias.js @@ -62,6 +62,15 @@ function buildIndicesDeleteAlias (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesDeleteAlias(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['index'] == null) { return callback( diff --git a/api/api/indices.delete_template.js b/api/api/indices.delete_template.js index a7fb0aca5..149b731bd 100644 --- a/api/api/indices.delete_template.js +++ b/api/api/indices.delete_template.js @@ -61,6 +61,15 @@ function buildIndicesDeleteTemplate (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesDeleteTemplate(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['name'] == null) { return callback( diff --git a/api/api/indices.exists.js b/api/api/indices.exists.js index a25cea993..106fe6ecd 100644 --- a/api/api/indices.exists.js +++ b/api/api/indices.exists.js @@ -73,6 +73,15 @@ function buildIndicesExists (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesExists(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['index'] == null) { return callback( diff --git a/api/api/indices.exists_alias.js b/api/api/indices.exists_alias.js index 9a5de4520..9549b8d45 100644 --- a/api/api/indices.exists_alias.js +++ b/api/api/indices.exists_alias.js @@ -68,6 +68,15 @@ function buildIndicesExistsAlias (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesExistsAlias(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['name'] == null) { return callback( diff --git a/api/api/indices.exists_template.js b/api/api/indices.exists_template.js index 52f0ab596..a8c7b5818 100644 --- a/api/api/indices.exists_template.js +++ b/api/api/indices.exists_template.js @@ -64,6 +64,15 @@ function buildIndicesExistsTemplate (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesExistsTemplate(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['name'] == null) { return callback( diff --git a/api/api/indices.exists_type.js b/api/api/indices.exists_type.js index 120f27f14..7c405dd56 100644 --- a/api/api/indices.exists_type.js +++ b/api/api/indices.exists_type.js @@ -68,6 +68,15 @@ function buildIndicesExistsType (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesExistsType(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['index'] == null) { return callback( diff --git a/api/api/indices.flush.js b/api/api/indices.flush.js index 854665f33..d949c3eb6 100644 --- a/api/api/indices.flush.js +++ b/api/api/indices.flush.js @@ -70,6 +70,15 @@ function buildIndicesFlush (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesFlush(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/indices.flush_synced.js b/api/api/indices.flush_synced.js index ca4fa36f6..a1dae252d 100644 --- a/api/api/indices.flush_synced.js +++ b/api/api/indices.flush_synced.js @@ -65,6 +65,15 @@ function buildIndicesFlushSynced (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesFlushSynced(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/indices.forcemerge.js b/api/api/indices.forcemerge.js index e4616ab7e..455718fcb 100644 --- a/api/api/indices.forcemerge.js +++ b/api/api/indices.forcemerge.js @@ -73,6 +73,15 @@ function buildIndicesForcemerge (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesForcemerge(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/indices.freeze.js b/api/api/indices.freeze.js index bc2745c56..4e2d6e6c2 100644 --- a/api/api/indices.freeze.js +++ b/api/api/indices.freeze.js @@ -66,6 +66,15 @@ function buildIndicesFreeze (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesFreeze(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['index'] == null) { return callback( diff --git a/api/api/indices.get.js b/api/api/indices.get.js index bfcefdf9b..87597eed6 100644 --- a/api/api/indices.get.js +++ b/api/api/indices.get.js @@ -79,6 +79,15 @@ function buildIndicesGet (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesGet(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['index'] == null) { return callback( diff --git a/api/api/indices.get_alias.js b/api/api/indices.get_alias.js index e0e06505d..454d60580 100644 --- a/api/api/indices.get_alias.js +++ b/api/api/indices.get_alias.js @@ -68,6 +68,15 @@ function buildIndicesGetAlias (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesGetAlias(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/indices.get_field_mapping.js b/api/api/indices.get_field_mapping.js index f4b3e968c..c3bf09e61 100644 --- a/api/api/indices.get_field_mapping.js +++ b/api/api/indices.get_field_mapping.js @@ -75,6 +75,15 @@ function buildIndicesGetFieldMapping (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesGetFieldMapping(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['fields'] == null) { return callback( diff --git a/api/api/indices.get_mapping.js b/api/api/indices.get_mapping.js index 1f2f2b5d9..173d1d7c6 100644 --- a/api/api/indices.get_mapping.js +++ b/api/api/indices.get_mapping.js @@ -74,6 +74,15 @@ function buildIndicesGetMapping (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesGetMapping(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/indices.get_settings.js b/api/api/indices.get_settings.js index 6e444f08e..08f5f7bc7 100644 --- a/api/api/indices.get_settings.js +++ b/api/api/indices.get_settings.js @@ -77,6 +77,15 @@ function buildIndicesGetSettings (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesGetSettings(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/indices.get_template.js b/api/api/indices.get_template.js index 58fb3d83a..2dfed0419 100644 --- a/api/api/indices.get_template.js +++ b/api/api/indices.get_template.js @@ -67,6 +67,15 @@ function buildIndicesGetTemplate (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesGetTemplate(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/indices.get_upgrade.js b/api/api/indices.get_upgrade.js index a2b34458b..6ddbc646d 100644 --- a/api/api/indices.get_upgrade.js +++ b/api/api/indices.get_upgrade.js @@ -65,6 +65,15 @@ function buildIndicesGetUpgrade (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesGetUpgrade(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/indices.open.js b/api/api/indices.open.js index b71427566..87e7b1417 100644 --- a/api/api/indices.open.js +++ b/api/api/indices.open.js @@ -73,6 +73,15 @@ function buildIndicesOpen (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesOpen(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['index'] == null) { return callback( diff --git a/api/api/indices.put_alias.js b/api/api/indices.put_alias.js index 7e5566d44..c6c5a2ee5 100644 --- a/api/api/indices.put_alias.js +++ b/api/api/indices.put_alias.js @@ -63,6 +63,15 @@ function buildIndicesPutAlias (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesPutAlias(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['index'] == null) { return callback( diff --git a/api/api/indices.put_mapping.js b/api/api/indices.put_mapping.js index da3c84df6..c62fd80a6 100644 --- a/api/api/indices.put_mapping.js +++ b/api/api/indices.put_mapping.js @@ -75,6 +75,15 @@ function buildIndicesPutMapping (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesPutMapping(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['body'] == null) { return callback( diff --git a/api/api/indices.put_settings.js b/api/api/indices.put_settings.js index 6fa62c36e..8cf46293f 100644 --- a/api/api/indices.put_settings.js +++ b/api/api/indices.put_settings.js @@ -77,6 +77,15 @@ function buildIndicesPutSettings (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesPutSettings(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['body'] == null) { return callback( diff --git a/api/api/indices.put_template.js b/api/api/indices.put_template.js index 55157756a..8f6f1c10e 100644 --- a/api/api/indices.put_template.js +++ b/api/api/indices.put_template.js @@ -72,6 +72,15 @@ function buildIndicesPutTemplate (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesPutTemplate(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['name'] == null) { return callback( diff --git a/api/api/indices.recovery.js b/api/api/indices.recovery.js index 9fbb6c4ed..9556b44ee 100644 --- a/api/api/indices.recovery.js +++ b/api/api/indices.recovery.js @@ -61,6 +61,15 @@ function buildIndicesRecovery (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesRecovery(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/indices.refresh.js b/api/api/indices.refresh.js index 87cbb843d..72298aca3 100644 --- a/api/api/indices.refresh.js +++ b/api/api/indices.refresh.js @@ -65,6 +65,15 @@ function buildIndicesRefresh (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesRefresh(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/indices.rollover.js b/api/api/indices.rollover.js index a2ad11201..c3bcd699a 100644 --- a/api/api/indices.rollover.js +++ b/api/api/indices.rollover.js @@ -72,6 +72,15 @@ function buildIndicesRollover (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesRollover(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['alias'] == null) { return callback( diff --git a/api/api/indices.segments.js b/api/api/indices.segments.js index cc1be5728..f0058cc6d 100644 --- a/api/api/indices.segments.js +++ b/api/api/indices.segments.js @@ -67,6 +67,15 @@ function buildIndicesSegments (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesSegments(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/indices.shard_stores.js b/api/api/indices.shard_stores.js index 8add1c770..ff22da906 100644 --- a/api/api/indices.shard_stores.js +++ b/api/api/indices.shard_stores.js @@ -67,6 +67,15 @@ function buildIndicesShardStores (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesShardStores(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/indices.shrink.js b/api/api/indices.shrink.js index 3693be4d1..8f3eb332a 100644 --- a/api/api/indices.shrink.js +++ b/api/api/indices.shrink.js @@ -69,6 +69,15 @@ function buildIndicesShrink (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesShrink(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['index'] == null) { return callback( diff --git a/api/api/indices.split.js b/api/api/indices.split.js index 26b6cefd6..51e22c94f 100644 --- a/api/api/indices.split.js +++ b/api/api/indices.split.js @@ -69,6 +69,15 @@ function buildIndicesSplit (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesSplit(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['index'] == null) { return callback( diff --git a/api/api/indices.stats.js b/api/api/indices.stats.js index 3c0b0906f..879ff40ad 100644 --- a/api/api/indices.stats.js +++ b/api/api/indices.stats.js @@ -74,6 +74,15 @@ function buildIndicesStats (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesStats(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/indices.unfreeze.js b/api/api/indices.unfreeze.js index 7c40fb726..58ac257ac 100644 --- a/api/api/indices.unfreeze.js +++ b/api/api/indices.unfreeze.js @@ -66,6 +66,15 @@ function buildIndicesUnfreeze (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesUnfreeze(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['index'] == null) { return callback( diff --git a/api/api/indices.update_aliases.js b/api/api/indices.update_aliases.js index 2d9dd6f15..7188e5112 100644 --- a/api/api/indices.update_aliases.js +++ b/api/api/indices.update_aliases.js @@ -61,6 +61,15 @@ function buildIndicesUpdateAliases (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesUpdateAliases(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['body'] == null) { return callback( diff --git a/api/api/indices.upgrade.js b/api/api/indices.upgrade.js index 6a16b1691..a1614f0ff 100644 --- a/api/api/indices.upgrade.js +++ b/api/api/indices.upgrade.js @@ -71,6 +71,15 @@ function buildIndicesUpgrade (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesUpgrade(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/indices.validate_query.js b/api/api/indices.validate_query.js index 813358340..6088e7d7e 100644 --- a/api/api/indices.validate_query.js +++ b/api/api/indices.validate_query.js @@ -88,6 +88,15 @@ function buildIndicesValidateQuery (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + indicesValidateQuery(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required url components if (params['type'] != null && (params['index'] == null)) { return callback( diff --git a/api/api/info.js b/api/api/info.js index 95e6c55f7..611a7382c 100644 --- a/api/api/info.js +++ b/api/api/info.js @@ -55,6 +55,15 @@ function buildInfo (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + info(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/ingest.delete_pipeline.js b/api/api/ingest.delete_pipeline.js index 303c02ae1..8a567cde5 100644 --- a/api/api/ingest.delete_pipeline.js +++ b/api/api/ingest.delete_pipeline.js @@ -61,6 +61,15 @@ function buildIngestDeletePipeline (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ingestDeletePipeline(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['id'] == null) { return callback( diff --git a/api/api/ingest.get_pipeline.js b/api/api/ingest.get_pipeline.js index 2a6aa3938..9c6a1f39f 100644 --- a/api/api/ingest.get_pipeline.js +++ b/api/api/ingest.get_pipeline.js @@ -59,6 +59,15 @@ function buildIngestGetPipeline (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ingestGetPipeline(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/ingest.processor_grok.js b/api/api/ingest.processor_grok.js index d5b47b3d6..0d040e3e0 100644 --- a/api/api/ingest.processor_grok.js +++ b/api/api/ingest.processor_grok.js @@ -55,6 +55,15 @@ function buildIngestProcessorGrok (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ingestProcessorGrok(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/ingest.put_pipeline.js b/api/api/ingest.put_pipeline.js index 13dc50ff3..2030a6be0 100644 --- a/api/api/ingest.put_pipeline.js +++ b/api/api/ingest.put_pipeline.js @@ -62,6 +62,15 @@ function buildIngestPutPipeline (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ingestPutPipeline(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['id'] == null) { return callback( diff --git a/api/api/ingest.simulate.js b/api/api/ingest.simulate.js index 4d8c299f3..00caaa44b 100644 --- a/api/api/ingest.simulate.js +++ b/api/api/ingest.simulate.js @@ -59,6 +59,15 @@ function buildIngestSimulate (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ingestSimulate(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['body'] == null) { return callback( diff --git a/api/api/mget.js b/api/api/mget.js index 5857ca38c..5844be7e5 100644 --- a/api/api/mget.js +++ b/api/api/mget.js @@ -77,6 +77,15 @@ function buildMget (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mget(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['body'] == null) { return callback( diff --git a/api/api/ml.close_job.js b/api/api/ml.close_job.js index 1b923f530..729923e0d 100644 --- a/api/api/ml.close_job.js +++ b/api/api/ml.close_job.js @@ -58,6 +58,15 @@ function buildMlCloseJob (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlCloseJob(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['job_id'] == null && params['jobId'] == null) { return callback( diff --git a/api/api/ml.delete_calendar.js b/api/api/ml.delete_calendar.js index 2e270a081..dd57aed36 100644 --- a/api/api/ml.delete_calendar.js +++ b/api/api/ml.delete_calendar.js @@ -51,6 +51,15 @@ function buildMlDeleteCalendar (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlDeleteCalendar(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['calendar_id'] == null && params['calendarId'] == null) { return callback( diff --git a/api/api/ml.delete_calendar_event.js b/api/api/ml.delete_calendar_event.js index b08e2b8ff..fcda6a576 100644 --- a/api/api/ml.delete_calendar_event.js +++ b/api/api/ml.delete_calendar_event.js @@ -52,6 +52,15 @@ function buildMlDeleteCalendarEvent (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlDeleteCalendarEvent(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['calendar_id'] == null && params['calendarId'] == null) { return callback( diff --git a/api/api/ml.delete_calendar_job.js b/api/api/ml.delete_calendar_job.js index 4db8a932a..5a7b39f8f 100644 --- a/api/api/ml.delete_calendar_job.js +++ b/api/api/ml.delete_calendar_job.js @@ -52,6 +52,15 @@ function buildMlDeleteCalendarJob (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlDeleteCalendarJob(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['calendar_id'] == null && params['calendarId'] == null) { return callback( diff --git a/api/api/ml.delete_datafeed.js b/api/api/ml.delete_datafeed.js index 4e51efca3..057949b22 100644 --- a/api/api/ml.delete_datafeed.js +++ b/api/api/ml.delete_datafeed.js @@ -52,6 +52,15 @@ function buildMlDeleteDatafeed (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlDeleteDatafeed(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['datafeed_id'] == null && params['datafeedId'] == null) { return callback( diff --git a/api/api/ml.delete_expired_data.js b/api/api/ml.delete_expired_data.js index 30ca5cadd..62bafbc88 100644 --- a/api/api/ml.delete_expired_data.js +++ b/api/api/ml.delete_expired_data.js @@ -50,6 +50,15 @@ function buildMlDeleteExpiredData (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlDeleteExpiredData(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/ml.delete_filter.js b/api/api/ml.delete_filter.js index 8a3218408..33ceea713 100644 --- a/api/api/ml.delete_filter.js +++ b/api/api/ml.delete_filter.js @@ -51,6 +51,15 @@ function buildMlDeleteFilter (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlDeleteFilter(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['filter_id'] == null && params['filterId'] == null) { return callback( diff --git a/api/api/ml.delete_forecast.js b/api/api/ml.delete_forecast.js index 85c5d9d80..bfa10cf2e 100644 --- a/api/api/ml.delete_forecast.js +++ b/api/api/ml.delete_forecast.js @@ -56,6 +56,15 @@ function buildMlDeleteForecast (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlDeleteForecast(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['job_id'] == null && params['jobId'] == null) { return callback( diff --git a/api/api/ml.delete_job.js b/api/api/ml.delete_job.js index 5b692d36b..af969304e 100644 --- a/api/api/ml.delete_job.js +++ b/api/api/ml.delete_job.js @@ -54,6 +54,15 @@ function buildMlDeleteJob (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlDeleteJob(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['job_id'] == null && params['jobId'] == null) { return callback( diff --git a/api/api/ml.delete_model_snapshot.js b/api/api/ml.delete_model_snapshot.js index 3a13c967c..5108169e9 100644 --- a/api/api/ml.delete_model_snapshot.js +++ b/api/api/ml.delete_model_snapshot.js @@ -52,6 +52,15 @@ function buildMlDeleteModelSnapshot (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlDeleteModelSnapshot(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['job_id'] == null && params['jobId'] == null) { return callback( diff --git a/api/api/ml.find_file_structure.js b/api/api/ml.find_file_structure.js index c3cb5179f..9d9aabbaf 100644 --- a/api/api/ml.find_file_structure.js +++ b/api/api/ml.find_file_structure.js @@ -83,6 +83,15 @@ function buildMlFindFileStructure (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlFindFileStructure(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['body'] == null) { return callback( diff --git a/api/api/ml.flush_job.js b/api/api/ml.flush_job.js index b72f9395c..0f8c275d9 100644 --- a/api/api/ml.flush_job.js +++ b/api/api/ml.flush_job.js @@ -63,6 +63,15 @@ function buildMlFlushJob (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlFlushJob(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['job_id'] == null && params['jobId'] == null) { return callback( diff --git a/api/api/ml.forecast.js b/api/api/ml.forecast.js index 65d03b5f8..45e94b8ac 100644 --- a/api/api/ml.forecast.js +++ b/api/api/ml.forecast.js @@ -54,6 +54,15 @@ function buildMlForecast (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlForecast(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['job_id'] == null && params['jobId'] == null) { return callback( diff --git a/api/api/ml.get_buckets.js b/api/api/ml.get_buckets.js index 4d70ccb5f..a4b9cab22 100644 --- a/api/api/ml.get_buckets.js +++ b/api/api/ml.get_buckets.js @@ -72,6 +72,15 @@ function buildMlGetBuckets (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlGetBuckets(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['job_id'] == null && params['jobId'] == null) { return callback( diff --git a/api/api/ml.get_calendar_events.js b/api/api/ml.get_calendar_events.js index bdc373d30..3c3a4924d 100644 --- a/api/api/ml.get_calendar_events.js +++ b/api/api/ml.get_calendar_events.js @@ -61,6 +61,15 @@ function buildMlGetCalendarEvents (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlGetCalendarEvents(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['calendar_id'] == null && params['calendarId'] == null) { return callback( diff --git a/api/api/ml.get_calendars.js b/api/api/ml.get_calendars.js index 810145c7f..e75331e41 100644 --- a/api/api/ml.get_calendars.js +++ b/api/api/ml.get_calendars.js @@ -54,6 +54,15 @@ function buildMlGetCalendars (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlGetCalendars(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/ml.get_categories.js b/api/api/ml.get_categories.js index 47c203b3e..82b1c3d2f 100644 --- a/api/api/ml.get_categories.js +++ b/api/api/ml.get_categories.js @@ -56,6 +56,15 @@ function buildMlGetCategories (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlGetCategories(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['job_id'] == null && params['jobId'] == null) { return callback( diff --git a/api/api/ml.get_datafeed_stats.js b/api/api/ml.get_datafeed_stats.js index 97c8ea3c0..0775f5b57 100644 --- a/api/api/ml.get_datafeed_stats.js +++ b/api/api/ml.get_datafeed_stats.js @@ -52,6 +52,15 @@ function buildMlGetDatafeedStats (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlGetDatafeedStats(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/ml.get_datafeeds.js b/api/api/ml.get_datafeeds.js index ae88fb528..a6840e049 100644 --- a/api/api/ml.get_datafeeds.js +++ b/api/api/ml.get_datafeeds.js @@ -52,6 +52,15 @@ function buildMlGetDatafeeds (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlGetDatafeeds(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/ml.get_filters.js b/api/api/ml.get_filters.js index 5666cf902..aa5db006a 100644 --- a/api/api/ml.get_filters.js +++ b/api/api/ml.get_filters.js @@ -54,6 +54,15 @@ function buildMlGetFilters (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlGetFilters(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/ml.get_influencers.js b/api/api/ml.get_influencers.js index 498f13d20..496a313f5 100644 --- a/api/api/ml.get_influencers.js +++ b/api/api/ml.get_influencers.js @@ -69,6 +69,15 @@ function buildMlGetInfluencers (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlGetInfluencers(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['job_id'] == null && params['jobId'] == null) { return callback( diff --git a/api/api/ml.get_job_stats.js b/api/api/ml.get_job_stats.js index 7c8e8b653..53ac81c06 100644 --- a/api/api/ml.get_job_stats.js +++ b/api/api/ml.get_job_stats.js @@ -52,6 +52,15 @@ function buildMlGetJobStats (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlGetJobStats(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/ml.get_jobs.js b/api/api/ml.get_jobs.js index fcb8734c7..dd8a91275 100644 --- a/api/api/ml.get_jobs.js +++ b/api/api/ml.get_jobs.js @@ -52,6 +52,15 @@ function buildMlGetJobs (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlGetJobs(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/ml.get_model_snapshots.js b/api/api/ml.get_model_snapshots.js index f9b2aae7d..6eeb06ab2 100644 --- a/api/api/ml.get_model_snapshots.js +++ b/api/api/ml.get_model_snapshots.js @@ -64,6 +64,15 @@ function buildMlGetModelSnapshots (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlGetModelSnapshots(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['job_id'] == null && params['jobId'] == null) { return callback( diff --git a/api/api/ml.get_overall_buckets.js b/api/api/ml.get_overall_buckets.js index d5e647590..5c34b0921 100644 --- a/api/api/ml.get_overall_buckets.js +++ b/api/api/ml.get_overall_buckets.js @@ -69,6 +69,15 @@ function buildMlGetOverallBuckets (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlGetOverallBuckets(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['job_id'] == null && params['jobId'] == null) { return callback( diff --git a/api/api/ml.get_records.js b/api/api/ml.get_records.js index e38213f0f..c8fecd3c7 100644 --- a/api/api/ml.get_records.js +++ b/api/api/ml.get_records.js @@ -69,6 +69,15 @@ function buildMlGetRecords (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlGetRecords(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['job_id'] == null && params['jobId'] == null) { return callback( diff --git a/api/api/ml.info.js b/api/api/ml.info.js index 55c7c9e0e..401611802 100644 --- a/api/api/ml.info.js +++ b/api/api/ml.info.js @@ -50,6 +50,15 @@ function buildMlInfo (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlInfo(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // validate headers object if (options.headers != null && typeof options.headers !== 'object') { return callback( diff --git a/api/api/ml.open_job.js b/api/api/ml.open_job.js index 81f92ae12..5f77f2dbe 100644 --- a/api/api/ml.open_job.js +++ b/api/api/ml.open_job.js @@ -53,6 +53,15 @@ function buildMlOpenJob (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlOpenJob(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['job_id'] == null && params['jobId'] == null) { return callback( diff --git a/api/api/ml.post_calendar_events.js b/api/api/ml.post_calendar_events.js index a99b009da..6d956007d 100644 --- a/api/api/ml.post_calendar_events.js +++ b/api/api/ml.post_calendar_events.js @@ -52,6 +52,15 @@ function buildMlPostCalendarEvents (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlPostCalendarEvents(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['calendar_id'] == null && params['calendarId'] == null) { return callback( diff --git a/api/api/ml.post_data.js b/api/api/ml.post_data.js index 702ad50a2..a6964a52d 100644 --- a/api/api/ml.post_data.js +++ b/api/api/ml.post_data.js @@ -56,6 +56,15 @@ function buildMlPostData (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlPostData(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['job_id'] == null && params['jobId'] == null) { return callback( diff --git a/api/api/ml.preview_datafeed.js b/api/api/ml.preview_datafeed.js index c7b68045c..562e09331 100644 --- a/api/api/ml.preview_datafeed.js +++ b/api/api/ml.preview_datafeed.js @@ -51,6 +51,15 @@ function buildMlPreviewDatafeed (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlPreviewDatafeed(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['datafeed_id'] == null && params['datafeedId'] == null) { return callback( diff --git a/api/api/ml.put_calendar.js b/api/api/ml.put_calendar.js index a47f770ce..82fd3db68 100644 --- a/api/api/ml.put_calendar.js +++ b/api/api/ml.put_calendar.js @@ -52,6 +52,15 @@ function buildMlPutCalendar (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlPutCalendar(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['calendar_id'] == null && params['calendarId'] == null) { return callback( diff --git a/api/api/ml.put_calendar_job.js b/api/api/ml.put_calendar_job.js index 7c23f126f..f4882f2ed 100644 --- a/api/api/ml.put_calendar_job.js +++ b/api/api/ml.put_calendar_job.js @@ -52,6 +52,15 @@ function buildMlPutCalendarJob (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlPutCalendarJob(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['calendar_id'] == null && params['calendarId'] == null) { return callback( diff --git a/api/api/ml.put_datafeed.js b/api/api/ml.put_datafeed.js index 4a6856c83..8b0626212 100644 --- a/api/api/ml.put_datafeed.js +++ b/api/api/ml.put_datafeed.js @@ -52,6 +52,15 @@ function buildMlPutDatafeed (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlPutDatafeed(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['datafeed_id'] == null && params['datafeedId'] == null) { return callback( diff --git a/api/api/ml.put_filter.js b/api/api/ml.put_filter.js index 63d2b3ec9..3d637bf22 100644 --- a/api/api/ml.put_filter.js +++ b/api/api/ml.put_filter.js @@ -52,6 +52,15 @@ function buildMlPutFilter (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlPutFilter(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['filter_id'] == null && params['filterId'] == null) { return callback( diff --git a/api/api/ml.put_job.js b/api/api/ml.put_job.js index f5f363974..08d444d1e 100644 --- a/api/api/ml.put_job.js +++ b/api/api/ml.put_job.js @@ -52,6 +52,15 @@ function buildMlPutJob (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlPutJob(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['job_id'] == null && params['jobId'] == null) { return callback( diff --git a/api/api/ml.revert_model_snapshot.js b/api/api/ml.revert_model_snapshot.js index 81a70e0db..e3daf24aa 100644 --- a/api/api/ml.revert_model_snapshot.js +++ b/api/api/ml.revert_model_snapshot.js @@ -54,6 +54,15 @@ function buildMlRevertModelSnapshot (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlRevertModelSnapshot(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['job_id'] == null && params['jobId'] == null) { return callback( diff --git a/api/api/ml.set_upgrade_mode.js b/api/api/ml.set_upgrade_mode.js index cd95163a2..eaf40d34f 100644 --- a/api/api/ml.set_upgrade_mode.js +++ b/api/api/ml.set_upgrade_mode.js @@ -53,6 +53,15 @@ function buildMlSetUpgradeMode (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlSetUpgradeMode(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/ml.start_datafeed.js b/api/api/ml.start_datafeed.js index 1ca6a7362..62c0e24c7 100644 --- a/api/api/ml.start_datafeed.js +++ b/api/api/ml.start_datafeed.js @@ -57,6 +57,15 @@ function buildMlStartDatafeed (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlStartDatafeed(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['datafeed_id'] == null && params['datafeedId'] == null) { return callback( diff --git a/api/api/ml.stop_datafeed.js b/api/api/ml.stop_datafeed.js index 13515e966..693a941b0 100644 --- a/api/api/ml.stop_datafeed.js +++ b/api/api/ml.stop_datafeed.js @@ -57,6 +57,15 @@ function buildMlStopDatafeed (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlStopDatafeed(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['datafeed_id'] == null && params['datafeedId'] == null) { return callback( diff --git a/api/api/ml.update_datafeed.js b/api/api/ml.update_datafeed.js index e2e800fa2..3ab93f76b 100644 --- a/api/api/ml.update_datafeed.js +++ b/api/api/ml.update_datafeed.js @@ -52,6 +52,15 @@ function buildMlUpdateDatafeed (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlUpdateDatafeed(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['datafeed_id'] == null && params['datafeedId'] == null) { return callback( diff --git a/api/api/ml.update_filter.js b/api/api/ml.update_filter.js index b50f1cc3a..470ab31b8 100644 --- a/api/api/ml.update_filter.js +++ b/api/api/ml.update_filter.js @@ -52,6 +52,15 @@ function buildMlUpdateFilter (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlUpdateFilter(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['filter_id'] == null && params['filterId'] == null) { return callback( diff --git a/api/api/ml.update_job.js b/api/api/ml.update_job.js index f315e41af..56c58a686 100644 --- a/api/api/ml.update_job.js +++ b/api/api/ml.update_job.js @@ -52,6 +52,15 @@ function buildMlUpdateJob (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlUpdateJob(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['job_id'] == null && params['jobId'] == null) { return callback( diff --git a/api/api/ml.update_model_snapshot.js b/api/api/ml.update_model_snapshot.js index 7d44400e5..fc83d0ecb 100644 --- a/api/api/ml.update_model_snapshot.js +++ b/api/api/ml.update_model_snapshot.js @@ -53,6 +53,15 @@ function buildMlUpdateModelSnapshot (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlUpdateModelSnapshot(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['job_id'] == null && params['jobId'] == null) { return callback( diff --git a/api/api/ml.validate.js b/api/api/ml.validate.js index 2f1401f3e..d7fb5728a 100644 --- a/api/api/ml.validate.js +++ b/api/api/ml.validate.js @@ -51,6 +51,15 @@ function buildMlValidate (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlValidate(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['body'] == null) { return callback( diff --git a/api/api/ml.validate_detector.js b/api/api/ml.validate_detector.js index 07570ddc6..9c1afae6f 100644 --- a/api/api/ml.validate_detector.js +++ b/api/api/ml.validate_detector.js @@ -51,6 +51,15 @@ function buildMlValidateDetector (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mlValidateDetector(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['body'] == null) { return callback( diff --git a/api/api/monitoring.bulk.js b/api/api/monitoring.bulk.js index 082c26acb..6b2c1e739 100644 --- a/api/api/monitoring.bulk.js +++ b/api/api/monitoring.bulk.js @@ -59,6 +59,15 @@ function buildMonitoringBulk (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + monitoringBulk(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['body'] == null) { return callback( diff --git a/api/api/msearch.js b/api/api/msearch.js index a10558174..f411473f2 100644 --- a/api/api/msearch.js +++ b/api/api/msearch.js @@ -79,6 +79,15 @@ function buildMsearch (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + msearch(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['body'] == null) { return callback( diff --git a/api/api/msearch_template.js b/api/api/msearch_template.js index 5fd848d92..13a23fa80 100644 --- a/api/api/msearch_template.js +++ b/api/api/msearch_template.js @@ -73,6 +73,15 @@ function buildMsearchTemplate (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + msearchTemplate(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['body'] == null) { return callback( diff --git a/api/api/mtermvectors.js b/api/api/mtermvectors.js index ceb3a089c..c06dafd2c 100644 --- a/api/api/mtermvectors.js +++ b/api/api/mtermvectors.js @@ -87,6 +87,15 @@ function buildMtermvectors (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + mtermvectors(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required url components if (params['type'] != null && (params['index'] == null)) { return callback( diff --git a/api/api/nodes.hot_threads.js b/api/api/nodes.hot_threads.js index e78ea5213..a4f70ff12 100644 --- a/api/api/nodes.hot_threads.js +++ b/api/api/nodes.hot_threads.js @@ -69,6 +69,15 @@ function buildNodesHotThreads (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + nodesHotThreads(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/nodes.info.js b/api/api/nodes.info.js index 41cbd98ce..c5a8648aa 100644 --- a/api/api/nodes.info.js +++ b/api/api/nodes.info.js @@ -62,6 +62,15 @@ function buildNodesInfo (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + nodesInfo(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/nodes.reload_secure_settings.js b/api/api/nodes.reload_secure_settings.js index a9fee39e7..59fa010c3 100644 --- a/api/api/nodes.reload_secure_settings.js +++ b/api/api/nodes.reload_secure_settings.js @@ -58,6 +58,15 @@ function buildNodesReloadSecureSettings (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + nodesReloadSecureSettings(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/nodes.stats.js b/api/api/nodes.stats.js index f84e583de..25f02f5a4 100644 --- a/api/api/nodes.stats.js +++ b/api/api/nodes.stats.js @@ -77,6 +77,15 @@ function buildNodesStats (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + nodesStats(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/nodes.usage.js b/api/api/nodes.usage.js index 783066665..9400db998 100644 --- a/api/api/nodes.usage.js +++ b/api/api/nodes.usage.js @@ -59,6 +59,15 @@ function buildNodesUsage (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + nodesUsage(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/ping.js b/api/api/ping.js index e696c1568..fe6acf9af 100644 --- a/api/api/ping.js +++ b/api/api/ping.js @@ -55,6 +55,15 @@ function buildPing (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ping(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/put_script.js b/api/api/put_script.js index 993e2130e..ae5cdce30 100644 --- a/api/api/put_script.js +++ b/api/api/put_script.js @@ -65,6 +65,15 @@ function buildPutScript (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + putScript(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['id'] == null) { return callback( diff --git a/api/api/rank_eval.js b/api/api/rank_eval.js index e3c3f39dc..2d97a62d2 100644 --- a/api/api/rank_eval.js +++ b/api/api/rank_eval.js @@ -66,6 +66,15 @@ function buildRankEval (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + rankEval(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['body'] == null) { return callback( diff --git a/api/api/reindex.js b/api/api/reindex.js index 535fc265e..ced743919 100644 --- a/api/api/reindex.js +++ b/api/api/reindex.js @@ -71,6 +71,15 @@ function buildReindex (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + reindex(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['body'] == null) { return callback( diff --git a/api/api/reindex_rethrottle.js b/api/api/reindex_rethrottle.js index 4bdf99863..eebcc7f1e 100644 --- a/api/api/reindex_rethrottle.js +++ b/api/api/reindex_rethrottle.js @@ -59,6 +59,15 @@ function buildReindexRethrottle (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + reindexRethrottle(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['task_id'] == null && params['taskId'] == null) { return callback( diff --git a/api/api/render_search_template.js b/api/api/render_search_template.js index 8936dc4f9..f9b53e3ba 100644 --- a/api/api/render_search_template.js +++ b/api/api/render_search_template.js @@ -57,6 +57,15 @@ function buildRenderSearchTemplate (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + renderSearchTemplate(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // validate headers object if (options.headers != null && typeof options.headers !== 'object') { return callback( diff --git a/api/api/scripts_painless_execute.js b/api/api/scripts_painless_execute.js index 0a0a8ae25..0bf6379a6 100644 --- a/api/api/scripts_painless_execute.js +++ b/api/api/scripts_painless_execute.js @@ -56,6 +56,15 @@ function buildScriptsPainlessExecute (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + scriptsPainlessExecute(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // validate headers object if (options.headers != null && typeof options.headers !== 'object') { return callback( diff --git a/api/api/scroll.js b/api/api/scroll.js index beff548d2..91cfbb82d 100644 --- a/api/api/scroll.js +++ b/api/api/scroll.js @@ -65,6 +65,15 @@ function buildScroll (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + scroll(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // validate headers object if (options.headers != null && typeof options.headers !== 'object') { return callback( diff --git a/api/api/search.js b/api/api/search.js index e5b3cdfa9..6d43f26aa 100644 --- a/api/api/search.js +++ b/api/api/search.js @@ -169,6 +169,15 @@ function buildSearch (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + search(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required url components if (params['type'] != null && (params['index'] == null)) { return callback( diff --git a/api/api/search_shards.js b/api/api/search_shards.js index 4ae9034ad..a142145a9 100644 --- a/api/api/search_shards.js +++ b/api/api/search_shards.js @@ -71,6 +71,15 @@ function buildSearchShards (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + searchShards(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/search_template.js b/api/api/search_template.js index 466d669c1..36b832f47 100644 --- a/api/api/search_template.js +++ b/api/api/search_template.js @@ -92,6 +92,15 @@ function buildSearchTemplate (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + searchTemplate(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['body'] == null) { return callback( diff --git a/api/api/security.authenticate.js b/api/api/security.authenticate.js index da504bdc4..3603102e0 100644 --- a/api/api/security.authenticate.js +++ b/api/api/security.authenticate.js @@ -50,6 +50,15 @@ function buildSecurityAuthenticate (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + securityAuthenticate(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/security.change_password.js b/api/api/security.change_password.js index 569dbf449..f289f027f 100644 --- a/api/api/security.change_password.js +++ b/api/api/security.change_password.js @@ -53,6 +53,15 @@ function buildSecurityChangePassword (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + securityChangePassword(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['body'] == null) { return callback( diff --git a/api/api/security.clear_cached_realms.js b/api/api/security.clear_cached_realms.js index 97af5dcaf..736b06ea6 100644 --- a/api/api/security.clear_cached_realms.js +++ b/api/api/security.clear_cached_realms.js @@ -52,6 +52,15 @@ function buildSecurityClearCachedRealms (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + securityClearCachedRealms(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['realms'] == null) { return callback( diff --git a/api/api/security.clear_cached_roles.js b/api/api/security.clear_cached_roles.js index 1741e5e1f..4acd50cb0 100644 --- a/api/api/security.clear_cached_roles.js +++ b/api/api/security.clear_cached_roles.js @@ -51,6 +51,15 @@ function buildSecurityClearCachedRoles (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + securityClearCachedRoles(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['name'] == null) { return callback( diff --git a/api/api/security.create_api_key.js b/api/api/security.create_api_key.js index b5dd7e597..c1b19ef5b 100644 --- a/api/api/security.create_api_key.js +++ b/api/api/security.create_api_key.js @@ -52,6 +52,15 @@ function buildSecurityCreateApiKey (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + securityCreateApiKey(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['body'] == null) { return callback( diff --git a/api/api/security.delete_privileges.js b/api/api/security.delete_privileges.js index fa54275d3..934365e50 100644 --- a/api/api/security.delete_privileges.js +++ b/api/api/security.delete_privileges.js @@ -53,6 +53,15 @@ function buildSecurityDeletePrivileges (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + securityDeletePrivileges(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['application'] == null) { return callback( diff --git a/api/api/security.delete_role.js b/api/api/security.delete_role.js index f8046d046..50fc608ac 100644 --- a/api/api/security.delete_role.js +++ b/api/api/security.delete_role.js @@ -52,6 +52,15 @@ function buildSecurityDeleteRole (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + securityDeleteRole(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['name'] == null) { return callback( diff --git a/api/api/security.delete_role_mapping.js b/api/api/security.delete_role_mapping.js index 269c7a87d..af0f32c32 100644 --- a/api/api/security.delete_role_mapping.js +++ b/api/api/security.delete_role_mapping.js @@ -52,6 +52,15 @@ function buildSecurityDeleteRoleMapping (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + securityDeleteRoleMapping(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['name'] == null) { return callback( diff --git a/api/api/security.delete_user.js b/api/api/security.delete_user.js index f89bb0fb9..5f6c778ff 100644 --- a/api/api/security.delete_user.js +++ b/api/api/security.delete_user.js @@ -52,6 +52,15 @@ function buildSecurityDeleteUser (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + securityDeleteUser(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['username'] == null) { return callback( diff --git a/api/api/security.disable_user.js b/api/api/security.disable_user.js index e7f1bccde..a07f6f433 100644 --- a/api/api/security.disable_user.js +++ b/api/api/security.disable_user.js @@ -52,6 +52,15 @@ function buildSecurityDisableUser (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + securityDisableUser(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/security.enable_user.js b/api/api/security.enable_user.js index 58a49c9d6..aefe27d78 100644 --- a/api/api/security.enable_user.js +++ b/api/api/security.enable_user.js @@ -52,6 +52,15 @@ function buildSecurityEnableUser (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + securityEnableUser(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/security.get_api_key.js b/api/api/security.get_api_key.js index 4d3d97769..231ccd8bc 100644 --- a/api/api/security.get_api_key.js +++ b/api/api/security.get_api_key.js @@ -57,6 +57,15 @@ function buildSecurityGetApiKey (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + securityGetApiKey(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/security.get_privileges.js b/api/api/security.get_privileges.js index d285b6822..3e5f5d5c3 100644 --- a/api/api/security.get_privileges.js +++ b/api/api/security.get_privileges.js @@ -52,6 +52,15 @@ function buildSecurityGetPrivileges (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + securityGetPrivileges(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/security.get_role.js b/api/api/security.get_role.js index 24e2f384d..b3d05555d 100644 --- a/api/api/security.get_role.js +++ b/api/api/security.get_role.js @@ -51,6 +51,15 @@ function buildSecurityGetRole (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + securityGetRole(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/security.get_role_mapping.js b/api/api/security.get_role_mapping.js index c56e81f8b..d760fb184 100644 --- a/api/api/security.get_role_mapping.js +++ b/api/api/security.get_role_mapping.js @@ -51,6 +51,15 @@ function buildSecurityGetRoleMapping (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + securityGetRoleMapping(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/security.get_token.js b/api/api/security.get_token.js index 32ea01902..407ff5b35 100644 --- a/api/api/security.get_token.js +++ b/api/api/security.get_token.js @@ -51,6 +51,15 @@ function buildSecurityGetToken (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + securityGetToken(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['body'] == null) { return callback( diff --git a/api/api/security.get_user.js b/api/api/security.get_user.js index 6f29262a2..1de5e97bf 100644 --- a/api/api/security.get_user.js +++ b/api/api/security.get_user.js @@ -51,6 +51,15 @@ function buildSecurityGetUser (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + securityGetUser(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/security.get_user_privileges.js b/api/api/security.get_user_privileges.js index 7a79ef740..46f1706da 100644 --- a/api/api/security.get_user_privileges.js +++ b/api/api/security.get_user_privileges.js @@ -50,6 +50,15 @@ function buildSecurityGetUserPrivileges (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + securityGetUserPrivileges(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/security.has_privileges.js b/api/api/security.has_privileges.js index 78987c6b8..d0419c2c2 100644 --- a/api/api/security.has_privileges.js +++ b/api/api/security.has_privileges.js @@ -52,6 +52,15 @@ function buildSecurityHasPrivileges (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + securityHasPrivileges(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['body'] == null) { return callback( diff --git a/api/api/security.invalidate_api_key.js b/api/api/security.invalidate_api_key.js index 1d4a7f877..d02d2148b 100644 --- a/api/api/security.invalidate_api_key.js +++ b/api/api/security.invalidate_api_key.js @@ -51,6 +51,15 @@ function buildSecurityInvalidateApiKey (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + securityInvalidateApiKey(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['body'] == null) { return callback( diff --git a/api/api/security.invalidate_token.js b/api/api/security.invalidate_token.js index fa2043b2c..e58a221e4 100644 --- a/api/api/security.invalidate_token.js +++ b/api/api/security.invalidate_token.js @@ -51,6 +51,15 @@ function buildSecurityInvalidateToken (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + securityInvalidateToken(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['body'] == null) { return callback( diff --git a/api/api/security.put_privileges.js b/api/api/security.put_privileges.js index c08e9aa01..d102615b1 100644 --- a/api/api/security.put_privileges.js +++ b/api/api/security.put_privileges.js @@ -52,6 +52,15 @@ function buildSecurityPutPrivileges (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + securityPutPrivileges(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['body'] == null) { return callback( diff --git a/api/api/security.put_role.js b/api/api/security.put_role.js index 6bd851141..d4e2de603 100644 --- a/api/api/security.put_role.js +++ b/api/api/security.put_role.js @@ -53,6 +53,15 @@ function buildSecurityPutRole (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + securityPutRole(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['name'] == null) { return callback( diff --git a/api/api/security.put_role_mapping.js b/api/api/security.put_role_mapping.js index c6450d155..721d41ca6 100644 --- a/api/api/security.put_role_mapping.js +++ b/api/api/security.put_role_mapping.js @@ -53,6 +53,15 @@ function buildSecurityPutRoleMapping (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + securityPutRoleMapping(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['name'] == null) { return callback( diff --git a/api/api/security.put_user.js b/api/api/security.put_user.js index 16fb9182d..4a9dc7467 100644 --- a/api/api/security.put_user.js +++ b/api/api/security.put_user.js @@ -53,6 +53,15 @@ function buildSecurityPutUser (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + securityPutUser(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['username'] == null) { return callback( diff --git a/api/api/snapshot.create.js b/api/api/snapshot.create.js index 016a9fee6..fb74315c5 100644 --- a/api/api/snapshot.create.js +++ b/api/api/snapshot.create.js @@ -64,6 +64,15 @@ function buildSnapshotCreate (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + snapshotCreate(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['repository'] == null) { return callback( diff --git a/api/api/snapshot.create_repository.js b/api/api/snapshot.create_repository.js index 284f1e821..010a3b2b1 100644 --- a/api/api/snapshot.create_repository.js +++ b/api/api/snapshot.create_repository.js @@ -64,6 +64,15 @@ function buildSnapshotCreateRepository (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + snapshotCreateRepository(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['repository'] == null) { return callback( diff --git a/api/api/snapshot.delete.js b/api/api/snapshot.delete.js index 036535eb7..ab0e48383 100644 --- a/api/api/snapshot.delete.js +++ b/api/api/snapshot.delete.js @@ -60,6 +60,15 @@ function buildSnapshotDelete (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + snapshotDelete(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['repository'] == null) { return callback( diff --git a/api/api/snapshot.delete_repository.js b/api/api/snapshot.delete_repository.js index b552268c8..18c4ae4bb 100644 --- a/api/api/snapshot.delete_repository.js +++ b/api/api/snapshot.delete_repository.js @@ -61,6 +61,15 @@ function buildSnapshotDeleteRepository (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + snapshotDeleteRepository(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['repository'] == null) { return callback( diff --git a/api/api/snapshot.get.js b/api/api/snapshot.get.js index f05948fea..fd03f0260 100644 --- a/api/api/snapshot.get.js +++ b/api/api/snapshot.get.js @@ -65,6 +65,15 @@ function buildSnapshotGet (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + snapshotGet(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['repository'] == null) { return callback( diff --git a/api/api/snapshot.get_repository.js b/api/api/snapshot.get_repository.js index 1b0b32129..a71c5f723 100644 --- a/api/api/snapshot.get_repository.js +++ b/api/api/snapshot.get_repository.js @@ -61,6 +61,15 @@ function buildSnapshotGetRepository (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + snapshotGetRepository(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/snapshot.restore.js b/api/api/snapshot.restore.js index 13865283f..5feeaf569 100644 --- a/api/api/snapshot.restore.js +++ b/api/api/snapshot.restore.js @@ -64,6 +64,15 @@ function buildSnapshotRestore (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + snapshotRestore(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['repository'] == null) { return callback( diff --git a/api/api/snapshot.status.js b/api/api/snapshot.status.js index cb3536c40..6c376244f 100644 --- a/api/api/snapshot.status.js +++ b/api/api/snapshot.status.js @@ -63,6 +63,15 @@ function buildSnapshotStatus (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + snapshotStatus(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/snapshot.verify_repository.js b/api/api/snapshot.verify_repository.js index 12db7c034..27e1df088 100644 --- a/api/api/snapshot.verify_repository.js +++ b/api/api/snapshot.verify_repository.js @@ -61,6 +61,15 @@ function buildSnapshotVerifyRepository (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + snapshotVerifyRepository(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['repository'] == null) { return callback( diff --git a/api/api/ssl.certificates.js b/api/api/ssl.certificates.js index 7e876c609..287edc0df 100644 --- a/api/api/ssl.certificates.js +++ b/api/api/ssl.certificates.js @@ -50,6 +50,15 @@ function buildSslCertificates (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + sslCertificates(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/tasks.cancel.js b/api/api/tasks.cancel.js index 2d226efd9..98e123fcd 100644 --- a/api/api/tasks.cancel.js +++ b/api/api/tasks.cancel.js @@ -63,6 +63,15 @@ function buildTasksCancel (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + tasksCancel(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/tasks.get.js b/api/api/tasks.get.js index 032ca29a8..0b690a8a9 100644 --- a/api/api/tasks.get.js +++ b/api/api/tasks.get.js @@ -61,6 +61,15 @@ function buildTasksGet (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + tasksGet(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['task_id'] == null && params['taskId'] == null) { return callback( diff --git a/api/api/tasks.list.js b/api/api/tasks.list.js index 2d9362434..f54d77417 100644 --- a/api/api/tasks.list.js +++ b/api/api/tasks.list.js @@ -72,6 +72,15 @@ function buildTasksList (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + tasksList(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/termvectors.js b/api/api/termvectors.js index cb8a10d3e..3e7552f72 100644 --- a/api/api/termvectors.js +++ b/api/api/termvectors.js @@ -86,6 +86,15 @@ function buildTermvectors (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + termvectors(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['index'] == null) { return callback( diff --git a/api/api/update.js b/api/api/update.js index a1bbe0b54..6fa970065 100644 --- a/api/api/update.js +++ b/api/api/update.js @@ -89,6 +89,15 @@ function buildUpdate (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + update(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['id'] == null) { return callback( diff --git a/api/api/update_by_query.js b/api/api/update_by_query.js index a6455a813..1e506f600 100644 --- a/api/api/update_by_query.js +++ b/api/api/update_by_query.js @@ -142,6 +142,15 @@ function buildUpdateByQuery (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + updateByQuery(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['index'] == null) { return callback( diff --git a/api/api/update_by_query_rethrottle.js b/api/api/update_by_query_rethrottle.js index b57d94b40..654ad8cfd 100644 --- a/api/api/update_by_query_rethrottle.js +++ b/api/api/update_by_query_rethrottle.js @@ -59,6 +59,15 @@ function buildUpdateByQueryRethrottle (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + updateByQueryRethrottle(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['task_id'] == null && params['taskId'] == null) { return callback( diff --git a/api/api/xpack.graph.explore.js b/api/api/xpack.graph.explore.js index c991bc53e..5161ab7f0 100644 --- a/api/api/xpack.graph.explore.js +++ b/api/api/xpack.graph.explore.js @@ -56,6 +56,15 @@ function buildXpackGraphExplore (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackGraphExplore(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required url components if (params['type'] != null && (params['index'] == null)) { return callback( diff --git a/api/api/xpack.info.js b/api/api/xpack.info.js index 6881278e2..a5bdbf823 100644 --- a/api/api/xpack.info.js +++ b/api/api/xpack.info.js @@ -51,6 +51,15 @@ function buildXpackInfo (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackInfo(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/xpack.license.delete.js b/api/api/xpack.license.delete.js index 0ba866644..48e1b8898 100644 --- a/api/api/xpack.license.delete.js +++ b/api/api/xpack.license.delete.js @@ -50,6 +50,15 @@ function buildXpackLicenseDelete (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackLicenseDelete(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/xpack.license.get.js b/api/api/xpack.license.get.js index fe2c0a32c..5ed14eb42 100644 --- a/api/api/xpack.license.get.js +++ b/api/api/xpack.license.get.js @@ -51,6 +51,15 @@ function buildXpackLicenseGet (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackLicenseGet(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/xpack.license.get_basic_status.js b/api/api/xpack.license.get_basic_status.js index 0ec25ff6d..f933920ae 100644 --- a/api/api/xpack.license.get_basic_status.js +++ b/api/api/xpack.license.get_basic_status.js @@ -50,6 +50,15 @@ function buildXpackLicenseGetBasicStatus (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackLicenseGetBasicStatus(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/xpack.license.get_trial_status.js b/api/api/xpack.license.get_trial_status.js index 09660966b..49bb6ec4d 100644 --- a/api/api/xpack.license.get_trial_status.js +++ b/api/api/xpack.license.get_trial_status.js @@ -50,6 +50,15 @@ function buildXpackLicenseGetTrialStatus (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackLicenseGetTrialStatus(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/xpack.license.post.js b/api/api/xpack.license.post.js index ebbd77e2d..6c9182099 100644 --- a/api/api/xpack.license.post.js +++ b/api/api/xpack.license.post.js @@ -52,6 +52,15 @@ function buildXpackLicensePost (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackLicensePost(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // validate headers object if (options.headers != null && typeof options.headers !== 'object') { return callback( diff --git a/api/api/xpack.license.post_start_basic.js b/api/api/xpack.license.post_start_basic.js index 9e9a6faae..7484f4876 100644 --- a/api/api/xpack.license.post_start_basic.js +++ b/api/api/xpack.license.post_start_basic.js @@ -51,6 +51,15 @@ function buildXpackLicensePostStartBasic (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackLicensePostStartBasic(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/xpack.license.post_start_trial.js b/api/api/xpack.license.post_start_trial.js index ac2c11f3a..ed9d04bf0 100644 --- a/api/api/xpack.license.post_start_trial.js +++ b/api/api/xpack.license.post_start_trial.js @@ -53,6 +53,15 @@ function buildXpackLicensePostStartTrial (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackLicensePostStartTrial(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/xpack.migration.deprecations.js b/api/api/xpack.migration.deprecations.js index e5fbad087..485e4cadb 100644 --- a/api/api/xpack.migration.deprecations.js +++ b/api/api/xpack.migration.deprecations.js @@ -51,6 +51,15 @@ function buildXpackMigrationDeprecations (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackMigrationDeprecations(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/xpack.migration.get_assistance.js b/api/api/xpack.migration.get_assistance.js index 1840cdd9b..96c0591cf 100644 --- a/api/api/xpack.migration.get_assistance.js +++ b/api/api/xpack.migration.get_assistance.js @@ -58,6 +58,15 @@ function buildXpackMigrationGetAssistance (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackMigrationGetAssistance(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // validate headers object if (options.headers != null && typeof options.headers !== 'object') { return callback( diff --git a/api/api/xpack.migration.upgrade.js b/api/api/xpack.migration.upgrade.js index 305428a6c..16062ae81 100644 --- a/api/api/xpack.migration.upgrade.js +++ b/api/api/xpack.migration.upgrade.js @@ -52,6 +52,15 @@ function buildXpackMigrationUpgrade (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackMigrationUpgrade(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['index'] == null) { return callback( diff --git a/api/api/xpack.rollup.delete_job.js b/api/api/xpack.rollup.delete_job.js index 7dc7a4903..d463030c5 100644 --- a/api/api/xpack.rollup.delete_job.js +++ b/api/api/xpack.rollup.delete_job.js @@ -51,6 +51,15 @@ function buildXpackRollupDeleteJob (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackRollupDeleteJob(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['id'] == null) { return callback( diff --git a/api/api/xpack.rollup.get_jobs.js b/api/api/xpack.rollup.get_jobs.js index cdb7b666a..25a150d0e 100644 --- a/api/api/xpack.rollup.get_jobs.js +++ b/api/api/xpack.rollup.get_jobs.js @@ -51,6 +51,15 @@ function buildXpackRollupGetJobs (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackRollupGetJobs(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // validate headers object if (options.headers != null && typeof options.headers !== 'object') { return callback( diff --git a/api/api/xpack.rollup.get_rollup_caps.js b/api/api/xpack.rollup.get_rollup_caps.js index cb18eee62..dfe09cce4 100644 --- a/api/api/xpack.rollup.get_rollup_caps.js +++ b/api/api/xpack.rollup.get_rollup_caps.js @@ -51,6 +51,15 @@ function buildXpackRollupGetRollupCaps (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackRollupGetRollupCaps(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // validate headers object if (options.headers != null && typeof options.headers !== 'object') { return callback( diff --git a/api/api/xpack.rollup.get_rollup_index_caps.js b/api/api/xpack.rollup.get_rollup_index_caps.js index de4191264..6b7846b72 100644 --- a/api/api/xpack.rollup.get_rollup_index_caps.js +++ b/api/api/xpack.rollup.get_rollup_index_caps.js @@ -51,6 +51,15 @@ function buildXpackRollupGetRollupIndexCaps (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackRollupGetRollupIndexCaps(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['index'] == null) { return callback( diff --git a/api/api/xpack.rollup.put_job.js b/api/api/xpack.rollup.put_job.js index 37de0684b..d76625c51 100644 --- a/api/api/xpack.rollup.put_job.js +++ b/api/api/xpack.rollup.put_job.js @@ -52,6 +52,15 @@ function buildXpackRollupPutJob (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackRollupPutJob(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['id'] == null) { return callback( diff --git a/api/api/xpack.rollup.rollup_search.js b/api/api/xpack.rollup.rollup_search.js index e8bc75395..b006d127f 100644 --- a/api/api/xpack.rollup.rollup_search.js +++ b/api/api/xpack.rollup.rollup_search.js @@ -57,6 +57,15 @@ function buildXpackRollupRollupSearch (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackRollupRollupSearch(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['index'] == null) { return callback( diff --git a/api/api/xpack.rollup.start_job.js b/api/api/xpack.rollup.start_job.js index 33c3ac5fd..3701988c8 100644 --- a/api/api/xpack.rollup.start_job.js +++ b/api/api/xpack.rollup.start_job.js @@ -51,6 +51,15 @@ function buildXpackRollupStartJob (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackRollupStartJob(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['id'] == null) { return callback( diff --git a/api/api/xpack.rollup.stop_job.js b/api/api/xpack.rollup.stop_job.js index 5bcf1373e..4d132b641 100644 --- a/api/api/xpack.rollup.stop_job.js +++ b/api/api/xpack.rollup.stop_job.js @@ -55,6 +55,15 @@ function buildXpackRollupStopJob (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackRollupStopJob(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['id'] == null) { return callback( diff --git a/api/api/xpack.sql.clear_cursor.js b/api/api/xpack.sql.clear_cursor.js index f35f3e363..d1967d400 100644 --- a/api/api/xpack.sql.clear_cursor.js +++ b/api/api/xpack.sql.clear_cursor.js @@ -51,6 +51,15 @@ function buildXpackSqlClearCursor (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackSqlClearCursor(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['body'] == null) { return callback( diff --git a/api/api/xpack.sql.query.js b/api/api/xpack.sql.query.js index 125c577f6..80d95b181 100644 --- a/api/api/xpack.sql.query.js +++ b/api/api/xpack.sql.query.js @@ -52,6 +52,15 @@ function buildXpackSqlQuery (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackSqlQuery(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['body'] == null) { return callback( diff --git a/api/api/xpack.sql.translate.js b/api/api/xpack.sql.translate.js index c8df293e7..15c544835 100644 --- a/api/api/xpack.sql.translate.js +++ b/api/api/xpack.sql.translate.js @@ -51,6 +51,15 @@ function buildXpackSqlTranslate (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackSqlTranslate(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['body'] == null) { return callback( diff --git a/api/api/xpack.usage.js b/api/api/xpack.usage.js index dd85627f1..61a6b8d86 100644 --- a/api/api/xpack.usage.js +++ b/api/api/xpack.usage.js @@ -51,6 +51,15 @@ function buildXpackUsage (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackUsage(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/xpack.watcher.ack_watch.js b/api/api/xpack.watcher.ack_watch.js index 9a8a450c4..2284c7098 100644 --- a/api/api/xpack.watcher.ack_watch.js +++ b/api/api/xpack.watcher.ack_watch.js @@ -52,6 +52,15 @@ function buildXpackWatcherAckWatch (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackWatcherAckWatch(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['watch_id'] == null && params['watchId'] == null) { return callback( diff --git a/api/api/xpack.watcher.activate_watch.js b/api/api/xpack.watcher.activate_watch.js index 1d114b189..ae5a81497 100644 --- a/api/api/xpack.watcher.activate_watch.js +++ b/api/api/xpack.watcher.activate_watch.js @@ -51,6 +51,15 @@ function buildXpackWatcherActivateWatch (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackWatcherActivateWatch(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['watch_id'] == null && params['watchId'] == null) { return callback( diff --git a/api/api/xpack.watcher.deactivate_watch.js b/api/api/xpack.watcher.deactivate_watch.js index 1e7fe35ac..fa9cdf434 100644 --- a/api/api/xpack.watcher.deactivate_watch.js +++ b/api/api/xpack.watcher.deactivate_watch.js @@ -51,6 +51,15 @@ function buildXpackWatcherDeactivateWatch (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackWatcherDeactivateWatch(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['watch_id'] == null && params['watchId'] == null) { return callback( diff --git a/api/api/xpack.watcher.delete_watch.js b/api/api/xpack.watcher.delete_watch.js index 063788115..cdddf8bd7 100644 --- a/api/api/xpack.watcher.delete_watch.js +++ b/api/api/xpack.watcher.delete_watch.js @@ -51,6 +51,15 @@ function buildXpackWatcherDeleteWatch (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackWatcherDeleteWatch(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['id'] == null) { return callback( diff --git a/api/api/xpack.watcher.execute_watch.js b/api/api/xpack.watcher.execute_watch.js index 8e14f3475..034e2d218 100644 --- a/api/api/xpack.watcher.execute_watch.js +++ b/api/api/xpack.watcher.execute_watch.js @@ -53,6 +53,15 @@ function buildXpackWatcherExecuteWatch (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackWatcherExecuteWatch(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // validate headers object if (options.headers != null && typeof options.headers !== 'object') { return callback( diff --git a/api/api/xpack.watcher.get_watch.js b/api/api/xpack.watcher.get_watch.js index f18fcb992..98f6db827 100644 --- a/api/api/xpack.watcher.get_watch.js +++ b/api/api/xpack.watcher.get_watch.js @@ -51,6 +51,15 @@ function buildXpackWatcherGetWatch (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackWatcherGetWatch(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['id'] == null) { return callback( diff --git a/api/api/xpack.watcher.put_watch.js b/api/api/xpack.watcher.put_watch.js index 269e58d5a..6dd39a603 100644 --- a/api/api/xpack.watcher.put_watch.js +++ b/api/api/xpack.watcher.put_watch.js @@ -60,6 +60,15 @@ function buildXpackWatcherPutWatch (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackWatcherPutWatch(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params['id'] == null) { return callback( diff --git a/api/api/xpack.watcher.start.js b/api/api/xpack.watcher.start.js index e16a81eda..5b4b227cc 100644 --- a/api/api/xpack.watcher.start.js +++ b/api/api/xpack.watcher.start.js @@ -50,6 +50,15 @@ function buildXpackWatcherStart (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackWatcherStart(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/xpack.watcher.stats.js b/api/api/xpack.watcher.stats.js index 6991ec20a..29e68ec6c 100644 --- a/api/api/xpack.watcher.stats.js +++ b/api/api/xpack.watcher.stats.js @@ -54,6 +54,15 @@ function buildXpackWatcherStats (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackWatcherStats(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback( diff --git a/api/api/xpack.watcher.stop.js b/api/api/xpack.watcher.stop.js index 17f5c33a3..363f2b2f4 100644 --- a/api/api/xpack.watcher.stop.js +++ b/api/api/xpack.watcher.stop.js @@ -50,6 +50,15 @@ function buildXpackWatcherStop (opts) { options = {} } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackWatcherStop(params, options, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + // check required parameters if (params.body != null) { return callback(