Skip to content

get Support (Query Parameters) #5

@steve-r-west

Description

@steve-r-west

The get command will eventually have the following semantics.

get <RESOURCE> query parameters
or
get <RESOURCE> <ID_1> <ID_2> query parameters

Some examples

epcc get customers foo Should call GET /v2/customers/foo
epcc get customer-address foo bar should call GET /v2/customers/foo/address/bar
epcc get customer foo include address should call GET /v2/customers/foo?include=address
epcc get customers page[offset] 100 should call GET /v2/customers?page[offset]=100 (although the page[offset] should be url encoded).

In order to build this out we need:

  1. The ability to make HTTP calls.
  2. The ability given a resource type to know the URL.
  3. The ability to pass in supplied ids.
  4. The ability to handle passing query parameters to the call.
    • This is particularly challenging, and in the bash version, I wasn't sure how the CLI could distinguish between whether or not epcc get customers foo bar means GET /v2/customers?foo=bar or GET /v2/customers/foo?bar.

The scope of this ticket is to build off the work of #2, #3 and #4 and support query parameters.

Acceptance Criteria

So for instance at the end of this ticket, the following calls should work:

epcc get account page[limit] 100 ==> GET /v2/accounts/?page%5Blimit%5D =100
epcc get account filter eq(email, ron+1swanson.com) ==> GET /v2/accounts/?filter=eq%28email%2Cron%2B1%40swanson.com%29
epcc get account foo bar ==> GET /v2/accounts?foo=bar

You will additionally one to check for other query parameters supported by EPCC, and ensure that we support proper encoding with them (E.g., sort), and maybe even nested filtering.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions