2015-05-08 17:51:50 +00:00
|
|
|
package internal;
|
|
|
|
|
|
|
|
//========================================================================
|
|
|
|
//
|
|
|
|
// Metadata
|
|
|
|
//
|
|
|
|
//========================================================================
|
|
|
|
|
|
|
|
message Data {
|
|
|
|
repeated NodeInfo Nodes = 1;
|
|
|
|
repeated DatabaseInfo Databases = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message NodeInfo {
|
|
|
|
required uint64 ID = 1;
|
|
|
|
required string Host = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message DatabaseInfo {
|
|
|
|
required string Name = 1;
|
|
|
|
required string DefaultRetentionPolicy = 2;
|
|
|
|
repeated RetentionPolicyInfo Polices = 3;
|
|
|
|
repeated ContinuousQueryInfo ContinuousQueries = 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
message RetentionPolicyInfo {
|
|
|
|
required string Name = 1;
|
|
|
|
required int64 Duration = 2;
|
|
|
|
required int64 ShardGroupDuration = 3;
|
|
|
|
required uint32 ReplicaN = 4;
|
|
|
|
repeated ShardGroupInfo ShardGroups = 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ShardGroupInfo {
|
|
|
|
required uint64 ID = 1;
|
|
|
|
required int64 StartTime = 2;
|
|
|
|
required int64 EndTime = 3;
|
|
|
|
repeated ShardInfo Shards = 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ShardInfo {
|
|
|
|
required uint64 ID = 1;
|
|
|
|
required uint64 OwnerIDs = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ContinuousQueryInfo {
|
|
|
|
required string Query = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message User {
|
|
|
|
required string Name = 1;
|
|
|
|
required string Hash = 2;
|
|
|
|
required bool Admin = 3;
|
|
|
|
repeated UserPrivilege Privileges = 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
message UserPrivilege {
|
|
|
|
required string Database = 1;
|
|
|
|
required int32 Privilege = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//========================================================================
|
|
|
|
//
|
|
|
|
// COMMANDS
|
|
|
|
//
|
|
|
|
//========================================================================
|
|
|
|
|
|
|
|
message Command {
|
|
|
|
extensions 100 to max;
|
|
|
|
|
|
|
|
enum Type {
|
2015-05-21 20:06:01 +00:00
|
|
|
CreateNodeCommand = 1;
|
|
|
|
DeleteNodeCommand = 2;
|
|
|
|
CreateDatabaseCommand = 3;
|
|
|
|
DropDatabaseCommand = 4;
|
|
|
|
CreateRetentionPolicyCommand = 5;
|
|
|
|
DropRetentionPolicyCommand = 6;
|
|
|
|
SetDefaultRetentionPolicyCommand = 7;
|
|
|
|
UpdateRetentionPolicyCommand = 8;
|
|
|
|
CreateShardGroupCommand = 9;
|
|
|
|
DeleteShardGroupCommand = 10;
|
|
|
|
CreateContinuousQueryCommand = 11;
|
|
|
|
DropContinuousQueryCommand = 12;
|
|
|
|
CreateUserCommand = 13;
|
|
|
|
DropUserCommand = 14;
|
|
|
|
UpdateUserCommand = 15;
|
|
|
|
SetPrivilegeCommand = 16;
|
2015-05-08 17:51:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
required Type type = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message CreateNodeCommand {
|
|
|
|
extend Command {
|
2015-05-21 20:06:01 +00:00
|
|
|
optional CreateNodeCommand command = 101;
|
2015-05-08 17:51:50 +00:00
|
|
|
}
|
|
|
|
required string Host = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message DeleteNodeCommand {
|
|
|
|
extend Command {
|
2015-05-21 20:06:01 +00:00
|
|
|
optional DeleteNodeCommand command = 102;
|
2015-05-08 17:51:50 +00:00
|
|
|
}
|
2015-05-21 20:06:01 +00:00
|
|
|
required uint64 ID = 1;
|
2015-05-08 17:51:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message CreateDatabaseCommand {
|
|
|
|
extend Command {
|
2015-05-21 20:06:01 +00:00
|
|
|
optional CreateDatabaseCommand command = 103;
|
2015-05-08 17:51:50 +00:00
|
|
|
}
|
|
|
|
required string Name = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message DropDatabaseCommand {
|
|
|
|
extend Command {
|
2015-05-21 20:06:01 +00:00
|
|
|
optional DropDatabaseCommand command = 104;
|
2015-05-08 17:51:50 +00:00
|
|
|
}
|
|
|
|
required string Name = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message CreateRetentionPolicyCommand {
|
|
|
|
extend Command {
|
2015-05-21 20:06:01 +00:00
|
|
|
optional CreateRetentionPolicyCommand command = 105;
|
2015-05-08 17:51:50 +00:00
|
|
|
}
|
|
|
|
required string Database = 1;
|
|
|
|
required RetentionPolicyInfo RetentionPolicy = 2;
|
|
|
|
}
|
|
|
|
|
2015-05-21 20:06:01 +00:00
|
|
|
message DropRetentionPolicyCommand {
|
2015-05-08 17:51:50 +00:00
|
|
|
extend Command {
|
2015-05-21 20:06:01 +00:00
|
|
|
optional DropRetentionPolicyCommand command = 106;
|
2015-05-08 17:51:50 +00:00
|
|
|
}
|
|
|
|
required string Database = 1;
|
|
|
|
required string Name = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message SetDefaultRetentionPolicyCommand {
|
|
|
|
extend Command {
|
2015-05-21 20:06:01 +00:00
|
|
|
optional SetDefaultRetentionPolicyCommand command = 107;
|
2015-05-08 17:51:50 +00:00
|
|
|
}
|
|
|
|
required string Database = 1;
|
|
|
|
required string Name = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message UpdateRetentionPolicyCommand {
|
|
|
|
extend Command {
|
2015-05-21 20:06:01 +00:00
|
|
|
optional UpdateRetentionPolicyCommand command = 108;
|
2015-05-08 17:51:50 +00:00
|
|
|
}
|
|
|
|
required string Database = 1;
|
|
|
|
required string Name = 2;
|
|
|
|
optional string NewName = 3;
|
|
|
|
optional int64 Duration = 4;
|
|
|
|
optional uint32 ReplicaN = 5;
|
|
|
|
}
|
|
|
|
|
2015-05-21 20:06:01 +00:00
|
|
|
message CreateShardGroupCommand {
|
2015-05-08 17:51:50 +00:00
|
|
|
extend Command {
|
2015-05-21 20:06:01 +00:00
|
|
|
optional CreateShardGroupCommand command = 109;
|
2015-05-08 17:51:50 +00:00
|
|
|
}
|
|
|
|
required string Database = 1;
|
|
|
|
required string Policy = 2;
|
|
|
|
required int64 Timestamp = 3;
|
|
|
|
}
|
|
|
|
|
2015-05-21 20:06:01 +00:00
|
|
|
message DeleteShardGroupCommand {
|
|
|
|
extend Command {
|
|
|
|
optional DeleteShardGroupCommand command = 110;
|
|
|
|
}
|
|
|
|
required string Database = 1;
|
|
|
|
required string Policy = 2;
|
|
|
|
required uint64 ShardGroupID = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message CreateContinuousQueryCommand {
|
|
|
|
extend Command {
|
|
|
|
optional CreateContinuousQueryCommand command = 111;
|
|
|
|
}
|
2015-05-28 04:06:09 +00:00
|
|
|
required string Database = 1;
|
|
|
|
required string Name = 2;
|
|
|
|
required string Query = 3;
|
2015-05-21 20:06:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message DropContinuousQueryCommand {
|
|
|
|
extend Command {
|
|
|
|
optional DropContinuousQueryCommand command = 112;
|
|
|
|
}
|
2015-05-28 04:06:09 +00:00
|
|
|
required string Database = 1;
|
|
|
|
required string Name = 2;
|
2015-05-21 20:06:01 +00:00
|
|
|
}
|
|
|
|
|
2015-05-08 17:51:50 +00:00
|
|
|
message CreateUserCommand {
|
|
|
|
extend Command {
|
2015-05-21 20:06:01 +00:00
|
|
|
optional CreateUserCommand command = 113;
|
2015-05-08 17:51:50 +00:00
|
|
|
}
|
2015-05-21 20:06:01 +00:00
|
|
|
required string Name = 1;
|
|
|
|
required string Hash = 2;
|
2015-05-08 17:51:50 +00:00
|
|
|
required bool Admin = 3;
|
|
|
|
}
|
|
|
|
|
2015-05-21 20:06:01 +00:00
|
|
|
message DropUserCommand {
|
2015-05-08 17:51:50 +00:00
|
|
|
extend Command {
|
2015-05-21 20:06:01 +00:00
|
|
|
optional DropUserCommand command = 114;
|
2015-05-08 17:51:50 +00:00
|
|
|
}
|
2015-05-21 20:06:01 +00:00
|
|
|
required string Name = 1;
|
2015-05-08 17:51:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message UpdateUserCommand {
|
|
|
|
extend Command {
|
2015-05-21 20:06:01 +00:00
|
|
|
optional UpdateUserCommand command = 115;
|
2015-05-08 17:51:50 +00:00
|
|
|
}
|
2015-05-21 20:06:01 +00:00
|
|
|
required string Name = 1;
|
|
|
|
required string Hash = 2;
|
2015-05-08 17:51:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message SetPrivilegeCommand {
|
|
|
|
extend Command {
|
2015-05-21 20:06:01 +00:00
|
|
|
optional SetPrivilegeCommand command = 116;
|
2015-05-08 17:51:50 +00:00
|
|
|
}
|
|
|
|
required string Username = 1;
|
2015-05-27 19:41:58 +00:00
|
|
|
required string Database = 2;
|
|
|
|
required int32 Privilege = 3;
|
2015-05-08 17:51:50 +00:00
|
|
|
}
|
|
|
|
|