Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a "request" subcommand #2484

Merged
merged 3 commits into from
Dec 3, 2021
Merged

Conversation

felipeelia
Copy link
Member

@felipeelia felipeelia commented Dec 3, 2021

Description of the Change

This is a take over of #2438

To help when debugging, or otherwise wanting to send arbitrary requests to ElasticSearch, this adds a new request sub-command, that is somewhat similar to the idea of wp db query or the like.

For example wp elasticpress request _cat/indices --method=GET

Changelog Entry

Added: WP-CLI request command. Props @joehoyle and @felipeelia

joehoyle and others added 2 commits December 3, 2021 09:18
To help when debugging, or otherwise wanting to send arbitrary requests to ElasticSearch, this adds a new `request` sub-command, that is some what similar to the idea of `wp db query` or the like.

For example `wp elasticpress request /_cat/indices --method=GET`
@felipeelia felipeelia added this to the 4.0.0 (beta 1) milestone Dec 3, 2021
@felipeelia felipeelia changed the title Feature/wp cli request subcommand Add a "request" subcommand Dec 3, 2021
@felipeelia felipeelia changed the base branch from develop to 4.x.x December 3, 2021 12:54
@joehoyle
Copy link
Contributor

joehoyle commented Dec 3, 2021

Nice one!

Copy link
Contributor

@oscarssanchez oscarssanchez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @felipeelia I have just one suggestion:

  • Have a list of allowed methods and check if the method matches any in the list. If not øn the list, display error message. For example: wp elasticpress request _cat/indices --method=TEST doesn't give an error message.

@felipeelia felipeelia merged commit 12e0036 into 4.x.x Dec 3, 2021
@felipeelia felipeelia deleted the feature/wp-cli-request-subcommand branch December 3, 2021 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants