Commit 473f2d23 authored by Giorgos Korfiatis's avatar Giorgos Korfiatis Committed by Christos Stavrakakis
Browse files

astakos: Rename --limit to --default-quota

Use a more descriptive name for this resource-modify option. Also change
resource-list column `limit' to `default_quota'.
parent 053bcb0d
...@@ -306,10 +306,9 @@ uncomment the default setting ``ASTAKOS_SERVICES`` ...@@ -306,10 +306,9 @@ uncomment the default setting ``ASTAKOS_SERVICES``
and customize the ``'uplimit'`` values. and customize the ``'uplimit'`` values.
These are the default base quota for all users. These are the default base quota for all users.
To apply your configuration run:: You can modify the default base quota limit for all future users with::
# snf-manage astakos-init --load-service-resources # snf-manage resource-modify <resource_name> --default-quota <value>
# snf-manage quota --sync
Set base quota for individual users Set base quota for individual users
``````````````````````````````````` ```````````````````````````````````
...@@ -336,7 +335,7 @@ in ``20-snf-astakos-app-settings.conf`` set:: ...@@ -336,7 +335,7 @@ in ``20-snf-astakos-app-settings.conf`` set::
You can change the maximum allowed number of pending project applications You can change the maximum allowed number of pending project applications
per user with:: per user with::
# snf-manage resource-modify astakos.pending_app --limit <number> # snf-manage resource-modify astakos.pending_app --default-quota <number>
You can also set a user-specific limit with:: You can also set a user-specific limit with::
......
...@@ -914,7 +914,7 @@ We now have to specify the limit on resources that each user can employ ...@@ -914,7 +914,7 @@ We now have to specify the limit on resources that each user can employ
.. code-block:: console .. code-block:: console
# snf-manage resource-modify --limit-interactive # snf-manage resource-modify --default-quota-interactive
Servers Initialization Servers Initialization
......
...@@ -53,13 +53,13 @@ class Command(ListCommand): ...@@ -53,13 +53,13 @@ class Command(ListCommand):
"name": ("name", "Resource Name"), "name": ("name", "Resource Name"),
"service type": ("service_type", "Service type"), "service type": ("service_type", "Service type"),
"service origin": ("service_origin", "Service"), "service origin": ("service_origin", "Service"),
"limit": ("limit_with_unit", "Base Quota"), "default_quota": ("limit_with_unit", "Default Quota"),
"description": ("desc", "Description"), "description": ("desc", "Description"),
"allow_in_projects": ("allow_in_projects", "allow_in_projects": ("allow_in_projects",
"Make resource available in projects"), "Make resource available in projects"),
} }
fields = ["id", "name", "service origin", "limit", fields = ["id", "name", "service origin", "default_quota",
"description"] "description"]
def show_limit(self, resource): def show_limit(self, resource):
......
...@@ -46,15 +46,16 @@ class Command(BaseCommand): ...@@ -46,15 +46,16 @@ class Command(BaseCommand):
help = "Modify a resource's default base quota and boolean flags." help = "Modify a resource's default base quota and boolean flags."
option_list = BaseCommand.option_list + ( option_list = BaseCommand.option_list + (
make_option('--limit', make_option('--default-quota',
metavar='<limit>',
help="Specify default base quota"), help="Specify default base quota"),
make_option('--limit-interactive', make_option('--default-quota-interactive',
action='store_true', action='store_true',
default=None, default=None,
help=("Prompt user to change default base quota. " help=("Prompt user to change default base quota. "
"If no resource is given, prompts for all " "If no resource is given, prompts for all "
"resources.")), "resources.")),
make_option('--limit-from-file', make_option('--default-quota-from-file',
metavar='<limits_file.json>', metavar='<limits_file.json>',
help=("Read default base quota from a file. " help=("Read default base quota from a file. "
"File should contain a json dict mapping resource " "File should contain a json dict mapping resource "
...@@ -73,9 +74,9 @@ class Command(BaseCommand): ...@@ -73,9 +74,9 @@ class Command(BaseCommand):
resource_name = args[0] if len(args) > 0 else None resource_name = args[0] if len(args) > 0 else None
actions = { actions = {
'limit': self.change_limit, 'default_quota': self.change_limit,
'limit_interactive': self.change_interactive, 'default_quota_interactive': self.change_interactive,
'limit_from_file': self.change_from_file, 'default_quota_from_file': self.change_from_file,
'allow_in_projects': self.set_allow_in_projects, 'allow_in_projects': self.set_allow_in_projects,
} }
...@@ -85,8 +86,9 @@ class Command(BaseCommand): ...@@ -85,8 +86,9 @@ class Command(BaseCommand):
if len(opts) != 1: if len(opts) != 1:
raise CommandError("Please provide exactly one of the options: " raise CommandError("Please provide exactly one of the options: "
"--limit, --limit-interactive, " "--default-quota, --default-quota-interactive, "
"--limit-from-file, --allow-in-projects.") "--default-quota-from-file, "
"--allow-in-projects.")
self.unit_style = options['unit_style'] self.unit_style = options['unit_style']
check_style(self.unit_style) check_style(self.unit_style)
......
...@@ -1256,16 +1256,16 @@ def import_services(): ...@@ -1256,16 +1256,16 @@ def import_services():
debug(env.host, " * Setting default quota...") debug(env.host, " * Setting default quota...")
cmd = """ cmd = """
snf-manage resource-modify --limit 40G pithos.diskspace snf-manage resource-modify --default-quota 40G pithos.diskspace
snf-manage resource-modify --limit 2 astakos.pending_app snf-manage resource-modify --default-quota 2 astakos.pending_app
snf-manage resource-modify --limit 4 cyclades.vm snf-manage resource-modify --default-quota 4 cyclades.vm
snf-manage resource-modify --limit 40G cyclades.disk snf-manage resource-modify --default-quota 40G cyclades.disk
snf-manage resource-modify --limit 16G cyclades.total_ram snf-manage resource-modify --default-quota 16G cyclades.total_ram
snf-manage resource-modify --limit 8G cyclades.ram snf-manage resource-modify --default-quota 8G cyclades.ram
snf-manage resource-modify --limit 32 cyclades.total_cpu snf-manage resource-modify --default-quota 32 cyclades.total_cpu
snf-manage resource-modify --limit 16 cyclades.cpu snf-manage resource-modify --default-quota 16 cyclades.cpu
snf-manage resource-modify --limit 4 cyclades.network.private snf-manage resource-modify --default-quota 4 cyclades.network.private
snf-manage resource-modify --limit 4 cyclades.floating_ip snf-manage resource-modify --default-quota 4 cyclades.floating_ip
""" """
try_run(cmd) try_run(cmd)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment