Skip to content

Update create order command, break out and create separate command for building request #366

Closed
@jreiberkyle

Description

@jreiberkyle

This ticket covers the following:

planet orders request

  • Create separate command for building the request
  • Determine whether or not --search-id needs to be implemented (see Implement --search-id support in orders request #388)
    • It does not, it will be implemented separately, once the Data API is developed.
  • Determine whether or not --item-type is an acceptable input (can we just take most input arguments from orders create?
    • Indeed --item-type is not only an acceptable input, but a necessary input.
  • To create a clipped order request using a file:
$ planet orders request \
    --name test_order \
    --bundle analytic \
    --item-type PSScene4Band \
    --id 20200922_183724_23_106a,20200922_183722_17_106a \
    --clip aoi.geojson
  • To create a clipped order using stdin:
$ planet orders request \
    --name test_order \
    --bundle analytic \
    --item-type PSScene4Band \
    --id 20200922_183724_23_106a,20200922_183722_17_106a \
    --clip - < aoi.geojson

REQUESTS Usage examples

  • To create a request for a basic order for multiple scenes.
$ planet orders request \
--name test_order \
--id 20200922_183724_23_106a,20200922_183722_17_106a \
--item-type PSScene4Band \
s--bundle analytic
{"name":"test_order","products":[{"item_ids":["20200922_183724_23_106a","20200922_183722_17_106a"],"item_type":"PSScene4Band","product_bundle":"analytic"}]}
  • To create a request for an order with email notification.
$ planet orders request \
--name test_order \
--id 20200922_183724_23_106a,20200922_183722_17_106a \
--item-type PSScene4Band \
--bundle analytic \
–-email
{"name":"test_order",...}
  • To create a request for an order which clips the scenes to a geojson geometry specified in a file.
$ planet orders request \
--name test_order \
--id 20200922_183724_23_106a,20200922_183722_17_106a \
--item-type PSScene4Band \
--bundle analytic \
--clip aoi.geojson
{"name":"test_order",...}
  • To create an order which clips the scenes to a geojson geometry entered on the command line.
$ planet orders request \
--name test_order \
--id 20200922_183724_23_106a,20200922_183722_17_106a \
--item-type PSScene4Band \
--bundle analytic \
--clip  - < aoi.geojson
{"name":"test_order",...}
  • To create a request for an order with a toolchain specified in a file. NOTE: --tools and --clip cannot both be used.
$ planet orders request \
--name test_order \
--id 20200922_183724_23_106a,20200922_183722_17_106a \
--item-type PSScene4Band \
--bundle analytic \
--tools tools.json
{"name":"test_order",...}
  • to create a request for an order with a cloud configuration specified in a file.
$ planet orders request \
--name test_order \
--id 20200922_183724_23_106a,20200922_183722_17_106a \
--item-type PSScene4Band \
--bundle analytic \
--cloudconfig cloudconfig.json
{"name":"test_order",...}

planet orders create

  • Update create order interface
  • Create an order from a file.
$ planet orders create order_request.json
{"_links": …}
  • To create an order from stdin.
$ cat order_request.json | planet orders create -
{"_links": …}
  • To duplicate an order.
$ planet orders get 65df4eb0-e416-4243-a4d2-38afcf382c30 | planet orders create -
{"_links": …}

Create separate command for building the request

Create a CLI command for building the create_order request with the following interface:

Usage: planet orders request [OPTIONS]

Generate an order request.

This command provides support for building an order description used in creating an order.
It outputs the order request, optionally pretty-printed.

  Support for building and editing an order description is provided however it
  has many limitations compared to what the Orders API supports. For creation
  of more advanced order requests, create the order description manually or
  use the Python library to aid in creating the order description.

  There are two ways to build an order description: 1. starting from scratch
  and providing all necessary order parameters and 2. starting from a pre-
  existing order description and optionally overriding some parameters.

  1. Starting from scratch:

  When creating an order description from scratch, the following options are
  required: --name, --bundle, and --id.

  To create an order clipped to an Area of Interest (AOI), use the --clip
  option. This option supports a file and stdin.

  To create a clipped order request using a file:

  $ planet orders request \
      --name test_order \
      --bundle analytic \
      --id 20200922_183724_23_106a,20200922_183722_17_106a \
      --item-type PSScene4Band \
      --clip aoi.geojson

  To create a clipped order using stdin:

  $ planet orders request \
      --name test_order \
      --bundle analytic \
      --id 20200922_183724_23_106a,20200922_183722_17_106a \
      --item-type PSScene4Band \
      --clip - < aoi.geojson

  2. Starting from an order description:

Options:
  --bundle TEXT     Product bundle
  --clip FILENAME   Clip GeoJSON.
  --email           Send email notification when Order is complete
  --id TEXT         One or more item IDs.
  --like TEXT       File or stdin providing the order description
                    to use as a template.
  --name TEXT       Order name. Does not need to be unique.
  -pp, --pretty     Format JSON output.
  --help            Show this message and exit.
Usage Examples

### Update create order interface

Usage: planet orders create REQUEST

Create an order.

This command creates an order from an order request. It outputs the created order description, optionally pretty-printed.

Arguments:
Order request, stdin or str or file name. Full description of order to be created.

Options:
-pp, --pretty Format JSON output.

Metadata

Metadata

Assignees

Labels

CLI/SDK InterfaceUpdate the CLI and SDK to the finalized interface

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions