Skip to content

Commit

Permalink
Merge pull request #3 from kids-first/feat/query_any_ds
Browse files Browse the repository at this point in the history
✨ add ability to query any http(s) dataservice
  • Loading branch information
chris-s-friedman authored May 12, 2022
2 parents 0d23ad0 + dac07b7 commit c8f8683
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions kf_ds_tools/scripts/ds_copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,32 @@
sequencing_center_handler,
)

api_url_help_text = (
"Either http url to dataservice or \n"
+ f"{[i for i in KF_API_URLS.keys()]}"
)


@click.group()
@click.option(
"-s",
"--source",
type=click.Choice(KF_API_URLS.keys(), case_sensitive=False),
type=str,
required=True,
help="Source dataservice to copy FROM",
help="Source dataservice to copy FROM. " + api_url_help_text,
)
@click.option(
"-t",
"--target",
type=click.Choice(KF_API_URLS.keys(), case_sensitive=False),
type=str,
required=True,
help="Target dataservice to copy TO",
help="Target dataservice to copy TO. " + api_url_help_text,
)
@click.pass_context
def copy(ctx, source, target):
ctx.ensure_object(dict)
ctx.obj["source"] = KF_API_URLS.get(source)
ctx.obj["target"] = KF_API_URLS.get(target)
ctx.obj["source"] = KF_API_URLS.get(source.lower()) or source
ctx.obj["target"] = KF_API_URLS.get(target.lower()) or target
pass


Expand Down

0 comments on commit c8f8683

Please sign in to comment.