summaryrefslogtreecommitdiffstats
path: root/src/commands/role.json
blob: a0299fa73e30951d3c664f7fff024564dbae37b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
{
    "ROLE": {
        "summary": "Returns the replication role.",
        "complexity": "O(1)",
        "group": "server",
        "since": "2.8.12",
        "arity": 1,
        "function": "roleCommand",
        "command_flags": [
            "NOSCRIPT",
            "LOADING",
            "STALE",
            "FAST",
            "SENTINEL"
        ],
        "acl_categories": [
            "ADMIN",
            "DANGEROUS"
        ],
        "reply_schema": {
            "oneOf": [
                {
                    "type": "array",
                    "minItems": 3,
                    "maxItems": 3,
                    "items": [
                        {
                            "const": "master"
                        },
                        {
                            "description": "current replication master offset",
                            "type": "integer"
                        },
                        {
                            "description": "connected replicas",
                            "type": "array",
                            "items": {
                                "type": "array",
                                "minItems": 3,
                                "maxItems": 3,
                                "items": [
                                    {
                                        "description": "replica ip",
                                        "type": "string"
                                    },
                                    {
                                        "description": "replica port",
                                        "type": "string"
                                    },
                                    {
                                        "description": "last acknowledged replication offset",
                                        "type": "string"
                                    }
                                ]
                            }
                        }
                    ]
                },
                {
                    "type": "array",
                    "minItems": 5,
                    "maxItems": 5,
                    "items": [
                        {
                            "const": "slave"
                        },
                        {
                            "description": "ip of master",
                            "type": "string"
                        },
                        {
                            "description": "port number of master",
                            "type": "integer"
                        },
                        {
                            "description": "state of the replication from the point of view of the master",
                            "oneOf": [
                                {
                                    "description": "the instance is in handshake with its master",
                                    "const": "handshake"
                                },
                                {
                                    "description": "the instance in not active",
                                    "const": "none"
                                },
                                {
                                    "description": "the instance needs to connect to its master",
                                    "const": "connect"
                                },
                                {
                                    "description": "the master-replica connection is in progress",
                                    "const": "connecting"
                                },
                                {
                                    "description": "the master and replica are trying to perform the synchronization",
                                    "const": "sync"
                                },
                                {
                                    "description": "the replica is online",
                                    "const": "connected"
                                },
                                {
                                    "description": "instance state is unknown",
                                    "const": "unknown"
                                }
                            ]
                        },
                        {
                            "description": "the amount of data received from the replica so far in terms of master replication offset",
                            "type": "integer"
                        }
                    ]
                },
                {
                    "type": "array",
                    "minItems": 2,
                    "maxItems": 2,
                    "items": [
                        {
                            "const": "sentinel"
                        },
                        {
                            "description": "list of master names monitored by this sentinel instance",
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    ]
                }
            ]
        }
    }
}