applications / permissions - Keyrock command
This command allows you to manage permissions for Keyrock.
Common Options
Options | Description |
---|---|
--host VALUE, -h VALUE | broker or server host VALUE (required) |
--aid VALUE, -i VALUE | application id (required) |
--help | show help (default: true) |
List permissions
This command lists all permissions.
ngsi applications [command options] permissions --aid {id} list [options]
Options
Options | Description |
---|---|
--host VALUE, -h VALUE | broker or server host VALUE (required) |
--aid VALUE, -i VALUE | application id (required) |
--pid VALUE, -p VALUE | permission id |
--verbose, -v | verbose (default: false) |
--pretty, -P | pretty format (default: false) |
--help | show help (default: true) |
Examples
Request:
ngsi applications permissions --aid 8b58ecff-fb45-4811-945c-6f42339db06b list --pretty
{
"permissions": [
{
"id": "6",
"name": "Get and assign only public owned roles",
"description": null,
"action": null,
"resource": null,
"xml": null
},
{
"id": "5",
"name": "Get and assign all public application roles",
"description": null,
"action": null,
"resource": null,
"xml": null
},
{
"id": "4",
"name": "Manage authorizations",
"description": null,
"action": null,
"resource": null,
"xml": null
},
{
"id": "3",
"name": "Manage roles",
"description": null,
"action": null,
"resource": null,
"xml": null
},
{
"id": "2",
"name": "Manage the application",
"description": null,
"action": null,
"resource": null,
"xml": null
},
{
"id": "1",
"name": "Get and assign all internal application roles",
"description": null,
"action": null,
"resource": null,
"xml": null
}
]
}
Get a permission.
This command gets a permission.
ngsi application [command options] permissions --aid {id} get [options]
Options
Options | Description |
---|---|
--host VALUE, -h VALUE | broker or server host VALUE (required) |
--aid VALUE, -i VALUE | application id (required) |
--pid VALUE, -p VALUE | permission id (required) |
--pretty, -P | pretty format (default: false) |
--help | show help (default: true) |
Examples
Request:
ngsi applications permissions --aid 8b58ecff-fb45-4811-945c-6f42339db06b get --pid 1 --pretty
{
"permission": {
"id": "1",
"name": "Get and assign all internal application roles",
"description": null,
"is_internal": true,
"action": null,
"resource": null,
"is_regex": 0,
"xml": null,
"oauth_client_id": "idm_admin_app"
}
}
Create a permission
This command creates a permission.
ngsi application [command options] permissions --aid {id} create [options]
Options
Options | Description |
---|---|
--host VALUE, -h VALUE | broker or server host VALUE (required) |
--aid VALUE, -i VALUE | application id (required) |
--data VALUE, -d VALUE | permissionrole data |
--name VALUE, -n VALUE | permission name |
--description VALUE, -D VALUE | description |
--action VALUE, -a VALUE | action |
--resource VALUE, -r VALUE | resoruce |
--verbose, -v | verbose (default: false) |
--pretty, -P | pretty format (default: false) |
--help | show help (default: true) |
Examples
Request:
ngsi applications permissions --aid $aid \
create --name "permission1" \
--description "test" \
--action "GET" \
--resource "login"
ab781799-d2bb-4022-b4b9-5101cbc98e12
Update a permission
This command updates a permission.
ngsi application [command options] permissions --aid {id} update [options]
Options
Options | Description |
---|---|
--host VALUE, -h VALUE | broker or server host VALUE (required) |
--aid VALUE, -i VALUE | application id (required) |
--pid VALUE, -p VALUE | permission id (required) |
--data VALUE, -d VALUE | permissionrole data |
--name VALUE, -n VALUE | permission name |
--description VALUE, -D VALUE | description |
--action VALUE, -a VALUE | action |
--resource VALUE, -r VALUE | resoruce |
--verbose, -v | verbose (default: false) |
--pretty, -P | pretty format (default: false) |
--help | show help (default: true) |
Examples
Request:
ngsi applications permissions --aid 8b58ecff-fb45-4811-945c-6f42339db06b \
update --pid ab781799-d2bb-4022-b4b9-5101cbc98e12 --name "perm1"
{"values_updated":{"name":"perm1"}}
Delete a permission
This command deletes a permission.
ngsi application [command options] permissions --aid {id} delete [options]
Options
Options | Description |
---|---|
--host VALUE, -h VALUE | broker or server host VALUE (required) |
--aid VALUE, -i VALUE | application id (required) |
--pid VALUE, -p VALUE | permission id (required) |
--help | show help (default: true) |
Examples
Request:
ngsi applications permissions --aid 8b58ecff-fb45-4811-945c-6f42339db06b \
delete --pid ab781799-d2bb-4022-b4b9-5101cbc98e12