text
stringlengths
81
112k
Parallel version of the bulk helper run in multiple threads at once. :arg client: instance of :class:`~elasticsearch.Elasticsearch` to use :arg actions: iterator containing the actions :arg thread_count: size of the threadpool to use for the bulk requests :arg chunk_size: number of docs in one chunk se...
Simple abstraction on top of the :meth:`~elasticsearch.Elasticsearch.scroll` api - a simple iterator that yields all hits as returned by underlining scroll requests. By default scan does not return results in any pre-determined order. To have a standard order in the returned documents (either by score ...
Reindex all documents from one index that satisfy a given query to another, potentially (if `target_client` is specified) on a different cluster. If you don't specify the query you will reindex all the documents. Since ``2.3`` a :meth:`~elasticsearch.Elasticsearch.reindex` api is available as part of e...
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform.html>`_ :arg transform_id: The id or comma delimited list of id expressions of the transforms to get, '_all' or '*' implies get all transforms :arg from_: skips a number of transform configs, defaults...
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform-stats.html>`_ :arg transform_id: The id of the transform for which to get stats. '_all' or '*' implies all transforms def get_data_frame_transform_stats(self, transform_id=None, params=None): """ ...
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-data-frame-transform.html>`_ :arg body: The definition for the data_frame transform to preview def preview_data_frame_transform(self, body, params=None): """ `<https://www.elastic.co/guide/en/elasticsearch/reference/curr...
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/put-data-frame-transform.html>`_ :arg transform_id: The id of the new transform. :arg body: The data frame transform definition def put_data_frame_transform(self, transform_id, body, params=None): """ `<https://www.elast...
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-data-frame-transform.html>`_ :arg transform_id: The id of the transform to stop :arg timeout: Controls the time to wait until the transform has stopped. Default to 30 seconds :arg wait_for_completion: Whether to ...
Allocation provides a snapshot of how shards have located around the cluster and the state of disk usage. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-allocation.html>`_ :arg node_id: A comma-separated list of node IDs or names to limit the returned informat...
Count provides quick access to the document count of the entire cluster, or individual indices. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-count.html>`_ :arg index: A comma-separated list of index names to limit the returned information :arg format...
The indices command provides a cross-section of each index. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-indices.html>`_ :arg index: A comma-separated list of index names to limit the returned information :arg bytes: The unit in which to display byte values,...
recovery is a view of shard replication. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-recovery.html>`_ :arg index: A comma-separated list of index names to limit the returned information :arg bytes: The unit in which to display byte values, valid choices are...
The shards command is the detailed view of what nodes contain which shards. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-shards.html>`_ :arg index: A comma-separated list of index names to limit the returned information :arg bytes: The unit in which to displ...
The segments command is the detailed view of Lucene segments per index. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-segments.html>`_ :arg index: A comma-separated list of index names to limit the returned information :arg bytes: The unit in which to display...
Get information about thread pools. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-thread-pool.html>`_ :arg thread_pool_patterns: A comma-separated list of regular-expressions to filter the thread pools in the output :arg format: a short version of the Accept ...
Shows information about currently loaded fielddata on a per-node basis. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-fielddata.html>`_ :arg fields: A comma-separated list of fields to return the fielddata size :arg bytes: The unit in which to display byte va...
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-templates.html>`_ :arg name: A pattern that returned template names must match :arg format: a short version of the Accept header, e.g. json, yaml :arg h: Comma-separated list of column names to display :arg help: Retu...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html>`_ :arg watch_id: Watch ID :arg action_id: A comma-separated list of the action ids to be acked def ack_watch(self, watch_id, action_id=None, params=None): """ `<http://www.elastic.co/guide/en/e...
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html>`_ :arg watch_id: Watch ID def activate_watch(self, watch_id, params=None): """ `<https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html>`_ :arg w...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html>`_ :arg id: Watch ID def delete_watch(self, id, params=None): """ `<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html>`_ :arg id: Watch ID ...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html>`_ :arg id: Watch ID :arg body: Execution control :arg debug: indicates whether the watch should execute in debug mode def execute_watch(self, id=None, body=None, params=None): """ `...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html>`_ :arg id: Watch ID :arg body: The watch :arg active: Specify whether the watch is in/active by default :arg if_primary_term: only update the watch if the last operation that has cha...
Get a very simple status on the health of the cluster. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-health.html>`_ :arg index: Limit the information returned to a specific index :arg level: Specify the level of detail for returned information, default 'cl...
Get a comprehensive state information of the whole cluster. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-state.html>`_ :arg metric: Limit the information returned to the specified metrics :arg index: A comma-separated list of index names; use `_all` or empty ...
The Cluster Stats API allows to retrieve statistics from a cluster wide perspective. The API returns basic index metrics and information about the current nodes that form the cluster. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-stats.html>`_ :arg node_id: A ...
Explicitly execute a cluster reroute allocation command including specific commands. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-reroute.html>`_ :arg body: The definition of `commands` to perform (`move`, `cancel`, `allocate`) :arg dry_run: Simulate the ...
Update cluster wide specific settings. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html>`_ :arg body: The settings to be updated. Can be either `transient` or `persistent` (survives cluster restart). :arg flat_settings: Return settings in...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-allocation-explain.html>`_ :arg body: The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard' :arg include_disk_info: Return information about disk usage and shard si...
`<http://www.elastic.co/guide/en/migration/current/migration-api-deprecation.html>`_ :arg index: Index pattern def deprecations(self, index=None, params=None): """ `<http://www.elastic.co/guide/en/migration/current/migration-api-deprecation.html>`_ :arg index: Index pattern ""...
Return a connection from the pool using the `ConnectionSelector` instance. It tries to resurrect eligible connections, forces a resurrection when no connections are availible and passes the list of live connections to the selector instance to choose from. Returns a connection i...
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html>`_ :arg index: The name of the follower index :arg body: The name of the leader index and other optional ccr related parameters :arg wait_for_active_shards: Sets the number of shard copies that mus...
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html>`_ :arg index: A comma-separated list of index patterns; use `_all` to perform the operation on all indices def follow_info(self, index=None, params=None): """ `<https://www.elastic.co/guide/...
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html>`_ :arg index: A comma-separated list of index patterns; use `_all` to perform the operation on all indices def follow_stats(self, index, params=None): """ `<https://www.elastic.co/guide/en/...
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html>`_ :arg name: The name of the auto follow pattern. def get_auto_follow_pattern(self, name=None, params=None): """ `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-fo...
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html>`_ :arg name: The name of the auto follow pattern. :arg body: The specification of the auto follow pattern def put_auto_follow_pattern(self, name, body, params=None): """ `<https://www.el...
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html>`_ :arg index: The name of the follow index to resume following. :arg body: The name of the leader index and other optional ccr related parameters def resume_follow(self, index, body=None, params=...
`<https://www.elastic.co/guide/en/elasticsearch/plugins/current/ingest.html>`_ :arg id: Comma separated list of pipeline ids. Wildcards supported :arg master_timeout: Explicit operation timeout for connection to master node def get_pipeline(self, id=None, params=None): """ ...
`<>`_ :arg calendar_id: The ID of the calendar to modify :arg event_id: The ID of the event to remove from the calendar def delete_calendar_event(self, calendar_id, event_id, params=None): """ `<>`_ :arg calendar_id: The ID of the calendar to modify :arg event_id: The ...
`<>`_ :arg filter_id: The ID of the filter to delete def delete_filter(self, filter_id, params=None): """ `<>`_ :arg filter_id: The ID of the filter to delete """ if filter_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'fi...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html>`_ :arg job_id: The ID of the job from which to delete forecasts :arg forecast_id: The ID of the forecast to delete, can be comma delimited list. Leaving blank implies `_all` :arg allow_no_forec...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html>`_ :arg job_id: The ID of the job to delete :arg force: True if the job should be forcefully deleted, default False :arg wait_for_completion: Should this request wait until the operation has complete...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html>`_ :arg job_id: The ID of the job to fetch :arg snapshot_id: The ID of the snapshot to delete def delete_model_snapshot(self, job_id, snapshot_id, params=None): """ `<http://www.elastic.co/guide/en...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-file-structure.html>`_ :arg body: The contents of the file to be analyzed :arg charset: Optional parameter to specify the character set of the file :arg column_names: Optional parameter containing a comma separated ...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html>`_ :arg job_id: The name of the job to flush :arg body: Flush parameters :arg advance_time: Advances time to the given value generating results and updating the model for the advanced interval ...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html>`_ :arg job_id: ID of the job to get bucket results from :arg timestamp: The timestamp of the desired single bucket result :arg body: Bucket selection details if not provided in URI :arg anomaly_score: F...
`<>`_ :arg calendar_id: The ID of the calendar containing the events :arg end: Get events before this time :arg from_: Skips a number of events :arg job_id: Get events for the job. When this option is used calendar_id must be '_all' :arg size: Specifies a max number ...
`<>`_ :arg calendar_id: The ID of the calendar to fetch :arg body: The from and size parameters optionally sent in the body :arg from_: skips a number of calendars :arg size: specifies a max number of calendars to get def get_calendars(self, calendar_id=None, body=None, params=None): ...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html>`_ :arg job_id: The name of the job :arg category_id: The identifier of the category definition of interest :arg body: Category selection details if not provided in URI :arg from_: skips a number of ca...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html>`_ :arg datafeed_id: The ID of the datafeeds stats to fetch :arg allow_no_datafeeds: Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no ...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html>`_ :arg datafeed_id: The ID of the datafeeds to fetch :arg allow_no_datafeeds: Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds...
`<>`_ :arg filter_id: The ID of the filter to fetch :arg from_: skips a number of filters :arg size: specifies a max number of filters to get def get_filters(self, filter_id=None, params=None): """ `<>`_ :arg filter_id: The ID of the filter to fetch :arg from_:...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html>`_ :arg job_id: The ID of the jobs stats to fetch :arg allow_no_jobs: Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specifi...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html>`_ :arg job_id: The ID of the jobs to fetch :arg allow_no_jobs: Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) def get...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html>`_ :arg job_id: The ID of the job to fetch :arg snapshot_id: The ID of the snapshot to fetch :arg body: Model snapshot selection criteria :arg desc: True if the results should be sorted in descending o...
`<>`_ :arg calendar_id: The ID of the calendar to modify :arg body: A list of events def post_calendar_events(self, calendar_id, body, params=None): """ `<>`_ :arg calendar_id: The ID of the calendar to modify :arg body: A list of events """ for param i...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html>`_ :arg job_id: The name of the job receiving the data :arg body: The data to process :arg reset_end: Optional parameter to specify the end of the bucket resetting range :arg reset_start: Opti...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html>`_ :arg datafeed_id: The ID of the datafeed to preview def preview_datafeed(self, datafeed_id, params=None): """ `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html>`...
`<>`_ :arg calendar_id: The ID of the calendar to create :arg body: The calendar details def put_calendar(self, calendar_id, body=None, params=None): """ `<>`_ :arg calendar_id: The ID of the calendar to create :arg body: The calendar details """ if cal...
`<>`_ :arg calendar_id: The ID of the calendar to modify :arg job_id: The ID of the job to add to the calendar def put_calendar_job(self, calendar_id, job_id, params=None): """ `<>`_ :arg calendar_id: The ID of the calendar to modify :arg job_id: The ID of the job to a...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html>`_ :arg datafeed_id: The ID of the datafeed to start :arg body: The start datafeed parameters :arg end: The end time when the datafeed should stop. When not set, the datafeed continues in real ti...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html>`_ :arg datafeed_id: The ID of the datafeed to update :arg body: The datafeed update settings def update_datafeed(self, datafeed_id, body, params=None): """ `<http://www.elastic.co/guide/en/elastic...
`<>`_ :arg filter_id: The ID of the filter to update :arg body: The filter update def update_filter(self, filter_id, body, params=None): """ `<>`_ :arg filter_id: The ID of the filter to update :arg body: The filter update """ for param in (filter_id, b...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-snapshot.html>`_ :arg job_id: The ID of the job to fetch :arg snapshot_id: The ID of the snapshot to update :arg body: The model snapshot properties to update def update_model_snapshot(self, job_id, snapshot_id, body, p...
`<>`_ :arg body: The job config def validate(self, body, params=None): """ `<>`_ :arg body: The job config """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") return self.transport.perform_request( ...
`<>`_ :arg body: The detector def validate_detector(self, body, params=None): """ `<>`_ :arg body: The detector """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") return self.transport.perform_request...
Perform the analysis process on a text and return the tokens breakdown of the text. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-analyze.html>`_ :arg index: The name of the index to scope the operation :arg body: Define analyzer/tokenizer parameters and the text on w...
Explicitly refresh one or more index, making all operations performed since the last refresh available for search. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-refresh.html>`_ :arg index: A comma-separated list of index names; use `_all` or empty string t...
Explicitly flush one or more indices. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-flush.html>`_ :arg index: A comma-separated list of index names; use `_all` or empty string for all indices :arg allow_no_indices: Whether to ignore if a wildcard indices ...
The get index API allows to retrieve information about one or more indexes. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-index.html>`_ :arg index: A comma-separated list of index names :arg allow_no_indices: Ignore if a wildcard expression resolves to no ...
Check if a type/types exists in an index/indices. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-types-exists.html>`_ :arg index: A comma-separated list of index names; use `_all` to check the types across all indices :arg doc_type: A comma-separated list o...
Retrieve mapping definition of index or index/type. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-mapping.html>`_ :arg index: A comma-separated list of index names :arg doc_type: A comma-separated list of document types :arg allow_no_indices: Whether to ig...
Retrieve mapping definition of a specific field. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-field-mapping.html>`_ :arg fields: A comma-separated list of fields :arg index: A comma-separated list of index names :arg doc_type: A comma-separated list of do...
Create an alias for a specific index/indices. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html>`_ :arg index: A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all ind...
Return a boolean indicating whether given alias exists. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html>`_ :arg index: A comma-separated list of index names to filter aliases :arg name: A comma-separated list of alias names to return :arg allow_no_i...
Retrieve a specified alias. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html>`_ :arg index: A comma-separated list of index names to filter aliases :arg name: A comma-separated list of alias names to return :arg allow_no_indices: Whether to ignore if...
Update specified aliases. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html>`_ :arg body: The definition of `actions` to perform :arg master_timeout: Specify timeout for connection to master :arg request_timeout: Request timeout def update_aliases(se...
Delete specific alias. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html>`_ :arg index: A comma-separated list of index names (supports wildcards); use `_all` for all indices :arg name: A comma-separated list of aliases to delete (supports ...
Retrieve an index template by its name. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html>`_ :arg name: The name of the template :arg flat_settings: Return settings in flat format (default: false) :arg local: Return local information, do not retriev...
Retrieve settings for one or more (or all) indices. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-settings.html>`_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices :arg name: The name...
Retrieve statistics on different operations happening on an index. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-stats.html>`_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices :arg metric...
Clear either all caches or specific cached associated with one ore more indices. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-clearcache.html>`_ :arg index: A comma-separated list of index name to limit the operation :arg allow_no_indices: Whether to ignore if a wild...
Upgrade one or more indices to the latest format through an API. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-upgrade.html>`_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices :arg allow_...
Monitor how much of one or more index is upgraded. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-upgrade.html>`_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices :arg allow_no_indices: Wh...
Perform a normal flush, then add a generated unique marker (sync_id) to all shards. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-synced-flush.html>`_ :arg index: A comma-separated list of index names; use `_all` or empty string for all indices :arg allow_...
Provides store information for shard copies of indices. Store information reports on which nodes shard copies exist, the shard copy version, indicating how recent they are, and any exceptions encountered while opening the shard index or from earlier engine failure. `<http://www.elastic.c...
The force merge API allows to force merging of one or more indices through an API. The merge relates to the number of segments a Lucene index holds within each shard. The force merge operation allows to reduce the number of segments by merging them. This call will block until the merge ...
The shrink index API allows you to shrink an existing index into a new index with fewer primary shards. The number of primary shards in the target index must be a factor of the shards in the source index. For example an index with 8 primary shards can be shrunk into 4, 2 or 1 primary sha...
The rollover index API rolls an alias over to a new index when the existing index is considered to be too large or too old. The API accepts a single alias name and a list of conditions. The alias must point to a single index only. If the index satisfies the specified conditions then a n...
Retrieve information about a snapshot. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_ :arg repository: A repository name :arg snapshot: A comma-separated list of snapshot names :arg ignore_unavailable: Whether to ignore unavailable snapshots, ...
Removes a shared file system repository. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_ :arg repository: A comma-separated list of repository names :arg master_timeout: Explicit operation timeout for connection to master node :arg ...
Return information about registered repositories. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_ :arg repository: A comma-separated list of repository names :arg local: Return local information, do not retrieve the state from master node (...
Registers a shared file system repository. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_ :arg repository: A repository name :arg body: The repository definition :arg master_timeout: Explicit operation timeout for connection to master ...
Restore a snapshot. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_ :arg repository: A repository name :arg snapshot: A snapshot name :arg body: Details of what to restore :arg master_timeout: Explicit operation timeout for connection t...
Return information about all currently running snapshots. By specifying a repository name, it's possible to limit the results to a particular repository. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_ :arg repository: A repository name ...
Escape a single value of a URL string or a query parameter. If it is a list or tuple, turn it into a comma-separated string first. def _escape(value): """ Escape a single value of a URL string or a query parameter. If it is a list or tuple, turn it into a comma-separated string first. """ # ma...
Create a URL string from parts, omit all `None` values and empty strings. Convert lists and tuples to comma separated values. def _make_path(*parts): """ Create a URL string from parts, omit all `None` values and empty strings. Convert lists and tuples to comma separated values. """ # TODO: may...
Decorator that pops all accepted parameters from method's kwargs and puts them in the params argument. def query_params(*es_query_params): """ Decorator that pops all accepted parameters from method's kwargs and puts them in the params argument. """ def _wrapper(func): @wraps(func) ...
Retrieve information for a particular task. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/tasks.html>`_ :arg task_id: Return the task with specified id (node_id:task_number) :arg wait_for_completion: Wait for the matching tasks to complete (default: false) ...
Simple utility function to print results of a search query. def print_hits(results): " Simple utility function to print results of a search query. " print_search_stats(results) for hit in results['hits']['hits']: # get created date for a repo and fallback to authored_date for a commit creat...
Deal with incoming requests. def post(self): """Deal with incoming requests.""" body = tornado.escape.json_decode(self.request.body) try: self._bo.register( params=body["params"], target=body["target"], ) print("BO has registe...