Skip to content

Commit f6e04af

Browse files
Merge pull request #1035 from planetlabs/update-docs
Update CLI Docs
2 parents 63e8e36 + fa13c44 commit f6e04af

File tree

1 file changed

+33
-26
lines changed

1 file changed

+33
-26
lines changed

docs/cli/cli-subscriptions.md

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: CLI for Subscriptions API Tutorial
44

55
## Introduction
66

7-
The `planet subscriptions` command enables interaction with the
7+
The `planet subscriptions` command enables interaction with the
88
[Subscriptions API](https://developers.planet.com/apis/subscriptions/)
99
that make it possible to set up a recurring search criteria. Using `planet subscriptions`, you can automatically process
1010
and deliver new imagery to a cloud bucket. It also has a powerful 'backfill' capability
@@ -15,7 +15,7 @@ through the main commands available in the CLI.
1515

1616
### Create a Subscription
1717

18-
Since there is no UI to easily create subscriptions we’ll start with making a new one.
18+
Since there is no UI to easily create subscriptions we’ll start with making a new one.
1919

2020
```json
2121
{
@@ -104,11 +104,11 @@ Since there is no UI to easily create subscriptions we’ll start with making a
104104
}
105105
```
106106

107-
This is a full subscriptions JSON request, with the credentials redacted, so you’ll have
108-
to replace your own for it to work. Below we’ll show the convenience methods that will
109-
help create a custom one more easily. If you'd like to get things working for now then
110-
just replace the 'delivery' section with your cloud credentials, see the
111-
[core subscriptions delivery docs](https://developers.planet.com/docs/subscriptions/delivery/)
107+
This is a full subscriptions JSON request, with the credentials redacted, so you’ll have
108+
to replace your own for it to work. Below we’ll show the convenience methods that will
109+
help create a custom one more easily. If you'd like to get things working for now then
110+
just replace the 'delivery' section with your cloud credentials, see the
111+
[core subscriptions delivery docs](https://developers.planet.com/docs/subscriptions/delivery/)
112112
for more information.
113113

114114
To create a new subscription with the CLI, use the `create` command and the json file you just created:
@@ -122,7 +122,7 @@ planet subscriptions create my-subscription.json
122122

123123
#### Create a Subscription with Hosting and Collection ID
124124

125-
In addition to the basic subscription creation process, you can now specify hosting options and a collection ID directly in the create command.
125+
In addition to the basic subscription creation process, you can now specify hosting options and a collection ID directly in the create command.
126126

127127
```sh
128128
planet subscriptions create my-subscription.json --hosting sentinel_hub --collection_id ba8f7274-aacc-425e-8a38-e21517bfbeff
@@ -139,8 +139,8 @@ Now that you’ve got a subscription working you can make use of the other comma
139139
planet subscriptions list
140140
```
141141

142-
outputs the JSON for your first 100 subscriptions. If you'd like more you can set the `--limit`
143-
parameter higher, or you can set it to 0 and there will be no limit.
142+
outputs the JSON for your first 100 subscriptions. If you'd like more you can set the `--limit`
143+
parameter higher, or you can set it to 0 and there will be no limit.
144144

145145
You can get nicer formatting with `--pretty` or pipe it into `jq`, just like the other Planet
146146
CLI’s.
@@ -173,7 +173,7 @@ planet subscriptions results SUBSCRIPTION_ID
173173

174174
`SUBSCRIPTION_ID` above is a placeholder for a unique subscription identifier, which will be a UUID like `cb817760-1f07-4ee7-bba6-bcac5346343f`.
175175

176-
By default this displays the first 100 results. As with other commands, you can use the `--limit` param to
176+
By default this displays the first 100 results. As with other commands, you can use the `--limit` param to
177177
set a higher limit, or set it to 0 to see all results (this can be quite large with subscriptions results).
178178

179179
You can also filter by status:
@@ -183,7 +183,7 @@ planet subscriptions results SUBSCRIPTION_ID --status processing
183183
```
184184

185185
The available statuses are `created`, `queued`, `processing`, `failed`, and `success`. Note it’s quite useful
186-
to use `jq` to help filter out results as well.
186+
to use `jq` to help filter out results as well.
187187

188188
#### Results as comma-separated values (CSV)
189189

@@ -193,8 +193,6 @@ Planetary Variable subscribers can benefit from retrieving results as a CSV. The
193193
planet subscriptions results SUBSCRIPTION_ID --csv
194194
```
195195

196-
*New in version 2.1*
197-
198196
### Update Subscription
199197

200198
You can update a subscription that is running, for example to change the 'tools' it’s using or to alter
@@ -206,7 +204,16 @@ planet subscriptions update cb817760-1f07-4ee7-bba6-bcac5346343f \
206204
my-updated-subscriptions.json
207205
```
208206

209-
### Cancel a subscription
207+
### Update Subscription Via Patch
208+
209+
To update a running subscription with *only* the attributes to be updated, use the `patch` method.
210+
211+
```sh
212+
planet subscriptions patch cb817760-1f07-4ee7-bba6-bcac5346343f \
213+
patched-attributes.json
214+
```
215+
216+
### Cancel Subscription
210217

211218
Cancelling a subscription is simple with the CLI:
212219

@@ -220,12 +227,12 @@ continue to list and get it.
220227
## Subscription Request Conveniences
221228

222229
There are a couple of commands that can assist in creating the subscription JSON, used for creation and updates.
223-
A subscription request is a pretty complicated command, consisting of a search, a cloud delivery, as well as
224-
tools to process the data plus notifications on the status.
230+
A subscription request is a pretty complicated command, consisting of a search, a cloud delivery, as well as
231+
tools to process the data plus notifications on the status.
225232

226233
### Catalog Request
227234

228-
The first place to start is the `request-catalog` command, which generates all the JSON for the
235+
The first place to start is the `request-catalog` command, which generates all the JSON for the
229236
[catalog source](https://developers.planet.com/docs/subscriptions/source/#catalog-source-type) block. The core
230237
of this is quite similar to a Data API search request, though with more required fields. The minimal
231238
required commands would be a request like:
@@ -238,7 +245,7 @@ planet subscriptions request-catalog \
238245
--start-time 2023-03-17T04:08:00.0Z
239246
```
240247

241-
You request which item types you want to deliver, and the asset types for it. Note that the `asset-types` are a bit
248+
You request which item types you want to deliver, and the asset types for it. Note that the `asset-types` are a bit
242249
different than the `--bundle` command in Orders, a bundle is a set of asset-types. You can see the list of asset types
243250
for [PSScene](https://developers.planet.com/docs/data/psscene/#available-asset-types), [SkySatCollect](https://developers.planet.com/docs/data/skysatcollect/),
244251
and [SkySatScene](https://developers.planet.com/docs/data/skysatscene/#available-asset-types). The other item-types
@@ -299,7 +306,7 @@ planet subscriptions request-catalog \
299306
```
300307

301308
For more information on the `rrule` parameter see the [recurrence rules](https://developers.planet.com/docs/subscriptions/source/#rrules-recurrence-rules)
302-
documentation.
309+
documentation.
303310

304311
#### Filter
305312

@@ -354,7 +361,7 @@ planet subscriptions request-catalog \
354361
#### Saving the output
355362

356363
You’ll likely want to save the output of your `request-catalog` call to disk, so that you can more easily use it in constructing the complete subscription
357-
request.
364+
request.
358365

359366
```sh
360367
planet data filter --range clear_percent gt 90 > filter.json
@@ -387,10 +394,10 @@ planet subscriptions request-pv \
387394

388395
### Subscription Tools
389396

390-
Now we’ll dive into some of the tools options for subscriptions. These are quite similar to the tools for
391-
orders, but unfortunately the syntax is subtly different, and there are less tools supported. Just like
397+
Now we’ll dive into some of the tools options for subscriptions. These are quite similar to the tools for
398+
orders, but unfortunately the syntax is subtly different, and there are less tools supported. Just like
392399
for Orders, future of the versions of the CLI will likely add `tools` convenience methods, you can follow issue
393-
[#601](https://github.com/planetlabs/planet-client-python/issues/601).
400+
[#601](https://github.com/planetlabs/planet-client-python/issues/601).
394401

395402
#### Clipping
396403

@@ -455,12 +462,12 @@ Example: `more-tools.json`
455462

456463
### Delivery
457464

458-
One other essential block is the `delivery` JSON. Like with tools there is no convenience
465+
One other essential block is the `delivery` JSON. Like with tools there is no convenience
459466
method, as of yet. You must write out the JSON for this section.
460467
You can find the full documentation for the delivery options in
461468
the [Subscriptions Delivery documentation](https://developers.planet.com/docs/subscriptions/delivery/).
462469

463-
An example of a delivery.json file that you would save as a file to pass into the
470+
An example of a delivery.json file that you would save as a file to pass into the
464471
`subscriptions request` command is:
465472

466473
```json

0 commit comments

Comments
 (0)