groupingrules - Cygnus command

This command allows you to manage groupingrules for Cygnus.

Common Options

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

List grouping rules

This command lists all grouping rules.

ngsi groupingrules [command options] list [options]

Options

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

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
--host VALUE, -h VALUE broker or server host VALUE (required)
--data VALUE, -d VALUE grouping rule data (required)
--pretty, -P pretty format (default: false)
--help show help (default: true)

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

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

Examples

Request:

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