applications / organizations - Keyrock command
This command allows you to manage organizations in an application for Keyrock.
- list organizations in an application
- Get roles of an organization in an application
- Assign a role to an organization
- Delete a role assignment from an organization
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 organizations
This command lists all organizations.
ngsi applications [command options] organizations --aid {id} list [options]
Options
Options | Description |
---|---|
--host VALUE, -h VALUE | broker or server host VALUE (required) |
--aid VALUE, -i VALUE | application id (required) |
--verbose, -v | verbose (default: false) |
--pretty, -P | pretty format (default: false) |
--help | show help (default: true) |
Examples
Request:
ngsi applications organizations --aid 8b58ecff-fb45-4811-945c-6f42339db06b list --pretty
{
"role_organization_assignments": [
{
"organization_id": "f1f2fd72-12ee-4ced-bbe8-1d99803fa0ca",
"role_organization": "member",
"role_id": "fb3b897b-5484-4c5b-93d9-4669a46422ad"
}
]
}
Get roles of an organization in an application
This command gets roles of an organization in an application.
ngsi application [command options] organizations --aid {id} get [options]
Options
Options | Description |
---|---|
--host VALUE, -h VALUE | broker or server host VALUE (required) |
--aid VALUE, -i VALUE | application id (required) |
--oid VALUE, -o VALUE | organization id (required) |
--pretty, -P | pretty format (default: false) |
--help | show help (default: true) |
Examples
Request:
ngsi applications organizations --aid 8b58ecff-fb45-4811-945c-6f42339db06b \
get --oid f1f2fd72-12ee-4ced-bbe8-1d99803fa0ca --pretty
{
"role_organization_assignments": [
{
"organization_id": "f1f2fd72-12ee-4ced-bbe8-1d99803fa0ca",
"role_id": "fb3b897b-5484-4c5b-93d9-4669a46422ad"
}
]
}
Assign a role to an organization
This command assigns a role to an organization.
ngsi application [command options] organizations --aid {id} assigns [options]
Options
Options | Description |
---|---|
--host VALUE, -h VALUE | broker or server host VALUE (required) |
--aid VALUE, -i VALUE | application id (required) |
--oid VALUE, -o VALUE | organization id (required) |
--rid VALUE, -r VALUE | role id (required) |
--orid VALUE, -c VALUE | organization role id (required) |
--verbose, -v | verbose (default: false) |
--pretty, -P | pretty format (default: false) |
--help | show help (default: true) |
Examples
Request:
ngsi applications organizations --aid 8b58ecff-fb45-4811-945c-6f42339db06b \
assign --oid f1f2fd72-12ee-4ced-bbe8-1d99803fa0ca \
--rid fb3b897b-5484-4c5b-93d9-4669a46422ad \
--orid member --pretty
{
"role_organization_assignments": {
"role_id": "fb3b897b-5484-4c5b-93d9-4669a46422ad",
"organization_id": "f1f2fd72-12ee-4ced-bbe8-1d99803fa0ca",
"oauth_client_id": "8b58ecff-fb45-4811-945c-6f42339db06b",
"role_organization": "member"
}
}
Delete a role assignment from an organization
This command deletes a role assignment from an organization.
ngsi application [command options] organizations --aid {id} unassign [options]
Options
Options | Description |
---|---|
--host VALUE, -h VALUE | broker or server host VALUE (required) |
--aid VALUE, -i VALUE | application id (required) |
--oid VALUE, -o VALUE | organization id (required) |
--rid VALUE, -r VALUE | role id (required) |
--orid VALUE, -c VALUE | organization role id (required) |
--help | show help (default: true) |
Examples
Request:
ngsi applications organizations --aid 8b58ecff-fb45-4811-945c-6f42339db06b \
unassign --oid f1f2fd72-12ee-4ced-bbe8-1d99803fa0ca \
--rid fb3b897b-5484-4c5b-93d9-4669a46422ad \
--orid member --pretty