applications / organizations - Keyrock command

This command allows you to manage organizations in an application for Keyrock.

Common Options

Options Description
--host value, -h value specify host or alias
--token value specify oauth token
--help show help (default: false)

List organizations

This command lists all organizations.

ngsi applications [command options] organizations --aid {id} list [options]

Options

Options Description
--aid value, -i value application id
--verbose, -v verbose (default: false)
--pretty, -P pretty format (default: false)
--help show help (default: false)

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
--aid value, -i value application id
--oid value, -o value organization id
--pretty, -P pretty format (default: false)
--help show help (default: false)

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
--aid value, -i value application id
--oid value, -o value organization id
--rid value, -r value role id
--orid value, -c value organization role id
--verbose, -v verbose (default: false)
--pretty, -P pretty format (default: false)
--help show help (default: false)

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
--aid value, -i value application id
--oid value, -o value organization id
--rid value, -r value role id
--orid value, -c value organization role id
--help show help (default: false)

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