-
Notifications
You must be signed in to change notification settings - Fork 653
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add 4 commands json file and update most test cases
Signed-off-by: hwware <wen.hui.ware@gmail.com>
- Loading branch information
Showing
19 changed files
with
311 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"GET-PRIMARY-ADDR-BY-NAME": { | ||
"summary": "Returns the port and address of a primary instance.", | ||
"complexity": "O(1)", | ||
"group": "sentinel", | ||
"since": "8.0.0", | ||
"arity": 3, | ||
"container": "SENTINEL", | ||
"function": "sentinelCommand", | ||
"command_flags": [ | ||
"ADMIN", | ||
"SENTINEL", | ||
"ONLY_SENTINEL" | ||
], | ||
"reply_schema": { | ||
"type": "array", | ||
"minItems": 2, | ||
"maxItems": 2, | ||
"items": [ | ||
{ | ||
"type": "string", | ||
"description": "IP addr or hostname." | ||
}, | ||
{ | ||
"type": "string", | ||
"description": "Port.", | ||
"pattern": "[0-9]+" | ||
} | ||
] | ||
}, | ||
"arguments": [ | ||
{ | ||
"name": "primary-name", | ||
"type": "string" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{ | ||
"IS-PRIMARY-DOWN-BY-ADDR": { | ||
"summary": "Determines whether a primary instance is down.", | ||
"complexity": "O(1)", | ||
"group": "sentinel", | ||
"since": "8.0.0", | ||
"arity": 6, | ||
"container": "SENTINEL", | ||
"function": "sentinelCommand", | ||
"command_flags": [ | ||
"ADMIN", | ||
"SENTINEL", | ||
"ONLY_SENTINEL" | ||
], | ||
"reply_schema": { | ||
"type": "array", | ||
"minItems": 3, | ||
"maxItems": 3, | ||
"items": [ | ||
{ | ||
"oneOf": [ | ||
{ | ||
"const": 0, | ||
"description": "Primary is up." | ||
}, | ||
{ | ||
"const": 1, | ||
"description": "Primary is down." | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "string", | ||
"description": "Sentinel address." | ||
}, | ||
{ | ||
"type": "integer", | ||
"description": "Port." | ||
} | ||
] | ||
}, | ||
"arguments": [ | ||
{ | ||
"name": "ip", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "port", | ||
"type": "integer" | ||
}, | ||
{ | ||
"name": "current-epoch", | ||
"type": "integer" | ||
}, | ||
{ | ||
"name": "runid", | ||
"type": "string" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"PRIMARIES": { | ||
"summary": "Returns a list of monitored primaries.", | ||
"complexity": "O(N) where N is the number of primaries", | ||
"group": "sentinel", | ||
"since": "8.0.0", | ||
"arity": 2, | ||
"container": "SENTINEL", | ||
"function": "sentinelCommand", | ||
"command_flags": [ | ||
"ADMIN", | ||
"SENTINEL", | ||
"ONLY_SENTINEL" | ||
], | ||
"reply_schema": { | ||
"type": "array", | ||
"description": "List of monitored primaries, and their states.", | ||
"items": { | ||
"type": "object", | ||
"additionalProperties": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"PRIMARY": { | ||
"summary": "Returns the state of a primary instance.", | ||
"complexity": "O(1)", | ||
"group": "sentinel", | ||
"since": "8.0.0", | ||
"arity": 3, | ||
"container": "SENTINEL", | ||
"function": "sentinelCommand", | ||
"command_flags": [ | ||
"ADMIN", | ||
"SENTINEL", | ||
"ONLY_SENTINEL" | ||
], | ||
"reply_schema": { | ||
"type": "object", | ||
"description": "The state and info of the specified primary.", | ||
"additionalProperties": { | ||
"type": "string" | ||
} | ||
}, | ||
"arguments": [ | ||
{ | ||
"name": "primary-name", | ||
"type": "string" | ||
} | ||
] | ||
} | ||
} |
Oops, something went wrong.