users - Keyrock command

This command allows you to manage users for Keyrock.

Common Options

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

List users

This command lists all users.

ngsi users [command options] list [options]

Options

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

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

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
--host VALUE, -h VALUE broker or server host VALUE (required)
--username VALUE, -u VALUE user name (required)
--password VALUE, -p VALUE password (required)
--email VALUE, -e VALUE email (required)
--verbose, -v verbose (default: false)
--pretty, -P pretty format (default: false)
--help show help (default: true)

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
--host VALUE, -h VALUE broker or server host VALUE (required)
--uid VALUE, -i VALUE user id (required)
--username VALUE, -u VALUE user name
--password VALUE, -p VALUE password
--email VALUE, -e VALUE email
--gravatar, -g gravatar (default: false)
--description VALUE, -d VALUE description
--website VALUE, -w VALUE website
--extra VALUE, -E VALUE extra information
--pretty, -P pretty format (default: false)
--help show help (default: true)

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

Examples

Request:

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