CRUD operations create, read, update and delete groups.
The group represents a collection of a class of resources. Each resource has a name unique to a group.
bydbctl
is the command line tool in examples.
Create operation adds a new group to the database's metadata registry repository. If the group does not currently exist, create operation will create the schema.
$ bydbctl group create -f - <<EOF metadata: name: sw_metric catalog: CATALOG_MEASURE resource_opts: shard_num: 2 block_interval: unit: UNIT_HOUR num: 2 segment_interval: unit: UNIT_DAY num: 1 ttl: unit: UNIT_DAY num: 7 EOF
The group creates two shards to store group data points. Every day, it would create a segment that will generate a block every 2 hours.
The data in this group will keep 7 days.
Get operation gets a group's schema.
$ bydbctl group get -g sw_metric
Update operation updates a group's schema.
If we want to change the ttl
of the data in this group to be 1 day, use the command:
$ bydbctl group update -f - <<EOF metadata: name: sw_metric catalog: CATALOG_MEASURE resource_opts: shard_num: 2 block_interval: unit: UNIT_HOUR num: 2 segment_interval: unit: UNIT_DAY num: 1 ttl: unit: UNIT_DAY num: 1 EOF
Delete operation deletes a group's schema.
$ bydbctl group delete -g sw_metric
The list operation shows all groups' schema.
$ bydbctl group list