organizations / users - Keyrock command

This command allows you to manage users of organization for Keyrock.

Common Options

Options Description
--host VALUE, -h VALUE broker or server host VALUE (required)
--oid VALUE, -o VALUE organization id (required)
--help show help (default: true)

List users of an organization

This command lists users of an organization.

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

Options

Options Description
--host VALUE, -h VALUE broker or server host VALUE (required)
--oid VALUE, -o VALUE organization id (required)
--verbose, -v verbose (default: false)
--pretty, -P pretty format (default: false)
--help show help (default: true)

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
--host VALUE, -h VALUE broker or server host VALUE (required)
--oid VALUE, -o VALUE organization id (required)
--uid VALUE, -i VALUE user id (required)
--pretty, -P pretty format (default: false)
--help show help (default: true)

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
--host VALUE, -h VALUE broker or server host VALUE (required)
--oid VALUE, -o VALUE organization id (required)
--uid VALUE, -i VALUE user 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 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
--host VALUE, -h VALUE broker or server host VALUE (required)
--oid VALUE, -o VALUE organization id (required)
--uid VALUE, -i VALUE user id (required)
--orid VALUE, -c VALUE organization role id (required)
--help show help (default: true)

Examples

Request:

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