users - Keyrock command

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

This command lists all users.

ngsi users [command options] list [options]

Options

Options Description
--pretty, -P pretty format (default: false)
--help show help (default: false)

Examples

Request:

ngsi users list --pretty
{
  "users": [
    {
      "scope": [],
      "id": "31ea0ac1-595f-479e-9854-f911a26a3d51",
      "username": "alice",
      "email": "alice@test.com",
      "enabled": true,
      "gravatar": false,
      "date_password": "2021-02-20T20:42:23.000Z",
      "description": null,
      "website": null
    },
    {
      "scope": [],
      "id": "admin",
      "username": "admin",
      "email": "keyrock@letsfiware.jp",
      "enabled": true,
      "gravatar": false,
      "date_password": "2021-02-20T20:40:33.000Z",
      "description": null,
      "website": null
    }
  ]
}

Get a user

This command gets a user.

ngsi user [command options] get [options]

Options

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

Examples

Request:

ngsi users get --uid 31ea0ac1-595f-479e-9854-f911a26a3d51 --pretty
{
  "user": {
    "scope": [],
    "id": "31ea0ac1-595f-479e-9854-f911a26a3d51",
    "username": "alice",
    "email": "alice@test.com",
    "enabled": true,
    "admin": false,
    "image": "default",
    "gravatar": false,
    "date_password": "2021-02-20T20:42:23.000Z",
    "description": null,
    "website": null
  }
}

Create a user

This command creates a user.

ngsi user [command options] create [options]

Options

Options Description
--username value, -u value user name
--password value, -p value password
--email value, -e value email
--verbose, -v verbose (default: false)
--pretty, -P pretty format (default: false)
--help show help (default: false)

Examples

Request:

ngsi users create --username alice --email alice@test.com --password test
31ea0ac1-595f-479e-9854-f911a26a3d51

Update a user

This command updates a user.

ngsi user [command options] update [options]

Options

Options Description
--uid value, -i value user id
--username value, -u value user name
--password value, -p value password
--email value, -e value email
--verbose, -v verbose (default: false)
--pretty, -P pretty format (default: false)
--help show help (default: false)

Examples

Request:

ngsi users update --uid 31ea0ac1-595f-479e-9854-f911a26a3d51 --description "test user" --pretty
{
  "values_updated": {
    "description": "test user"
  }
}

Delete a user

This command deletes a user.

ngsi user [command options] delete [options]

Options

Options Description
--uid value, -i value user id
--help show help (default: false)

Examples

Request:

ngsi users delete --uid 31ea0ac1-595f-479e-9854-f911a26a3d51