X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2Fosmclient.git;a=blobdiff_plain;f=osmclient%2Fscripts%2Fosm.py;h=83b4727c5a9a4c66cd08647aeb3a5ce7a94bdc50;hp=c369ff5306d8288c018a6775127e774b82b7fc23;hb=b2829e950b5d11af468e7eb104c118dad9de1c4e;hpb=5de571ed5ac38d3225ebdaa257b2b6b453a03bb5 diff --git a/osmclient/scripts/osm.py b/osmclient/scripts/osm.py index c369ff5..83b4727 100755 --- a/osmclient/scripts/osm.py +++ b/osmclient/scripts/osm.py @@ -2849,11 +2849,11 @@ def vnf_scale(ctx, @cli.command(name='role-create', short_help='creates a role') @click.argument('name') -@click.option('--definition', +@click.option('--permissions', default=None, - help='role definition using a dictionary') + help='role permissions using a dictionary') @click.pass_context -def role_create(ctx, name, definition): +def role_create(ctx, name, permissions): """ Creates a new role. @@ -2863,7 +2863,7 @@ def role_create(ctx, name, definition): """ try: check_client_version(ctx.obj, ctx.command.name) - ctx.obj.role.create(name, definition) + ctx.obj.role.create(name, permissions) except ClientException as inst: print(inst.message) exit(1) @@ -2871,17 +2871,20 @@ def role_create(ctx, name, definition): @cli.command(name='role-update', short_help='updates a role') @click.argument('name') -@click.option('--definition', +@click.option('--set-name', default=None, - help='add a new definition to the role') + help='change name of rle') +# @click.option('--permissions', +# default=None, +# help='provide a yaml format dictionary with incremental changes. Values can be bool or None to delete') @click.option('--add', default=None, - help='add a resource access grant/denial') + help='yaml format dictionary with permission: True/False to access grant/denial') @click.option('--remove', default=None, - help='remove a resource access grant/denial') + help='yaml format list to remove a permission') @click.pass_context -def role_update(ctx, name, definition, add, remove): +def role_update(ctx, name, set_name, add, remove): """ Updates a role. @@ -2893,7 +2896,7 @@ def role_update(ctx, name, definition, add, remove): """ try: check_client_version(ctx.obj, ctx.command.name) - ctx.obj.role.update(name, definition, add, remove) + ctx.obj.role.update(name, set_name, None, add, remove) except ClientException as inst: print(inst.message) exit(1)