Skip to content

Commit aeab4c4

Browse files
removing name kwarg from update-collection, now reading name from collection
1 parent af35912 commit aeab4c4

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Use the [stac-updater CLI](stac_updater/cli.py) to build and deploy your service
1616
stac-updater new-service
1717
1818
# Build AWS resources to update collection
19-
stac-updater update-collection --name landsat-8-l1 --root https://stac.com/landsat-8-l1/catalog.json
19+
stac-updater update-collection --root https://stac.com/landsat-8-l1/catalog.json
2020
2121
# Modify kickoff event source to s3:ObjectCreated
2222
stac-updater modify-kickoff --type s3 --bucket_name stac-updater-kickoff

stac_updater/cli.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import click
77
import yaml
8+
from satstac import Collection
89

910
from stac_updater import resources
1011

@@ -20,15 +21,17 @@ def new_service():
2021
shutil.copyfile(sls_template_path, sls_config_path)
2122

2223
@stac_updater.command(name='update-collection', short_help="update a static collection")
23-
@click.option('--name', '-n', type=str, required=True, help="Name of collection, must match catalog name referenced by STAC Items.")
2424
@click.option('--root', '-r', type=str, required=True, help="URL of collection.")
2525
@click.option('--long-poll/--short-poll', default=False, help="Enable long polling.")
2626
@click.option('--concurrency', type=int, default=1, help="Sets lambda concurrency limit when polling the queue.")
27-
def update_collection(name, root, long_poll, concurrency):
27+
def update_collection(root, long_poll, concurrency):
2828
# Create a SQS queue for the collection
2929
# Subscribe SQS queue to SNS topic with filter policy on collection name
3030
# Configure lambda function and attach to SQS queue (use ENV variables to pass state)
3131

32+
name = Collection.open(root).id
33+
print(name)
34+
3235
filter_rule = {'collection': [name]}
3336

3437
with open(sls_config_path, 'r') as f:

0 commit comments

Comments
 (0)