Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
lint and add ref to sync list
  • Loading branch information
charcey committed Jul 30, 2025
commit bf5a2fabaef858d8b7d40933ce5d00753d76f93b
52 changes: 27 additions & 25 deletions planet/cli/destinations.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,14 @@ async def _create_destination(ctx, data, pretty):
@click.option(
'--is-owner/--is-not-owner',
default=None,
help="""Filter by ownership. Use --is-owner to include only destinations owned by
the requesting user, or --is-not-owner to include destinations not owned by the user.""")
@click.option(
'--can-write/--can-not-write',
default=None,
help="""Filter by write access. Use --can-write to include only destinations the user can
modify, or --can-not-write to list destinations with read-only access for the user.""")
help="""Filter by ownership. Use --is-owner to include only destinations
owned by the requesting user, or --is-not-owner to include destinations
not owned by the user.""")
@click.option('--can-write/--can-not-write',
default=None,
help="""Filter by write access. Use --can-write to include only
destinations the user can modify, or --can-not-write to list destinations
with read-only access for the user.""")
async def list_destinations(ctx, archived, is_owner, can_write, pretty):
"""
List destinations with optional filters
Expand Down Expand Up @@ -126,8 +127,9 @@ def create():
@click.option("--explicit-sse",
is_flag=True,
help="Explicitly set headers for server-side encryption (SSE).")
@click.option("--name",
help="Optional name to assign to the destination. Otherwise, the bucket name is used.")
@click.option('--name',
help="""Optional name to assign to the destination.
Otherwise, the bucket name is used.""")
async def create_s3(ctx,
bucket,
region,
Expand Down Expand Up @@ -175,9 +177,9 @@ async def create_s3(ctx,
is_flag=True,
default=False,
help="Use path-style addressing with bucket name in the URL.")
@click.option(
"--name",
help="""Optional name to assign to the destination. Otherwise, the bucket name is used.""")
@click.option('--name',
help="""Optional name to assign to the destination.
Otherwise, the bucket name is used.""")
async def create_s3_compatible(ctx,
bucket,
endpoint,
Expand Down Expand Up @@ -224,9 +226,9 @@ async def create_s3_compatible(ctx,
@click.argument("secret_access_key")
@click.argument("namespace")
@click.argument("region")
@click.option(
"--name",
help="""Optional name to assign to the destination. Otherwise, the bucket name is used.""")
@click.option('--name',
help="""Optional name to assign to the destination.
Otherwise, the bucket name is used.""")
async def create_ocs(ctx,
bucket,
access_key_id,
Expand Down Expand Up @@ -267,13 +269,13 @@ async def create_ocs(ctx,
@click.argument("container")
@click.argument("account")
@click.argument("sas_token")
@click.option(
"--storage-endpoint-suffix",
required=False,
help="""Custom Azure Storage endpoint suffix (e.g., 'core.windows.net' or for sovereign clouds).""")
@click.option(
"--name",
help="""Optional name to assign to the destination. Otherwise, the container name is used.""")
@click.option('--storage-endpoint-suffix',
required=False,
help="""Custom Azure Storage endpoint suffix
(e.g., 'core.windows.net' or for sovereign clouds).""")
@click.option('--name',
help="""Optional name to assign to the destination.
Otherwise, the bucket name is used.""")
async def create_azure(ctx,
container,
account,
Expand Down Expand Up @@ -313,9 +315,9 @@ async def create_azure(ctx,
@command(create, name="gcs")
@click.argument("bucket")
@click.argument("credentials")
@click.option(
"--name",
help="""Optional name to assign to the destination. Otherwise, the bucket name is used.""")
@click.option('--name',
help="""Optional name to assign to the destination.
Otherwise, the bucket name is used.""")
async def create_gcs(ctx, bucket, credentials, name, pretty):
"""
Create a new Google Cloud Storage (GCS) destination.
Expand Down
1 change: 0 additions & 1 deletion planet/clients/destinations.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from planet.http import Session
from ..constants import PLANET_BASE_URL


BASE_URL = f'{PLANET_BASE_URL}/destinations/v1/'

LOGGER = logging.getLogger()
Expand Down
8 changes: 4 additions & 4 deletions planet/clients/orders.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,8 @@ async def list_orders(
created_on: Optional[str] = None,
last_modified: Optional[str] = None,
hosting: Optional[bool] = None,
sort_by: Optional[str] = None,
destination_ref: Optional[str] = None) -> AsyncIterator[dict]:
destination_ref: Optional[str] = None,
sort_by: Optional[str] = None) -> AsyncIterator[dict]:
"""Iterate over the list of stored orders.

By default, order descriptions are sorted by creation date with the last created
Expand All @@ -496,6 +496,8 @@ async def list_orders(
last_modified (str): filter by last modified date-time or interval.
hosting (bool): only return orders that contain a hosting block
(e.g. SentinelHub hosting).
destination_ref (str): filter by orders created with the provided
destination reference.
sort_by (str): fields to sort orders by. Multiple fields can be specified,
separated by commas. The sort direction can be specified by appending
' ASC' or ' DESC' to the field name. The default sort direction is
Expand All @@ -508,8 +510,6 @@ async def list_orders(
* "name"
* "name DESC"
* "name,state DESC,last_modified"
destination_ref (str): filter by orders created with the provided
destination reference.

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
Expand Down
3 changes: 2 additions & 1 deletion planet/clients/subscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ async def list_subscriptions(self,
* "name DESC"
* "name,end_time DESC,start_time"
updated (str): filter by updated time or interval.
destination_ref (str): filter by destination reference.
destination_ref (str): filter by subscriptions created with the
provided destination reference.
page_size (int): number of subscriptions to return per page.

Datetime args (created, end_time, start_time, updated) can either be a
Expand Down
4 changes: 4 additions & 0 deletions planet/sync/orders.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ def list_orders(self,
created_on: Optional[str] = None,
last_modified: Optional[str] = None,
hosting: Optional[bool] = None,
destination_ref: Optional[str] = None,
sort_by: Optional[str] = None) -> Iterator[dict]:
"""Iterate over the list of stored orders.

Expand All @@ -281,6 +282,8 @@ def list_orders(self,
last_modified (str): filter by last modified date-time or interval.
hosting (bool): only return orders that contain a hosting block
(e.g. SentinelHub hosting).
destination_ref (str): filter by orders created with the provided
destination reference.
sort_by (str): fields to sort orders by. Multiple fields can be specified,
separated by commas. The sort direction can be specified by appending
' ASC' or ' DESC' to the field name. The default sort direction is
Expand Down Expand Up @@ -316,4 +319,5 @@ def list_orders(self,
created_on,
last_modified,
hosting,
destination_ref,
sort_by))
4 changes: 4 additions & 0 deletions planet/sync/subscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def list_subscriptions(self,
start_time: Optional[str] = None,
sort_by: Optional[str] = None,
updated: Optional[str] = None,
destination_ref: Optional[str] = None,
page_size: int = 500) -> Iterator[dict]:
"""Iterate over list of account subscriptions with optional filtering.

Expand Down Expand Up @@ -79,6 +80,8 @@ def list_subscriptions(self,
* "name DESC"
* "name,end_time DESC,start_time"
updated (str): filter by updated time or interval.
destination_ref (str): filter by subscriptions created with the
provided destination reference.
limit (int): limit the number of subscriptions in the
results. When set to 0, no maximum is applied.
page_size (int): number of subscriptions to return per page.
Expand Down Expand Up @@ -113,6 +116,7 @@ def list_subscriptions(self,
start_time,
sort_by,
updated,
destination_ref,
page_size))

def create_subscription(self, request: Dict) -> Dict:
Expand Down