-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
220 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,18 @@ | ||
import click | ||
from parsec.commands.folders.show_folder import cli as func0 | ||
from parsec.commands.folders.delete_folder import cli as func1 | ||
from parsec.commands.folders.create_folder import cli as func0 | ||
from parsec.commands.folders.show_folder import cli as func1 | ||
from parsec.commands.folders.update_folder import cli as func2 | ||
from parsec.commands.folders.set_permissions import cli as func3 | ||
from parsec.commands.folders.get_permissions import cli as func4 | ||
from parsec.commands.folders.delete_folder import cli as func5 | ||
|
||
@click.group() | ||
def cli(): | ||
pass | ||
|
||
cli.add_command(func0) | ||
cli.add_command(func1) | ||
cli.add_command(func2) | ||
cli.add_command(func3) | ||
cli.add_command(func4) | ||
cli.add_command(func5) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,18 @@ | ||
import click | ||
from parsec.commands.quotas.get_quotas import cli as func0 | ||
from parsec.commands.quotas.show_quota import cli as func1 | ||
from parsec.commands.quotas.delete_quota import cli as func2 | ||
from parsec.commands.quotas.update_quota import cli as func3 | ||
from parsec.commands.quotas.create_quota import cli as func4 | ||
from parsec.commands.quotas.undelete_quota import cli as func5 | ||
|
||
@click.group() | ||
def cli(): | ||
pass | ||
|
||
cli.add_command(func0) | ||
cli.add_command(func1) | ||
cli.add_command(func2) | ||
cli.add_command(func3) | ||
cli.add_command(func4) | ||
cli.add_command(func5) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import click | ||
from parsec.cli import pass_context, json_loads | ||
from parsec.decorators import bioblend_exception, dict_output | ||
|
||
@click.command('create_folder') | ||
@click.argument("parent_folder_id", type=str) | ||
@click.argument("name", type=str) | ||
|
||
@click.option( | ||
"--description", | ||
help="folder's description", | ||
type=str | ||
) | ||
|
||
@pass_context | ||
@bioblend_exception | ||
@dict_output | ||
def cli(ctx, parent_folder_id, name, description=""): | ||
"""Create a folder. | ||
""" | ||
return ctx.gi.folders.create_folder(parent_folder_id, name, description=description) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import click | ||
from parsec.cli import pass_context, json_loads | ||
from parsec.decorators import bioblend_exception, dict_output | ||
|
||
@click.command('get_permissions') | ||
@click.argument("folder_id", type=str) | ||
@click.argument("scope", type=str) | ||
|
||
|
||
@pass_context | ||
@bioblend_exception | ||
@dict_output | ||
def cli(ctx, folder_id, scope): | ||
"""Get the permissions of a folder. | ||
""" | ||
return ctx.gi.folders.get_permissions(folder_id, scope) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import click | ||
from parsec.cli import pass_context, json_loads | ||
from parsec.decorators import bioblend_exception, dict_output | ||
|
||
@click.command('set_permissions') | ||
@click.argument("folder_id", type=str) | ||
|
||
@click.option( | ||
"--action", | ||
help="action to execute, only "set_permissions" is supported.", | ||
type=str | ||
) | ||
@click.option( | ||
"--add_ids", | ||
help="list of role IDs which can add datasets to the folder" | ||
) | ||
@click.option( | ||
"--manage_ids", | ||
help="list of role IDs which can manage datasets in the folder" | ||
) | ||
@click.option( | ||
"--modify_ids", | ||
help="list of role IDs which can modify datasets in the folder" | ||
) | ||
|
||
@pass_context | ||
@bioblend_exception | ||
@dict_output | ||
def cli(ctx, folder_id, action="", add_ids="", manage_ids="", modify_ids=""): | ||
"""Set the permissions of a folder. | ||
""" | ||
return ctx.gi.folders.set_permissions(folder_id, action=action, add_ids=add_ids, manage_ids=manage_ids, modify_ids=modify_ids) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import click | ||
from parsec.cli import pass_context, json_loads | ||
from parsec.decorators import bioblend_exception, dict_output | ||
|
||
@click.command('update_folder') | ||
@click.argument("folder_id", type=str) | ||
@click.argument("name", type=str) | ||
|
||
@click.option( | ||
"--description", | ||
help="folder's description", | ||
type=str | ||
) | ||
|
||
@pass_context | ||
@bioblend_exception | ||
@dict_output | ||
def cli(ctx, folder_id, name, description=""): | ||
"""Update folder information. | ||
""" | ||
return ctx.gi.folders.update_folder(folder_id, name, description=description) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import click | ||
from parsec.cli import pass_context, json_loads | ||
from parsec.decorators import bioblend_exception, dict_output | ||
|
||
@click.command('create_quota') | ||
@click.argument("name", type=str) | ||
@click.argument("description", type=str) | ||
@click.argument("amount", type=str) | ||
@click.argument("operation", type=str) | ||
|
||
@click.option( | ||
"--default", | ||
help="Whether or not this is a default quota. Valid values are ``no``, ``unregistered``, ``registered``. None is equivalent to ``no``.", | ||
type=str | ||
) | ||
@click.option( | ||
"--in_users", | ||
help="A list of user IDs or user emails." | ||
) | ||
@click.option( | ||
"--in_groups", | ||
help="A list of group IDs or names." | ||
) | ||
|
||
@pass_context | ||
@bioblend_exception | ||
@dict_output | ||
def cli(ctx, name, description, amount, operation, default="", in_users="", in_groups=""): | ||
"""Create a new quota | ||
""" | ||
return ctx.gi.quotas.create_quota(name, description, amount, operation, default=default, in_users=in_users, in_groups=in_groups) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import click | ||
from parsec.cli import pass_context, json_loads | ||
from parsec.decorators import bioblend_exception, dict_output | ||
|
||
@click.command('delete_quota') | ||
@click.argument("quota_id", type=str) | ||
|
||
|
||
@pass_context | ||
@bioblend_exception | ||
@dict_output | ||
def cli(ctx, quota_id): | ||
"""Delete a quota | ||
""" | ||
return ctx.gi.quotas.delete_quota(quota_id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import click | ||
from parsec.cli import pass_context, json_loads | ||
from parsec.decorators import bioblend_exception, dict_output | ||
|
||
@click.command('undelete_quota') | ||
@click.argument("quota_id", type=str) | ||
|
||
|
||
@pass_context | ||
@bioblend_exception | ||
@dict_output | ||
def cli(ctx, quota_id): | ||
"""Unelete a quota | ||
""" | ||
return ctx.gi.quotas.undelete_quota(quota_id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import click | ||
from parsec.cli import pass_context, json_loads | ||
from parsec.decorators import bioblend_exception, dict_output | ||
|
||
@click.command('update_quota') | ||
@click.argument("quota_id", type=str) | ||
|
||
@click.option( | ||
"--name", | ||
help="Name for the new quota. This must be unique within a Galaxy instance.", | ||
type=str | ||
) | ||
@click.option( | ||
"--description", | ||
help="Quota description. If you supply this parameter, but not the name, an error will be thrown.", | ||
type=str | ||
) | ||
@click.option( | ||
"--amount", | ||
help="Quota size (E.g. ``10000MB``, ``99 gb``, ``0.2T``, ``unlimited``)", | ||
type=str | ||
) | ||
@click.option( | ||
"--operation", | ||
help="One of (``+``, ``-``, ``=``). If you wish to change this value, you must also provide the ``amount``, otherwise it will not take effect.", | ||
type=str | ||
) | ||
@click.option( | ||
"--default", | ||
help="Whether or not this is a default quota. Valid values are ``no``, ``unregistered``, ``registered``. Calling update twice with a default of ``no`` will throw an error. Not passing this parameter is equivalent to passing ``no``.", | ||
type=str | ||
) | ||
@click.option( | ||
"--in_users", | ||
help="A list of user IDs or user emails." | ||
) | ||
@click.option( | ||
"--in_groups", | ||
help="A list of group IDs or names." | ||
) | ||
|
||
@pass_context | ||
@bioblend_exception | ||
@dict_output | ||
def cli(ctx, quota_id, name="", description="", amount="", operation="", default="", in_users="", in_groups=""): | ||
"""Update an existing quota | ||
""" | ||
return ctx.gi.quotas.update_quota(quota_id, name=name, description=description, amount=amount, operation=operation, default=default, in_users=in_users, in_groups=in_groups) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters