You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This uses `-s` to collect the output into a single array, and `length` then tells the
84
74
length of the array.
85
75
76
+
#### Filtering
77
+
78
+
The `list` command supports filtering on a variety of fields:
79
+
*`--state`: Filter by order state. Options include `queued`, `failed`, `success`, `partial` and `cancelled`.
80
+
*`--source-type`: Filter by source type. Options include `scenes`, `basemaps`, or `all`. The default is `all`.
81
+
*`--name`: Filter by name.
82
+
*`--name-contains`: Only return orders with a name that contains the provided string.
83
+
*`--created-on`: Filter on the order creation time or an interval of creation times.
84
+
*`--last-modified`: Filter on the order's last modified time or an interval of last modified times.
85
+
*`--hosting`: Filter on orders containing a hosting location (e.g. SentinelHub). Accepted values are `true` or `false`.
86
+
87
+
Datetime args (`--created-on` and `--last-modified`) can either be a date-time or an interval, open or closed. Date and time expressions adhere to RFC 3339. Open intervals are expressed using double-dots.
88
+
* A date-time: `2018-02-12T23:20:50Z`
89
+
* A closed interval: `2018-02-12T00:00:00Z/2018-03-18T12:31:12Z`
90
+
* Open intervals: `2018-02-12T00:00:00Z/..` or `../2018-03-18T12:31:12Z`
91
+
92
+
To list orders in progress:
93
+
```sh
94
+
planet orders list --state running
95
+
```
96
+
97
+
To list orders with the `scenes` source type:
98
+
```sh
99
+
planet orders list --source-type scenes
100
+
```
101
+
102
+
To list orders that were created in 2024:
103
+
```sh
104
+
planet orders list --created-on 2024-01-01T00:00:00Z/2025-01-01T00:00:00Z
105
+
```
106
+
107
+
To list orders with a hosting location:
108
+
```sh
109
+
planet orders list --hosting true
110
+
```
111
+
112
+
To list orders with the name `my location xyz`:
113
+
```sh
114
+
planet orders list --name "my location xyz"
115
+
```
116
+
117
+
To list orders with a name containing `xyz`:
118
+
```sh
119
+
planet orders list --name-contains xyz
120
+
```
121
+
122
+
#### Sorting
123
+
124
+
The `list` command also supports sorting the orders on one or more fields: `name`, `created_on`, `state`, and `last_modified`. The sort direction can be specified by appending ` ASC` or ` DESC` to the field name (default is ascending).
125
+
126
+
When multiple fields are specified, the sort order is applied in the order the fields are listed.
127
+
128
+
Sorting examples:
129
+
*`--sort-by name`: sorts orders by name alphabetically.
130
+
*`--sort-by "created_on DESC"`: sorts orders by most recently created.
131
+
*`--sort-by "last_modified DESC"`: sorts subscriptions by most recently modified.
132
+
*`--sort-by "state ASC"`: sorts orders by state alphabetically.
133
+
*`--sort-by "name,last_modified DESC"`: sorts subscriptions by name first, and most recently modified second.
134
+
86
135
### Info on an Order
87
136
88
137
For a bit more information about an order, including the location of any downloads, use
Copy file name to clipboardExpand all lines: docs/cli/cli-subscriptions.md
+48-10Lines changed: 48 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -117,8 +117,7 @@ To create a new subscription with the CLI, use the `create` command and the json
117
117
planet subscriptions create my-subscription.json
118
118
```
119
119
120
-
!!!note "Note"
121
-
The above command assumes that you’ve saved the subscriptions JSON as `my-subscription.json` and that you’ve replaced the delivery information with your own bucket and credentials.
120
+
**Note:** The above command assumes that you’ve saved the subscriptions JSON as `my-subscription.json` and that you’ve replaced the delivery information with your own bucket and credentials.
122
121
123
122
### List Subscriptions
124
123
@@ -134,23 +133,62 @@ parameter higher, or you can set it to 0 and there will be no limit.
134
133
You can get nicer formatting with `--pretty` or pipe it into `jq`, just like the other Planet
135
134
CLI’s.
136
135
137
-
The `list` command supports filtering by the status of the subscription:
138
-
136
+
#### Filtering
137
+
138
+
The `list` command supports filtering on a variety of fields:
139
+
*`--created`: Filter on the subscription creation time or an interval of creation times.
140
+
*`--end-time`: Filter on the subscription end time or an interval of end times.
141
+
*`--hosting`: Filter on subscriptions containing a hosting location (e.g. SentinelHub). Accepted values are `true` or `false`.
142
+
*`--name-contains`: Filter on subscriptions with a name that contains the provided string.
143
+
*`--name`: Filter on subscriptions with a specific name
144
+
*`--source-type`: Filter by the source type of the subscription. For the full list of available source types, see [Subscription Source Types](https://developers.planet.com/docs/subscriptions/source/#subscription-source-types). Multiple source type args are allowed.
145
+
*`--start-time`: Filter on the subscription start time or an interval of start times.
146
+
*`--status`: Filter on the status of the subscription. Status options include `running`, `cancelled`, `preparing`, `pending`, `completed`, `suspended`, and `failed`. Multiple status args are allowed.
147
+
*`--updated`: Filter on the subscription update time or an interval of updated times.
148
+
149
+
Datetime args (`--created`, `end-time`, `--start-time`, and `--updated`) can either be a date-time or an interval, open or closed. Date and time expressions adhere to RFC 3339. Open intervals are expressed using double-dots.
150
+
* A date-time: `2018-02-12T23:20:50Z`
151
+
* A closed interval: `2018-02-12T00:00:00Z/2018-03-18T12:31:12Z`
152
+
* Open intervals: `2018-02-12T00:00:00Z/..` or `../2018-03-18T12:31:12Z`
153
+
154
+
To list currently active subscriptions:
139
155
```sh
140
156
planet subscriptions list --status running
141
157
```
142
158
143
-
gives you just the currently active subscriptions. The other available statuses are:
144
-
`cancelled`, `preparing`, `pending`, `completed`, `suspended`, and `failed`.
159
+
To list subscriptions with the `catalog` source type:
160
+
```sh
161
+
planet subscriptions list --source-type catalog
162
+
```
145
163
146
-
The `list` command also supports filtering by the source type of the subscription:
164
+
To list subscriptions that were created in 2024:
165
+
```sh
166
+
planet subscriptions list --created 2024-01-01T00:00:00Z/2025-01-01T00:00:00Z
167
+
```
147
168
169
+
To list subscriptions with an end time after Jan 1, 2025:
148
170
```sh
149
-
planet subscriptions list --source-type catalog
171
+
planet subscriptions list --end-time 2025-01-01T00:00:00Z/..
150
172
```
151
173
152
-
only gives you subscriptions with the `catalog` source type. For the full list of available source types,
153
-
see [Subscription Source Types](https://developers.planet.com/docs/subscriptions/source/#subscription-source-types).
174
+
To list subscriptions with a hosting location:
175
+
```sh
176
+
planet subscriptions list --hosting true
177
+
```
178
+
179
+
#### Sorting
180
+
181
+
The `list` command also supports sorting the subscriptions on one or more fields: `name`, `created`, `updated`, `start_time`, and `end_time`. The sort direction can be specified by appending ` ASC` or ` DESC` to the field name (default is ascending).
182
+
183
+
When multiple fields are specified, the sort order is applied in the order the fields are listed.
184
+
185
+
Sorting examples:
186
+
*`--sort-by name`: sorts subscriptions by name alphabetically.
187
+
*`--sort-by "created DESC"`: sorts subscriptions by most recently created.
188
+
*`--sort-by "updated DESC"`: sorts subscriptions by most recently updated.
189
+
*`--sort-by "start_time ASC"`: sorts subscriptions by start time (earliest to latest)
190
+
*`--sort-by "end_time DESC"`: sorts subscriptions by end time (latest to earliest)
191
+
*`--sort-by "name,start_time DESC"`: sorts subscriptions by name ascending first, and start time descending second.
0 commit comments