groupingrules - Cygnus command

This command allows you to manage groupingrules for Cygnus.

Common Options

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

List grouping rules

This command lists all grouping rules.

ngsi groupingrules [command options] list [options]

Options

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

Examples

Request:

ngsi groupingrules list --pretty
{
  "success": "true",
  "grouping_rules": [
    {
      "regex": "Room",
      "fiware_service_path": "\/rooms",
      "destination": "allrooms",
      "id": 1,
      "fields": [
        "entityType"
      ]
    }
  ]
}

Create a grouping rule

This command creates a grouping rule.

ngsi groupingrule [command options] create [options]

Options

Options Description
--data value, -d value grouping rule data
--pretty, -P pretty format (default: false)
--help show help (default: false)

Examples

Request:

ngsi groupingrules --host cygnus create --pretty --data \
'{
 "regex": "Car",
 "destination": "allcars",
 "fiware_service_path": "/cars",
 "fields": ["entityType"]
}'
{
  "success": "true"
}

Update a grouping rule

This command updates a grouping rule.

ngsi groupingrule [command options] update [options]

Options

Options Description
--id value, -i value grouping rule id
--data value, -d value grouping rule data
--pretty, -P pretty format (default: false)
--help show help (default: false)

Examples

Request:

ngsi groupingrules --host cygnus update --id 2 --data \
'{
  "regex": "Device",
  "destination": "alldevices",
  "fiware_service_path": "/devices",
  "fields": [
    "entityType"
  ]
}'
{"success":"true"}

Delete a grouping rule

This command deletes a grouping rule.

ngsi groupingrule [command options] delete [options]

Options

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

Examples

Request:

ngsi groupingrules delete --id 1
{"success":"true"}