organizations / users - Keyrock command

This command allows you to manage users of organization 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 users of an organization

This command lists users of an organization.

ngsi organizations [command options] users --oid {id} list [options]

Options

Options Description
--oid value, -o value organization id
--pretty, -P pretty format (default: false)
--help show help (default: false)

Examples

Request:

ngsi organizations users --oid f1f2fd72-12ee-4ced-bbe8-1d99803fa0ca list --pretty
{
  "organization_users": [
    {
      "user_id": "admin",
      "organization_id": "f1f2fd72-12ee-4ced-bbe8-1d99803fa0ca",
      "role": "owner"
    },
    {
      "user_id": "b97f26a5-c8da-4fa4-9af1-c26013538a7f",
      "organization_id": "f1f2fd72-12ee-4ced-bbe8-1d99803fa0ca",
      "role": "member"
    }
  ]
}

Get info of user organization relationship

This command gets info of user organization relationship.

ngsi organization [command options] users --oid {id} get [options]

Options

Options Description
--oid value, -o value organization id
--uid value, -i value user id
--pretty, -P pretty format (default: false)
--help show help (default: false)

Examples

Request:

ngsi organizations users --oid f1f2fd72-12ee-4ced-bbe8-1d99803fa0ca \
  get --uid b97f26a5-c8da-4fa4-9af1-c26013538a7f --pretty
{
  "organization_user": {
    "user_id": "b97f26a5-c8da-4fa4-9af1-c26013538a7f",
    "organization_id": "f1f2fd72-12ee-4ced-bbe8-1d99803fa0ca",
    "role": "member"
  }
}

Add a user to an organization

This command adds a user to an organization.

ngsi organization [command options] users --oid {id} add [options]

Options

Options Description
--oid value, -o value organization id
--uid value, -i value user id
--orid value, -c value organization role id
--pretty, -P pretty format (default: false)
--help show help (default: false)

Examples

Request:

ngsi organizations users --oid f1f2fd72-12ee-4ced-bbe8-1d99803fa0ca \
  add --uid b97f26a5-c8da-4fa4-9af1-c26013538a7f --orid member --pretty
{
  "user_organization_assignments": {
    "role": "member",
    "organization_id": "f1f2fd72-12ee-4ced-bbe8-1d99803fa0ca",
    "user_id": "b97f26a5-c8da-4fa4-9af1-c26013538a7f"
  }
}

Remove a user from an organization

This command removes a user from an organization.

ngsi organization [command options] users --oid {id} remove [options]

Options

Options Description
--oid value, -o value organization id
--uid value, -i value user id
--orid value, -c value organization role id
--help show help (default: false)

Examples

Request:

ngsi organizations users --oid f1f2fd72-12ee-4ced-bbe8-1d99803fa0ca \
  remove --uid b97f26a5-c8da-4fa4-9af1-c26013538a7f --orid member