diff --git a/etcd-v3.5.9-linux-amd64.tar.gz b/etcd-v3.5.9-linux-amd64.tar.gz new file mode 100644 index 00000000..e88f3bb6 Binary files /dev/null and b/etcd-v3.5.9-linux-amd64.tar.gz differ diff --git a/etcd-v3.5.9-linux-amd64/Documentation/README.md b/etcd-v3.5.9-linux-amd64/Documentation/README.md new file mode 100644 index 00000000..960e4601 --- /dev/null +++ b/etcd-v3.5.9-linux-amd64/Documentation/README.md @@ -0,0 +1,6 @@ +# The etcd documentation + +etcd is a distributed key-value store designed to reliably and quickly preserve and provide access to critical data. It enables reliable distributed coordination through distributed locking, leader elections, and write barriers. An etcd cluster is intended for high availability and permanent data storage and retrieval. + +These documents have moved to the [etcd-io/website repo](https://github.com/etcd-io/website/), and can be viewed live at [https://etcd.io/docs/latest/](https://etcd.io/docs/latest/). + diff --git a/etcd-v3.5.9-linux-amd64/Documentation/dev-guide/apispec/swagger/rpc.swagger.json b/etcd-v3.5.9-linux-amd64/Documentation/dev-guide/apispec/swagger/rpc.swagger.json new file mode 100644 index 00000000..b873790f --- /dev/null +++ b/etcd-v3.5.9-linux-amd64/Documentation/dev-guide/apispec/swagger/rpc.swagger.json @@ -0,0 +1,3064 @@ +{ + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "swagger": "2.0", + "info": { + "title": "api/etcdserverpb/rpc.proto", + "version": "version not set" + }, + "paths": { + "/v3/auth/authenticate": { + "post": { + "tags": [ + "Auth" + ], + "summary": "Authenticate processes an authenticate request.", + "operationId": "Auth_Authenticate", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbAuthenticateRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbAuthenticateResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/auth/disable": { + "post": { + "tags": [ + "Auth" + ], + "summary": "AuthDisable disables authentication.", + "operationId": "Auth_AuthDisable", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbAuthDisableRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbAuthDisableResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/auth/enable": { + "post": { + "tags": [ + "Auth" + ], + "summary": "AuthEnable enables authentication.", + "operationId": "Auth_AuthEnable", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbAuthEnableRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbAuthEnableResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/auth/role/add": { + "post": { + "tags": [ + "Auth" + ], + "summary": "RoleAdd adds a new role. Role name cannot be empty.", + "operationId": "Auth_RoleAdd", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbAuthRoleAddRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbAuthRoleAddResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/auth/role/delete": { + "post": { + "tags": [ + "Auth" + ], + "summary": "RoleDelete deletes a specified role.", + "operationId": "Auth_RoleDelete", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbAuthRoleDeleteRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbAuthRoleDeleteResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/auth/role/get": { + "post": { + "tags": [ + "Auth" + ], + "summary": "RoleGet gets detailed role information.", + "operationId": "Auth_RoleGet", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbAuthRoleGetRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbAuthRoleGetResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/auth/role/grant": { + "post": { + "tags": [ + "Auth" + ], + "summary": "RoleGrantPermission grants a permission of a specified key or range to a specified role.", + "operationId": "Auth_RoleGrantPermission", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbAuthRoleGrantPermissionRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbAuthRoleGrantPermissionResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/auth/role/list": { + "post": { + "tags": [ + "Auth" + ], + "summary": "RoleList gets lists of all roles.", + "operationId": "Auth_RoleList", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbAuthRoleListRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbAuthRoleListResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/auth/role/revoke": { + "post": { + "tags": [ + "Auth" + ], + "summary": "RoleRevokePermission revokes a key or range permission of a specified role.", + "operationId": "Auth_RoleRevokePermission", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbAuthRoleRevokePermissionRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbAuthRoleRevokePermissionResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/auth/status": { + "post": { + "tags": [ + "Auth" + ], + "summary": "AuthStatus displays authentication status.", + "operationId": "Auth_AuthStatus", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbAuthStatusRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbAuthStatusResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/auth/user/add": { + "post": { + "tags": [ + "Auth" + ], + "summary": "UserAdd adds a new user. User name cannot be empty.", + "operationId": "Auth_UserAdd", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbAuthUserAddRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbAuthUserAddResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/auth/user/changepw": { + "post": { + "tags": [ + "Auth" + ], + "summary": "UserChangePassword changes the password of a specified user.", + "operationId": "Auth_UserChangePassword", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbAuthUserChangePasswordRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbAuthUserChangePasswordResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/auth/user/delete": { + "post": { + "tags": [ + "Auth" + ], + "summary": "UserDelete deletes a specified user.", + "operationId": "Auth_UserDelete", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbAuthUserDeleteRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbAuthUserDeleteResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/auth/user/get": { + "post": { + "tags": [ + "Auth" + ], + "summary": "UserGet gets detailed user information.", + "operationId": "Auth_UserGet", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbAuthUserGetRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbAuthUserGetResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/auth/user/grant": { + "post": { + "tags": [ + "Auth" + ], + "summary": "UserGrant grants a role to a specified user.", + "operationId": "Auth_UserGrantRole", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbAuthUserGrantRoleRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbAuthUserGrantRoleResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/auth/user/list": { + "post": { + "tags": [ + "Auth" + ], + "summary": "UserList gets a list of all users.", + "operationId": "Auth_UserList", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbAuthUserListRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbAuthUserListResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/auth/user/revoke": { + "post": { + "tags": [ + "Auth" + ], + "summary": "UserRevokeRole revokes a role of specified user.", + "operationId": "Auth_UserRevokeRole", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbAuthUserRevokeRoleRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbAuthUserRevokeRoleResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/cluster/member/add": { + "post": { + "tags": [ + "Cluster" + ], + "summary": "MemberAdd adds a member into the cluster.", + "operationId": "Cluster_MemberAdd", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbMemberAddRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbMemberAddResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/cluster/member/list": { + "post": { + "tags": [ + "Cluster" + ], + "summary": "MemberList lists all the members in the cluster.", + "operationId": "Cluster_MemberList", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbMemberListRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbMemberListResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/cluster/member/promote": { + "post": { + "tags": [ + "Cluster" + ], + "summary": "MemberPromote promotes a member from raft learner (non-voting) to raft voting member.", + "operationId": "Cluster_MemberPromote", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbMemberPromoteRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbMemberPromoteResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/cluster/member/remove": { + "post": { + "tags": [ + "Cluster" + ], + "summary": "MemberRemove removes an existing member from the cluster.", + "operationId": "Cluster_MemberRemove", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbMemberRemoveRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbMemberRemoveResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/cluster/member/update": { + "post": { + "tags": [ + "Cluster" + ], + "summary": "MemberUpdate updates the member configuration.", + "operationId": "Cluster_MemberUpdate", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbMemberUpdateRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbMemberUpdateResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/kv/compaction": { + "post": { + "tags": [ + "KV" + ], + "summary": "Compact compacts the event history in the etcd key-value store. The key-value\nstore should be periodically compacted or the event history will continue to grow\nindefinitely.", + "operationId": "KV_Compact", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbCompactionRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbCompactionResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/kv/deleterange": { + "post": { + "tags": [ + "KV" + ], + "summary": "DeleteRange deletes the given range from the key-value store.\nA delete request increments the revision of the key-value store\nand generates a delete event in the event history for every deleted key.", + "operationId": "KV_DeleteRange", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbDeleteRangeRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbDeleteRangeResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/kv/lease/leases": { + "post": { + "tags": [ + "Lease" + ], + "summary": "LeaseLeases lists all existing leases.", + "operationId": "Lease_LeaseLeases2", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbLeaseLeasesRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbLeaseLeasesResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/kv/lease/revoke": { + "post": { + "tags": [ + "Lease" + ], + "summary": "LeaseRevoke revokes a lease. All keys attached to the lease will expire and be deleted.", + "operationId": "Lease_LeaseRevoke2", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbLeaseRevokeRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbLeaseRevokeResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/kv/lease/timetolive": { + "post": { + "tags": [ + "Lease" + ], + "summary": "LeaseTimeToLive retrieves lease information.", + "operationId": "Lease_LeaseTimeToLive2", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbLeaseTimeToLiveRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbLeaseTimeToLiveResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/kv/put": { + "post": { + "tags": [ + "KV" + ], + "summary": "Put puts the given key into the key-value store.\nA put request increments the revision of the key-value store\nand generates one event in the event history.", + "operationId": "KV_Put", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbPutRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbPutResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/kv/range": { + "post": { + "tags": [ + "KV" + ], + "summary": "Range gets the keys in the range from the key-value store.", + "operationId": "KV_Range", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbRangeRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbRangeResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/kv/txn": { + "post": { + "tags": [ + "KV" + ], + "summary": "Txn processes multiple requests in a single transaction.\nA txn request increments the revision of the key-value store\nand generates events with the same revision for every completed request.\nIt is not allowed to modify the same key several times within one txn.", + "operationId": "KV_Txn", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbTxnRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbTxnResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/lease/grant": { + "post": { + "tags": [ + "Lease" + ], + "summary": "LeaseGrant creates a lease which expires if the server does not receive a keepAlive\nwithin a given time to live period. All keys attached to the lease will be expired and\ndeleted if the lease expires. Each expired key generates a delete event in the event history.", + "operationId": "Lease_LeaseGrant", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbLeaseGrantRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbLeaseGrantResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/lease/keepalive": { + "post": { + "tags": [ + "Lease" + ], + "summary": "LeaseKeepAlive keeps the lease alive by streaming keep alive requests from the client\nto the server and streaming keep alive responses from the server to the client.", + "operationId": "Lease_LeaseKeepAlive", + "parameters": [ + { + "description": " (streaming inputs)", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbLeaseKeepAliveRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.(streaming responses)", + "schema": { + "type": "object", + "title": "Stream result of etcdserverpbLeaseKeepAliveResponse", + "properties": { + "error": { + "$ref": "#/definitions/runtimeStreamError" + }, + "result": { + "$ref": "#/definitions/etcdserverpbLeaseKeepAliveResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/lease/leases": { + "post": { + "tags": [ + "Lease" + ], + "summary": "LeaseLeases lists all existing leases.", + "operationId": "Lease_LeaseLeases", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbLeaseLeasesRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbLeaseLeasesResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/lease/revoke": { + "post": { + "tags": [ + "Lease" + ], + "summary": "LeaseRevoke revokes a lease. All keys attached to the lease will expire and be deleted.", + "operationId": "Lease_LeaseRevoke", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbLeaseRevokeRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbLeaseRevokeResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/lease/timetolive": { + "post": { + "tags": [ + "Lease" + ], + "summary": "LeaseTimeToLive retrieves lease information.", + "operationId": "Lease_LeaseTimeToLive", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbLeaseTimeToLiveRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbLeaseTimeToLiveResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/maintenance/alarm": { + "post": { + "tags": [ + "Maintenance" + ], + "summary": "Alarm activates, deactivates, and queries alarms regarding cluster health.", + "operationId": "Maintenance_Alarm", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbAlarmRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbAlarmResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/maintenance/defragment": { + "post": { + "tags": [ + "Maintenance" + ], + "summary": "Defragment defragments a member's backend database to recover storage space.", + "operationId": "Maintenance_Defragment", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbDefragmentRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbDefragmentResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/maintenance/downgrade": { + "post": { + "tags": [ + "Maintenance" + ], + "summary": "Downgrade requests downgrades, verifies feasibility or cancels downgrade\non the cluster version.\nSupported since etcd 3.5.", + "operationId": "Maintenance_Downgrade", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbDowngradeRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbDowngradeResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/maintenance/hash": { + "post": { + "tags": [ + "Maintenance" + ], + "summary": "HashKV computes the hash of all MVCC keys up to a given revision.\nIt only iterates \"key\" bucket in backend storage.", + "operationId": "Maintenance_HashKV", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbHashKVRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbHashKVResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/maintenance/snapshot": { + "post": { + "tags": [ + "Maintenance" + ], + "summary": "Snapshot sends a snapshot of the entire backend from a member over a stream to a client.", + "operationId": "Maintenance_Snapshot", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbSnapshotRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.(streaming responses)", + "schema": { + "type": "object", + "title": "Stream result of etcdserverpbSnapshotResponse", + "properties": { + "error": { + "$ref": "#/definitions/runtimeStreamError" + }, + "result": { + "$ref": "#/definitions/etcdserverpbSnapshotResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/maintenance/status": { + "post": { + "tags": [ + "Maintenance" + ], + "summary": "Status gets the status of the member.", + "operationId": "Maintenance_Status", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbStatusRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbStatusResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/maintenance/transfer-leadership": { + "post": { + "tags": [ + "Maintenance" + ], + "summary": "MoveLeader requests current leader node to transfer its leadership to transferee.", + "operationId": "Maintenance_MoveLeader", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbMoveLeaderRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbMoveLeaderResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/watch": { + "post": { + "tags": [ + "Watch" + ], + "summary": "Watch watches for events happening or that have happened. Both input and output\nare streams; the input stream is for creating and canceling watchers and the output\nstream sends events. One watch RPC can watch on multiple key ranges, streaming events\nfor several watches at once. The entire event history can be watched starting from the\nlast compaction revision.", + "operationId": "Watch_Watch", + "parameters": [ + { + "description": " (streaming inputs)", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbWatchRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.(streaming responses)", + "schema": { + "type": "object", + "title": "Stream result of etcdserverpbWatchResponse", + "properties": { + "error": { + "$ref": "#/definitions/runtimeStreamError" + }, + "result": { + "$ref": "#/definitions/etcdserverpbWatchResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + } + }, + "definitions": { + "AlarmRequestAlarmAction": { + "type": "string", + "default": "GET", + "enum": [ + "GET", + "ACTIVATE", + "DEACTIVATE" + ] + }, + "CompareCompareResult": { + "type": "string", + "default": "EQUAL", + "enum": [ + "EQUAL", + "GREATER", + "LESS", + "NOT_EQUAL" + ] + }, + "CompareCompareTarget": { + "type": "string", + "default": "VERSION", + "enum": [ + "VERSION", + "CREATE", + "MOD", + "VALUE", + "LEASE" + ] + }, + "DowngradeRequestDowngradeAction": { + "type": "string", + "default": "VALIDATE", + "enum": [ + "VALIDATE", + "ENABLE", + "CANCEL" + ] + }, + "EventEventType": { + "type": "string", + "default": "PUT", + "enum": [ + "PUT", + "DELETE" + ] + }, + "RangeRequestSortOrder": { + "type": "string", + "default": "NONE", + "enum": [ + "NONE", + "ASCEND", + "DESCEND" + ] + }, + "RangeRequestSortTarget": { + "type": "string", + "default": "KEY", + "enum": [ + "KEY", + "VERSION", + "CREATE", + "MOD", + "VALUE" + ] + }, + "WatchCreateRequestFilterType": { + "description": " - NOPUT: filter out put event.\n - NODELETE: filter out delete event.", + "type": "string", + "default": "NOPUT", + "enum": [ + "NOPUT", + "NODELETE" + ] + }, + "authpbPermission": { + "type": "object", + "title": "Permission is a single entity", + "properties": { + "key": { + "type": "string", + "format": "byte" + }, + "permType": { + "$ref": "#/definitions/authpbPermissionType" + }, + "range_end": { + "type": "string", + "format": "byte" + } + } + }, + "authpbPermissionType": { + "type": "string", + "default": "READ", + "enum": [ + "READ", + "WRITE", + "READWRITE" + ] + }, + "authpbUserAddOptions": { + "type": "object", + "properties": { + "no_password": { + "type": "boolean", + "format": "boolean" + } + } + }, + "etcdserverpbAlarmMember": { + "type": "object", + "properties": { + "alarm": { + "description": "alarm is the type of alarm which has been raised.", + "$ref": "#/definitions/etcdserverpbAlarmType" + }, + "memberID": { + "description": "memberID is the ID of the member associated with the raised alarm.", + "type": "string", + "format": "uint64" + } + } + }, + "etcdserverpbAlarmRequest": { + "type": "object", + "properties": { + "action": { + "description": "action is the kind of alarm request to issue. The action\nmay GET alarm statuses, ACTIVATE an alarm, or DEACTIVATE a\nraised alarm.", + "$ref": "#/definitions/AlarmRequestAlarmAction" + }, + "alarm": { + "description": "alarm is the type of alarm to consider for this request.", + "$ref": "#/definitions/etcdserverpbAlarmType" + }, + "memberID": { + "description": "memberID is the ID of the member associated with the alarm. If memberID is 0, the\nalarm request covers all members.", + "type": "string", + "format": "uint64" + } + } + }, + "etcdserverpbAlarmResponse": { + "type": "object", + "properties": { + "alarms": { + "description": "alarms is a list of alarms associated with the alarm request.", + "type": "array", + "items": { + "$ref": "#/definitions/etcdserverpbAlarmMember" + } + }, + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + } + } + }, + "etcdserverpbAlarmType": { + "type": "string", + "default": "NONE", + "enum": [ + "NONE", + "NOSPACE", + "CORRUPT" + ] + }, + "etcdserverpbAuthDisableRequest": { + "type": "object" + }, + "etcdserverpbAuthDisableResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + } + } + }, + "etcdserverpbAuthEnableRequest": { + "type": "object" + }, + "etcdserverpbAuthEnableResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + } + } + }, + "etcdserverpbAuthRoleAddRequest": { + "type": "object", + "properties": { + "name": { + "description": "name is the name of the role to add to the authentication system.", + "type": "string" + } + } + }, + "etcdserverpbAuthRoleAddResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + } + } + }, + "etcdserverpbAuthRoleDeleteRequest": { + "type": "object", + "properties": { + "role": { + "type": "string" + } + } + }, + "etcdserverpbAuthRoleDeleteResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + } + } + }, + "etcdserverpbAuthRoleGetRequest": { + "type": "object", + "properties": { + "role": { + "type": "string" + } + } + }, + "etcdserverpbAuthRoleGetResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + }, + "perm": { + "type": "array", + "items": { + "$ref": "#/definitions/authpbPermission" + } + } + } + }, + "etcdserverpbAuthRoleGrantPermissionRequest": { + "type": "object", + "properties": { + "name": { + "description": "name is the name of the role which will be granted the permission.", + "type": "string" + }, + "perm": { + "description": "perm is the permission to grant to the role.", + "$ref": "#/definitions/authpbPermission" + } + } + }, + "etcdserverpbAuthRoleGrantPermissionResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + } + } + }, + "etcdserverpbAuthRoleListRequest": { + "type": "object" + }, + "etcdserverpbAuthRoleListResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + }, + "roles": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "etcdserverpbAuthRoleRevokePermissionRequest": { + "type": "object", + "properties": { + "key": { + "type": "string", + "format": "byte" + }, + "range_end": { + "type": "string", + "format": "byte" + }, + "role": { + "type": "string" + } + } + }, + "etcdserverpbAuthRoleRevokePermissionResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + } + } + }, + "etcdserverpbAuthStatusRequest": { + "type": "object" + }, + "etcdserverpbAuthStatusResponse": { + "type": "object", + "properties": { + "authRevision": { + "type": "string", + "format": "uint64", + "title": "authRevision is the current revision of auth store" + }, + "enabled": { + "type": "boolean", + "format": "boolean" + }, + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + } + } + }, + "etcdserverpbAuthUserAddRequest": { + "type": "object", + "properties": { + "hashedPassword": { + "type": "string" + }, + "name": { + "type": "string" + }, + "options": { + "$ref": "#/definitions/authpbUserAddOptions" + }, + "password": { + "type": "string" + } + } + }, + "etcdserverpbAuthUserAddResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + } + } + }, + "etcdserverpbAuthUserChangePasswordRequest": { + "type": "object", + "properties": { + "hashedPassword": { + "description": "hashedPassword is the new password for the user. Note that this field will be initialized in the API layer.", + "type": "string" + }, + "name": { + "description": "name is the name of the user whose password is being changed.", + "type": "string" + }, + "password": { + "description": "password is the new password for the user. Note that this field will be removed in the API layer.", + "type": "string" + } + } + }, + "etcdserverpbAuthUserChangePasswordResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + } + } + }, + "etcdserverpbAuthUserDeleteRequest": { + "type": "object", + "properties": { + "name": { + "description": "name is the name of the user to delete.", + "type": "string" + } + } + }, + "etcdserverpbAuthUserDeleteResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + } + } + }, + "etcdserverpbAuthUserGetRequest": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + }, + "etcdserverpbAuthUserGetResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + }, + "roles": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "etcdserverpbAuthUserGrantRoleRequest": { + "type": "object", + "properties": { + "role": { + "description": "role is the name of the role to grant to the user.", + "type": "string" + }, + "user": { + "description": "user is the name of the user which should be granted a given role.", + "type": "string" + } + } + }, + "etcdserverpbAuthUserGrantRoleResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + } + } + }, + "etcdserverpbAuthUserListRequest": { + "type": "object" + }, + "etcdserverpbAuthUserListResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + }, + "users": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "etcdserverpbAuthUserRevokeRoleRequest": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "role": { + "type": "string" + } + } + }, + "etcdserverpbAuthUserRevokeRoleResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + } + } + }, + "etcdserverpbAuthenticateRequest": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "password": { + "type": "string" + } + } + }, + "etcdserverpbAuthenticateResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + }, + "token": { + "type": "string", + "title": "token is an authorized token that can be used in succeeding RPCs" + } + } + }, + "etcdserverpbCompactionRequest": { + "description": "CompactionRequest compacts the key-value store up to a given revision. All superseded keys\nwith a revision less than the compaction revision will be removed.", + "type": "object", + "properties": { + "physical": { + "description": "physical is set so the RPC will wait until the compaction is physically\napplied to the local database such that compacted entries are totally\nremoved from the backend database.", + "type": "boolean", + "format": "boolean" + }, + "revision": { + "description": "revision is the key-value store revision for the compaction operation.", + "type": "string", + "format": "int64" + } + } + }, + "etcdserverpbCompactionResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + } + } + }, + "etcdserverpbCompare": { + "type": "object", + "properties": { + "create_revision": { + "type": "string", + "format": "int64", + "title": "create_revision is the creation revision of the given key" + }, + "key": { + "description": "key is the subject key for the comparison operation.", + "type": "string", + "format": "byte" + }, + "lease": { + "description": "lease is the lease id of the given key.", + "type": "string", + "format": "int64" + }, + "mod_revision": { + "description": "mod_revision is the last modified revision of the given key.", + "type": "string", + "format": "int64" + }, + "range_end": { + "description": "range_end compares the given target to all keys in the range [key, range_end).\nSee RangeRequest for more details on key ranges.", + "type": "string", + "format": "byte" + }, + "result": { + "description": "result is logical comparison operation for this comparison.", + "$ref": "#/definitions/CompareCompareResult" + }, + "target": { + "description": "target is the key-value field to inspect for the comparison.", + "$ref": "#/definitions/CompareCompareTarget" + }, + "value": { + "description": "value is the value of the given key, in bytes.", + "type": "string", + "format": "byte" + }, + "version": { + "type": "string", + "format": "int64", + "title": "version is the version of the given key" + } + } + }, + "etcdserverpbDefragmentRequest": { + "type": "object" + }, + "etcdserverpbDefragmentResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + } + } + }, + "etcdserverpbDeleteRangeRequest": { + "type": "object", + "properties": { + "key": { + "description": "key is the first key to delete in the range.", + "type": "string", + "format": "byte" + }, + "prev_kv": { + "description": "If prev_kv is set, etcd gets the previous key-value pairs before deleting it.\nThe previous key-value pairs will be returned in the delete response.", + "type": "boolean", + "format": "boolean" + }, + "range_end": { + "description": "range_end is the key following the last key to delete for the range [key, range_end).\nIf range_end is not given, the range is defined to contain only the key argument.\nIf range_end is one bit larger than the given key, then the range is all the keys\nwith the prefix (the given key).\nIf range_end is '\\0', the range is all keys greater than or equal to the key argument.", + "type": "string", + "format": "byte" + } + } + }, + "etcdserverpbDeleteRangeResponse": { + "type": "object", + "properties": { + "deleted": { + "description": "deleted is the number of keys deleted by the delete range request.", + "type": "string", + "format": "int64" + }, + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + }, + "prev_kvs": { + "description": "if prev_kv is set in the request, the previous key-value pairs will be returned.", + "type": "array", + "items": { + "$ref": "#/definitions/mvccpbKeyValue" + } + } + } + }, + "etcdserverpbDowngradeRequest": { + "type": "object", + "properties": { + "action": { + "description": "action is the kind of downgrade request to issue. The action may\nVALIDATE the target version, DOWNGRADE the cluster version,\nor CANCEL the current downgrading job.", + "$ref": "#/definitions/DowngradeRequestDowngradeAction" + }, + "version": { + "description": "version is the target version to downgrade.", + "type": "string" + } + } + }, + "etcdserverpbDowngradeResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + }, + "version": { + "description": "version is the current cluster version.", + "type": "string" + } + } + }, + "etcdserverpbHashKVRequest": { + "type": "object", + "properties": { + "revision": { + "description": "revision is the key-value store revision for the hash operation.", + "type": "string", + "format": "int64" + } + } + }, + "etcdserverpbHashKVResponse": { + "type": "object", + "properties": { + "compact_revision": { + "description": "compact_revision is the compacted revision of key-value store when hash begins.", + "type": "string", + "format": "int64" + }, + "hash": { + "description": "hash is the hash value computed from the responding member's MVCC keys up to a given revision.", + "type": "integer", + "format": "int64" + }, + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + } + } + }, + "etcdserverpbHashRequest": { + "type": "object" + }, + "etcdserverpbHashResponse": { + "type": "object", + "properties": { + "hash": { + "description": "hash is the hash value computed from the responding member's KV's backend.", + "type": "integer", + "format": "int64" + }, + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + } + } + }, + "etcdserverpbLeaseGrantRequest": { + "type": "object", + "properties": { + "ID": { + "description": "ID is the requested ID for the lease. If ID is set to 0, the lessor chooses an ID.", + "type": "string", + "format": "int64" + }, + "TTL": { + "description": "TTL is the advisory time-to-live in seconds. Expired lease will return -1.", + "type": "string", + "format": "int64" + } + } + }, + "etcdserverpbLeaseGrantResponse": { + "type": "object", + "properties": { + "ID": { + "description": "ID is the lease ID for the granted lease.", + "type": "string", + "format": "int64" + }, + "TTL": { + "description": "TTL is the server chosen lease time-to-live in seconds.", + "type": "string", + "format": "int64" + }, + "error": { + "type": "string" + }, + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + } + } + }, + "etcdserverpbLeaseKeepAliveRequest": { + "type": "object", + "properties": { + "ID": { + "description": "ID is the lease ID for the lease to keep alive.", + "type": "string", + "format": "int64" + } + } + }, + "etcdserverpbLeaseKeepAliveResponse": { + "type": "object", + "properties": { + "ID": { + "description": "ID is the lease ID from the keep alive request.", + "type": "string", + "format": "int64" + }, + "TTL": { + "description": "TTL is the new time-to-live for the lease.", + "type": "string", + "format": "int64" + }, + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + } + } + }, + "etcdserverpbLeaseLeasesRequest": { + "type": "object" + }, + "etcdserverpbLeaseLeasesResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + }, + "leases": { + "type": "array", + "items": { + "$ref": "#/definitions/etcdserverpbLeaseStatus" + } + } + } + }, + "etcdserverpbLeaseRevokeRequest": { + "type": "object", + "properties": { + "ID": { + "description": "ID is the lease ID to revoke. When the ID is revoked, all associated keys will be deleted.", + "type": "string", + "format": "int64" + } + } + }, + "etcdserverpbLeaseRevokeResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + } + } + }, + "etcdserverpbLeaseStatus": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "format": "int64" + } + } + }, + "etcdserverpbLeaseTimeToLiveRequest": { + "type": "object", + "properties": { + "ID": { + "description": "ID is the lease ID for the lease.", + "type": "string", + "format": "int64" + }, + "keys": { + "description": "keys is true to query all the keys attached to this lease.", + "type": "boolean", + "format": "boolean" + } + } + }, + "etcdserverpbLeaseTimeToLiveResponse": { + "type": "object", + "properties": { + "ID": { + "description": "ID is the lease ID from the keep alive request.", + "type": "string", + "format": "int64" + }, + "TTL": { + "description": "TTL is the remaining TTL in seconds for the lease; the lease will expire in under TTL+1 seconds.", + "type": "string", + "format": "int64" + }, + "grantedTTL": { + "description": "GrantedTTL is the initial granted time in seconds upon lease creation/renewal.", + "type": "string", + "format": "int64" + }, + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + }, + "keys": { + "description": "Keys is the list of keys attached to this lease.", + "type": "array", + "items": { + "type": "string", + "format": "byte" + } + } + } + }, + "etcdserverpbMember": { + "type": "object", + "properties": { + "ID": { + "description": "ID is the member ID for this member.", + "type": "string", + "format": "uint64" + }, + "clientURLs": { + "description": "clientURLs is the list of URLs the member exposes to clients for communication. If the member is not started, clientURLs will be empty.", + "type": "array", + "items": { + "type": "string" + } + }, + "isLearner": { + "description": "isLearner indicates if the member is raft learner.", + "type": "boolean", + "format": "boolean" + }, + "name": { + "description": "name is the human-readable name of the member. If the member is not started, the name will be an empty string.", + "type": "string" + }, + "peerURLs": { + "description": "peerURLs is the list of URLs the member exposes to the cluster for communication.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "etcdserverpbMemberAddRequest": { + "type": "object", + "properties": { + "isLearner": { + "description": "isLearner indicates if the added member is raft learner.", + "type": "boolean", + "format": "boolean" + }, + "peerURLs": { + "description": "peerURLs is the list of URLs the added member will use to communicate with the cluster.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "etcdserverpbMemberAddResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + }, + "member": { + "description": "member is the member information for the added member.", + "$ref": "#/definitions/etcdserverpbMember" + }, + "members": { + "description": "members is a list of all members after adding the new member.", + "type": "array", + "items": { + "$ref": "#/definitions/etcdserverpbMember" + } + } + } + }, + "etcdserverpbMemberListRequest": { + "type": "object", + "properties": { + "linearizable": { + "type": "boolean", + "format": "boolean" + } + } + }, + "etcdserverpbMemberListResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + }, + "members": { + "description": "members is a list of all members associated with the cluster.", + "type": "array", + "items": { + "$ref": "#/definitions/etcdserverpbMember" + } + } + } + }, + "etcdserverpbMemberPromoteRequest": { + "type": "object", + "properties": { + "ID": { + "description": "ID is the member ID of the member to promote.", + "type": "string", + "format": "uint64" + } + } + }, + "etcdserverpbMemberPromoteResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + }, + "members": { + "description": "members is a list of all members after promoting the member.", + "type": "array", + "items": { + "$ref": "#/definitions/etcdserverpbMember" + } + } + } + }, + "etcdserverpbMemberRemoveRequest": { + "type": "object", + "properties": { + "ID": { + "description": "ID is the member ID of the member to remove.", + "type": "string", + "format": "uint64" + } + } + }, + "etcdserverpbMemberRemoveResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + }, + "members": { + "description": "members is a list of all members after removing the member.", + "type": "array", + "items": { + "$ref": "#/definitions/etcdserverpbMember" + } + } + } + }, + "etcdserverpbMemberUpdateRequest": { + "type": "object", + "properties": { + "ID": { + "description": "ID is the member ID of the member to update.", + "type": "string", + "format": "uint64" + }, + "peerURLs": { + "description": "peerURLs is the new list of URLs the member will use to communicate with the cluster.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "etcdserverpbMemberUpdateResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + }, + "members": { + "description": "members is a list of all members after updating the member.", + "type": "array", + "items": { + "$ref": "#/definitions/etcdserverpbMember" + } + } + } + }, + "etcdserverpbMoveLeaderRequest": { + "type": "object", + "properties": { + "targetID": { + "description": "targetID is the node ID for the new leader.", + "type": "string", + "format": "uint64" + } + } + }, + "etcdserverpbMoveLeaderResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + } + } + }, + "etcdserverpbPutRequest": { + "type": "object", + "properties": { + "ignore_lease": { + "description": "If ignore_lease is set, etcd updates the key using its current lease.\nReturns an error if the key does not exist.", + "type": "boolean", + "format": "boolean" + }, + "ignore_value": { + "description": "If ignore_value is set, etcd updates the key using its current value.\nReturns an error if the key does not exist.", + "type": "boolean", + "format": "boolean" + }, + "key": { + "description": "key is the key, in bytes, to put into the key-value store.", + "type": "string", + "format": "byte" + }, + "lease": { + "description": "lease is the lease ID to associate with the key in the key-value store. A lease\nvalue of 0 indicates no lease.", + "type": "string", + "format": "int64" + }, + "prev_kv": { + "description": "If prev_kv is set, etcd gets the previous key-value pair before changing it.\nThe previous key-value pair will be returned in the put response.", + "type": "boolean", + "format": "boolean" + }, + "value": { + "description": "value is the value, in bytes, to associate with the key in the key-value store.", + "type": "string", + "format": "byte" + } + } + }, + "etcdserverpbPutResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + }, + "prev_kv": { + "description": "if prev_kv is set in the request, the previous key-value pair will be returned.", + "$ref": "#/definitions/mvccpbKeyValue" + } + } + }, + "etcdserverpbRangeRequest": { + "type": "object", + "properties": { + "count_only": { + "description": "count_only when set returns only the count of the keys in the range.", + "type": "boolean", + "format": "boolean" + }, + "key": { + "description": "key is the first key for the range. If range_end is not given, the request only looks up key.", + "type": "string", + "format": "byte" + }, + "keys_only": { + "description": "keys_only when set returns only the keys and not the values.", + "type": "boolean", + "format": "boolean" + }, + "limit": { + "description": "limit is a limit on the number of keys returned for the request. When limit is set to 0,\nit is treated as no limit.", + "type": "string", + "format": "int64" + }, + "max_create_revision": { + "description": "max_create_revision is the upper bound for returned key create revisions; all keys with\ngreater create revisions will be filtered away.", + "type": "string", + "format": "int64" + }, + "max_mod_revision": { + "description": "max_mod_revision is the upper bound for returned key mod revisions; all keys with\ngreater mod revisions will be filtered away.", + "type": "string", + "format": "int64" + }, + "min_create_revision": { + "description": "min_create_revision is the lower bound for returned key create revisions; all keys with\nlesser create revisions will be filtered away.", + "type": "string", + "format": "int64" + }, + "min_mod_revision": { + "description": "min_mod_revision is the lower bound for returned key mod revisions; all keys with\nlesser mod revisions will be filtered away.", + "type": "string", + "format": "int64" + }, + "range_end": { + "description": "range_end is the upper bound on the requested range [key, range_end).\nIf range_end is '\\0', the range is all keys \u003e= key.\nIf range_end is key plus one (e.g., \"aa\"+1 == \"ab\", \"a\\xff\"+1 == \"b\"),\nthen the range request gets all keys prefixed with key.\nIf both key and range_end are '\\0', then the range request returns all keys.", + "type": "string", + "format": "byte" + }, + "revision": { + "description": "revision is the point-in-time of the key-value store to use for the range.\nIf revision is less or equal to zero, the range is over the newest key-value store.\nIf the revision has been compacted, ErrCompacted is returned as a response.", + "type": "string", + "format": "int64" + }, + "serializable": { + "description": "serializable sets the range request to use serializable member-local reads.\nRange requests are linearizable by default; linearizable requests have higher\nlatency and lower throughput than serializable requests but reflect the current\nconsensus of the cluster. For better performance, in exchange for possible stale reads,\na serializable range request is served locally without needing to reach consensus\nwith other nodes in the cluster.", + "type": "boolean", + "format": "boolean" + }, + "sort_order": { + "description": "sort_order is the order for returned sorted results.", + "$ref": "#/definitions/RangeRequestSortOrder" + }, + "sort_target": { + "description": "sort_target is the key-value field to use for sorting.", + "$ref": "#/definitions/RangeRequestSortTarget" + } + } + }, + "etcdserverpbRangeResponse": { + "type": "object", + "properties": { + "count": { + "description": "count is set to the number of keys within the range when requested.", + "type": "string", + "format": "int64" + }, + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + }, + "kvs": { + "description": "kvs is the list of key-value pairs matched by the range request.\nkvs is empty when count is requested.", + "type": "array", + "items": { + "$ref": "#/definitions/mvccpbKeyValue" + } + }, + "more": { + "description": "more indicates if there are more keys to return in the requested range.", + "type": "boolean", + "format": "boolean" + } + } + }, + "etcdserverpbRequestOp": { + "type": "object", + "properties": { + "request_delete_range": { + "$ref": "#/definitions/etcdserverpbDeleteRangeRequest" + }, + "request_put": { + "$ref": "#/definitions/etcdserverpbPutRequest" + }, + "request_range": { + "$ref": "#/definitions/etcdserverpbRangeRequest" + }, + "request_txn": { + "$ref": "#/definitions/etcdserverpbTxnRequest" + } + } + }, + "etcdserverpbResponseHeader": { + "type": "object", + "properties": { + "cluster_id": { + "description": "cluster_id is the ID of the cluster which sent the response.", + "type": "string", + "format": "uint64" + }, + "member_id": { + "description": "member_id is the ID of the member which sent the response.", + "type": "string", + "format": "uint64" + }, + "raft_term": { + "description": "raft_term is the raft term when the request was applied.", + "type": "string", + "format": "uint64" + }, + "revision": { + "description": "revision is the key-value store revision when the request was applied.\nFor watch progress responses, the header.revision indicates progress. All future events\nrecieved in this stream are guaranteed to have a higher revision number than the\nheader.revision number.", + "type": "string", + "format": "int64" + } + } + }, + "etcdserverpbResponseOp": { + "type": "object", + "properties": { + "response_delete_range": { + "$ref": "#/definitions/etcdserverpbDeleteRangeResponse" + }, + "response_put": { + "$ref": "#/definitions/etcdserverpbPutResponse" + }, + "response_range": { + "$ref": "#/definitions/etcdserverpbRangeResponse" + }, + "response_txn": { + "$ref": "#/definitions/etcdserverpbTxnResponse" + } + } + }, + "etcdserverpbSnapshotRequest": { + "type": "object" + }, + "etcdserverpbSnapshotResponse": { + "type": "object", + "properties": { + "blob": { + "description": "blob contains the next chunk of the snapshot in the snapshot stream.", + "type": "string", + "format": "byte" + }, + "header": { + "description": "header has the current key-value store information. The first header in the snapshot\nstream indicates the point in time of the snapshot.", + "$ref": "#/definitions/etcdserverpbResponseHeader" + }, + "remaining_bytes": { + "type": "string", + "format": "uint64", + "title": "remaining_bytes is the number of blob bytes to be sent after this message" + } + } + }, + "etcdserverpbStatusRequest": { + "type": "object" + }, + "etcdserverpbStatusResponse": { + "type": "object", + "properties": { + "dbSize": { + "description": "dbSize is the size of the backend database physically allocated, in bytes, of the responding member.", + "type": "string", + "format": "int64" + }, + "dbSizeInUse": { + "description": "dbSizeInUse is the size of the backend database logically in use, in bytes, of the responding member.", + "type": "string", + "format": "int64" + }, + "errors": { + "description": "errors contains alarm/health information and status.", + "type": "array", + "items": { + "type": "string" + } + }, + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + }, + "isLearner": { + "description": "isLearner indicates if the member is raft learner.", + "type": "boolean", + "format": "boolean" + }, + "leader": { + "description": "leader is the member ID which the responding member believes is the current leader.", + "type": "string", + "format": "uint64" + }, + "raftAppliedIndex": { + "description": "raftAppliedIndex is the current raft applied index of the responding member.", + "type": "string", + "format": "uint64" + }, + "raftIndex": { + "description": "raftIndex is the current raft committed index of the responding member.", + "type": "string", + "format": "uint64" + }, + "raftTerm": { + "description": "raftTerm is the current raft term of the responding member.", + "type": "string", + "format": "uint64" + }, + "version": { + "description": "version is the cluster protocol version used by the responding member.", + "type": "string" + } + } + }, + "etcdserverpbTxnRequest": { + "description": "From google paxosdb paper:\nOur implementation hinges around a powerful primitive which we call MultiOp. All other database\noperations except for iteration are implemented as a single call to MultiOp. A MultiOp is applied atomically\nand consists of three components:\n1. A list of tests called guard. Each test in guard checks a single entry in the database. It may check\nfor the absence or presence of a value, or compare with a given value. Two different tests in the guard\nmay apply to the same or different entries in the database. All tests in the guard are applied and\nMultiOp returns the results. If all tests are true, MultiOp executes t op (see item 2 below), otherwise\nit executes f op (see item 3 below).\n2. A list of database operations called t op. Each operation in the list is either an insert, delete, or\nlookup operation, and applies to a single database entry. Two different operations in the list may apply\nto the same or different entries in the database. These operations are executed\nif guard evaluates to\ntrue.\n3. A list of database operations called f op. Like t op, but executed if guard evaluates to false.", + "type": "object", + "properties": { + "compare": { + "description": "compare is a list of predicates representing a conjunction of terms.\nIf the comparisons succeed, then the success requests will be processed in order,\nand the response will contain their respective responses in order.\nIf the comparisons fail, then the failure requests will be processed in order,\nand the response will contain their respective responses in order.", + "type": "array", + "items": { + "$ref": "#/definitions/etcdserverpbCompare" + } + }, + "failure": { + "description": "failure is a list of requests which will be applied when compare evaluates to false.", + "type": "array", + "items": { + "$ref": "#/definitions/etcdserverpbRequestOp" + } + }, + "success": { + "description": "success is a list of requests which will be applied when compare evaluates to true.", + "type": "array", + "items": { + "$ref": "#/definitions/etcdserverpbRequestOp" + } + } + } + }, + "etcdserverpbTxnResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + }, + "responses": { + "description": "responses is a list of responses corresponding to the results from applying\nsuccess if succeeded is true or failure if succeeded is false.", + "type": "array", + "items": { + "$ref": "#/definitions/etcdserverpbResponseOp" + } + }, + "succeeded": { + "description": "succeeded is set to true if the compare evaluated to true or false otherwise.", + "type": "boolean", + "format": "boolean" + } + } + }, + "etcdserverpbWatchCancelRequest": { + "type": "object", + "properties": { + "watch_id": { + "description": "watch_id is the watcher id to cancel so that no more events are transmitted.", + "type": "string", + "format": "int64" + } + } + }, + "etcdserverpbWatchCreateRequest": { + "type": "object", + "properties": { + "filters": { + "description": "filters filter the events at server side before it sends back to the watcher.", + "type": "array", + "items": { + "$ref": "#/definitions/WatchCreateRequestFilterType" + } + }, + "fragment": { + "description": "fragment enables splitting large revisions into multiple watch responses.", + "type": "boolean", + "format": "boolean" + }, + "key": { + "description": "key is the key to register for watching.", + "type": "string", + "format": "byte" + }, + "prev_kv": { + "description": "If prev_kv is set, created watcher gets the previous KV before the event happens.\nIf the previous KV is already compacted, nothing will be returned.", + "type": "boolean", + "format": "boolean" + }, + "progress_notify": { + "description": "progress_notify is set so that the etcd server will periodically send a WatchResponse with\nno events to the new watcher if there are no recent events. It is useful when clients\nwish to recover a disconnected watcher starting from a recent known revision.\nThe etcd server may decide how often it will send notifications based on current load.", + "type": "boolean", + "format": "boolean" + }, + "range_end": { + "description": "range_end is the end of the range [key, range_end) to watch. If range_end is not given,\nonly the key argument is watched. If range_end is equal to '\\0', all keys greater than\nor equal to the key argument are watched.\nIf the range_end is one bit larger than the given key,\nthen all keys with the prefix (the given key) will be watched.", + "type": "string", + "format": "byte" + }, + "start_revision": { + "description": "start_revision is an optional revision to watch from (inclusive). No start_revision is \"now\".", + "type": "string", + "format": "int64" + }, + "watch_id": { + "description": "If watch_id is provided and non-zero, it will be assigned to this watcher.\nSince creating a watcher in etcd is not a synchronous operation,\nthis can be used ensure that ordering is correct when creating multiple\nwatchers on the same stream. Creating a watcher with an ID already in\nuse on the stream will cause an error to be returned.", + "type": "string", + "format": "int64" + } + } + }, + "etcdserverpbWatchProgressRequest": { + "description": "Requests the a watch stream progress status be sent in the watch response stream as soon as\npossible.", + "type": "object" + }, + "etcdserverpbWatchRequest": { + "type": "object", + "properties": { + "cancel_request": { + "$ref": "#/definitions/etcdserverpbWatchCancelRequest" + }, + "create_request": { + "$ref": "#/definitions/etcdserverpbWatchCreateRequest" + }, + "progress_request": { + "$ref": "#/definitions/etcdserverpbWatchProgressRequest" + } + } + }, + "etcdserverpbWatchResponse": { + "type": "object", + "properties": { + "cancel_reason": { + "description": "cancel_reason indicates the reason for canceling the watcher.", + "type": "string" + }, + "canceled": { + "description": "canceled is set to true if the response is for a cancel watch request.\nNo further events will be sent to the canceled watcher.", + "type": "boolean", + "format": "boolean" + }, + "compact_revision": { + "description": "compact_revision is set to the minimum index if a watcher tries to watch\nat a compacted index.\n\nThis happens when creating a watcher at a compacted revision or the watcher cannot\ncatch up with the progress of the key-value store.\n\nThe client should treat the watcher as canceled and should not try to create any\nwatcher with the same start_revision again.", + "type": "string", + "format": "int64" + }, + "created": { + "description": "created is set to true if the response is for a create watch request.\nThe client should record the watch_id and expect to receive events for\nthe created watcher from the same stream.\nAll events sent to the created watcher will attach with the same watch_id.", + "type": "boolean", + "format": "boolean" + }, + "events": { + "type": "array", + "items": { + "$ref": "#/definitions/mvccpbEvent" + } + }, + "fragment": { + "description": "framgment is true if large watch response was split over multiple responses.", + "type": "boolean", + "format": "boolean" + }, + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + }, + "watch_id": { + "description": "watch_id is the ID of the watcher that corresponds to the response.", + "type": "string", + "format": "int64" + } + } + }, + "mvccpbEvent": { + "type": "object", + "properties": { + "kv": { + "description": "kv holds the KeyValue for the event.\nA PUT event contains current kv pair.\nA PUT event with kv.Version=1 indicates the creation of a key.\nA DELETE/EXPIRE event contains the deleted key with\nits modification revision set to the revision of deletion.", + "$ref": "#/definitions/mvccpbKeyValue" + }, + "prev_kv": { + "description": "prev_kv holds the key-value pair before the event happens.", + "$ref": "#/definitions/mvccpbKeyValue" + }, + "type": { + "description": "type is the kind of event. If type is a PUT, it indicates\nnew data has been stored to the key. If type is a DELETE,\nit indicates the key was deleted.", + "$ref": "#/definitions/EventEventType" + } + } + }, + "mvccpbKeyValue": { + "type": "object", + "properties": { + "create_revision": { + "description": "create_revision is the revision of last creation on this key.", + "type": "string", + "format": "int64" + }, + "key": { + "description": "key is the key in bytes. An empty key is not allowed.", + "type": "string", + "format": "byte" + }, + "lease": { + "description": "lease is the ID of the lease that attached to key.\nWhen the attached lease expires, the key will be deleted.\nIf lease is 0, then no lease is attached to the key.", + "type": "string", + "format": "int64" + }, + "mod_revision": { + "description": "mod_revision is the revision of last modification on this key.", + "type": "string", + "format": "int64" + }, + "value": { + "description": "value is the value held by the key, in bytes.", + "type": "string", + "format": "byte" + }, + "version": { + "description": "version is the version of the key. A deletion resets\nthe version to zero and any modification of the key\nincreases its version.", + "type": "string", + "format": "int64" + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "type_url": { + "type": "string" + }, + "value": { + "type": "string", + "format": "byte" + } + } + }, + "runtimeError": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + }, + "error": { + "type": "string" + }, + "message": { + "type": "string" + } + } + }, + "runtimeStreamError": { + "type": "object", + "properties": { + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + }, + "grpc_code": { + "type": "integer", + "format": "int32" + }, + "http_code": { + "type": "integer", + "format": "int32" + }, + "http_status": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + }, + "securityDefinitions": { + "ApiKey": { + "type": "apiKey", + "name": "Authorization", + "in": "header" + } + }, + "security": [ + { + "ApiKey": [] + } + ] +} \ No newline at end of file diff --git a/etcd-v3.5.9-linux-amd64/Documentation/dev-guide/apispec/swagger/v3election.swagger.json b/etcd-v3.5.9-linux-amd64/Documentation/dev-guide/apispec/swagger/v3election.swagger.json new file mode 100644 index 00000000..31217746 --- /dev/null +++ b/etcd-v3.5.9-linux-amd64/Documentation/dev-guide/apispec/swagger/v3election.swagger.json @@ -0,0 +1,427 @@ +{ + "swagger": "2.0", + "info": { + "title": "server/etcdserver/api/v3election/v3electionpb/v3election.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v3/election/campaign": { + "post": { + "summary": "Campaign waits to acquire leadership in an election, returning a LeaderKey\nrepresenting the leadership if successful. The LeaderKey can then be used\nto issue new values on the election, transactionally guard API requests on\nleadership still being held, and resign from the election.", + "operationId": "Election_Campaign", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v3electionpbCampaignResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v3electionpbCampaignRequest" + } + } + ], + "tags": [ + "Election" + ] + } + }, + "/v3/election/leader": { + "post": { + "summary": "Leader returns the current election proclamation, if any.", + "operationId": "Election_Leader", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v3electionpbLeaderResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v3electionpbLeaderRequest" + } + } + ], + "tags": [ + "Election" + ] + } + }, + "/v3/election/observe": { + "post": { + "summary": "Observe streams election proclamations in-order as made by the election's\nelected leaders.", + "operationId": "Election_Observe", + "responses": { + "200": { + "description": "A successful response.(streaming responses)", + "schema": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/v3electionpbLeaderResponse" + }, + "error": { + "$ref": "#/definitions/runtimeStreamError" + } + }, + "title": "Stream result of v3electionpbLeaderResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v3electionpbLeaderRequest" + } + } + ], + "tags": [ + "Election" + ] + } + }, + "/v3/election/proclaim": { + "post": { + "summary": "Proclaim updates the leader's posted value with a new value.", + "operationId": "Election_Proclaim", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v3electionpbProclaimResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v3electionpbProclaimRequest" + } + } + ], + "tags": [ + "Election" + ] + } + }, + "/v3/election/resign": { + "post": { + "summary": "Resign releases election leadership so other campaigners may acquire\nleadership on the election.", + "operationId": "Election_Resign", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v3electionpbResignResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v3electionpbResignRequest" + } + } + ], + "tags": [ + "Election" + ] + } + } + }, + "definitions": { + "etcdserverpbResponseHeader": { + "type": "object", + "properties": { + "cluster_id": { + "type": "string", + "format": "uint64", + "description": "cluster_id is the ID of the cluster which sent the response." + }, + "member_id": { + "type": "string", + "format": "uint64", + "description": "member_id is the ID of the member which sent the response." + }, + "revision": { + "type": "string", + "format": "int64", + "description": "revision is the key-value store revision when the request was applied.\nFor watch progress responses, the header.revision indicates progress. All future events\nrecieved in this stream are guaranteed to have a higher revision number than the\nheader.revision number." + }, + "raft_term": { + "type": "string", + "format": "uint64", + "description": "raft_term is the raft term when the request was applied." + } + } + }, + "mvccpbKeyValue": { + "type": "object", + "properties": { + "key": { + "type": "string", + "format": "byte", + "description": "key is the key in bytes. An empty key is not allowed." + }, + "create_revision": { + "type": "string", + "format": "int64", + "description": "create_revision is the revision of last creation on this key." + }, + "mod_revision": { + "type": "string", + "format": "int64", + "description": "mod_revision is the revision of last modification on this key." + }, + "version": { + "type": "string", + "format": "int64", + "description": "version is the version of the key. A deletion resets\nthe version to zero and any modification of the key\nincreases its version." + }, + "value": { + "type": "string", + "format": "byte", + "description": "value is the value held by the key, in bytes." + }, + "lease": { + "type": "string", + "format": "int64", + "description": "lease is the ID of the lease that attached to key.\nWhen the attached lease expires, the key will be deleted.\nIf lease is 0, then no lease is attached to the key." + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "type_url": { + "type": "string" + }, + "value": { + "type": "string", + "format": "byte" + } + } + }, + "runtimeError": { + "type": "object", + "properties": { + "error": { + "type": "string" + }, + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "runtimeStreamError": { + "type": "object", + "properties": { + "grpc_code": { + "type": "integer", + "format": "int32" + }, + "http_code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "http_status": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "v3electionpbCampaignRequest": { + "type": "object", + "properties": { + "name": { + "type": "string", + "format": "byte", + "description": "name is the election's identifier for the campaign." + }, + "lease": { + "type": "string", + "format": "int64", + "description": "lease is the ID of the lease attached to leadership of the election. If the\nlease expires or is revoked before resigning leadership, then the\nleadership is transferred to the next campaigner, if any." + }, + "value": { + "type": "string", + "format": "byte", + "description": "value is the initial proclaimed value set when the campaigner wins the\nelection." + } + } + }, + "v3electionpbCampaignResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + }, + "leader": { + "$ref": "#/definitions/v3electionpbLeaderKey", + "description": "leader describes the resources used for holding leadereship of the election." + } + } + }, + "v3electionpbLeaderKey": { + "type": "object", + "properties": { + "name": { + "type": "string", + "format": "byte", + "description": "name is the election identifier that correponds to the leadership key." + }, + "key": { + "type": "string", + "format": "byte", + "description": "key is an opaque key representing the ownership of the election. If the key\nis deleted, then leadership is lost." + }, + "rev": { + "type": "string", + "format": "int64", + "description": "rev is the creation revision of the key. It can be used to test for ownership\nof an election during transactions by testing the key's creation revision\nmatches rev." + }, + "lease": { + "type": "string", + "format": "int64", + "description": "lease is the lease ID of the election leader." + } + } + }, + "v3electionpbLeaderRequest": { + "type": "object", + "properties": { + "name": { + "type": "string", + "format": "byte", + "description": "name is the election identifier for the leadership information." + } + } + }, + "v3electionpbLeaderResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + }, + "kv": { + "$ref": "#/definitions/mvccpbKeyValue", + "description": "kv is the key-value pair representing the latest leader update." + } + } + }, + "v3electionpbProclaimRequest": { + "type": "object", + "properties": { + "leader": { + "$ref": "#/definitions/v3electionpbLeaderKey", + "description": "leader is the leadership hold on the election." + }, + "value": { + "type": "string", + "format": "byte", + "description": "value is an update meant to overwrite the leader's current value." + } + } + }, + "v3electionpbProclaimResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + } + } + }, + "v3electionpbResignRequest": { + "type": "object", + "properties": { + "leader": { + "$ref": "#/definitions/v3electionpbLeaderKey", + "description": "leader is the leadership to relinquish by resignation." + } + } + }, + "v3electionpbResignResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + } + } + } + } +} diff --git a/etcd-v3.5.9-linux-amd64/Documentation/dev-guide/apispec/swagger/v3lock.swagger.json b/etcd-v3.5.9-linux-amd64/Documentation/dev-guide/apispec/swagger/v3lock.swagger.json new file mode 100644 index 00000000..20fe3771 --- /dev/null +++ b/etcd-v3.5.9-linux-amd64/Documentation/dev-guide/apispec/swagger/v3lock.swagger.json @@ -0,0 +1,187 @@ +{ + "swagger": "2.0", + "info": { + "title": "server/etcdserver/api/v3lock/v3lockpb/v3lock.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v3/lock/lock": { + "post": { + "summary": "Lock acquires a distributed shared lock on a given named lock.\nOn success, it will return a unique key that exists so long as the\nlock is held by the caller. This key can be used in conjunction with\ntransactions to safely ensure updates to etcd only occur while holding\nlock ownership. The lock is held until Unlock is called on the key or the\nlease associate with the owner expires.", + "operationId": "Lock_Lock", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v3lockpbLockResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v3lockpbLockRequest" + } + } + ], + "tags": [ + "Lock" + ] + } + }, + "/v3/lock/unlock": { + "post": { + "summary": "Unlock takes a key returned by Lock and releases the hold on lock. The\nnext Lock caller waiting for the lock will then be woken up and given\nownership of the lock.", + "operationId": "Lock_Unlock", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v3lockpbUnlockResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v3lockpbUnlockRequest" + } + } + ], + "tags": [ + "Lock" + ] + } + } + }, + "definitions": { + "etcdserverpbResponseHeader": { + "type": "object", + "properties": { + "cluster_id": { + "type": "string", + "format": "uint64", + "description": "cluster_id is the ID of the cluster which sent the response." + }, + "member_id": { + "type": "string", + "format": "uint64", + "description": "member_id is the ID of the member which sent the response." + }, + "revision": { + "type": "string", + "format": "int64", + "description": "revision is the key-value store revision when the request was applied.\nFor watch progress responses, the header.revision indicates progress. All future events\nrecieved in this stream are guaranteed to have a higher revision number than the\nheader.revision number." + }, + "raft_term": { + "type": "string", + "format": "uint64", + "description": "raft_term is the raft term when the request was applied." + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "type_url": { + "type": "string" + }, + "value": { + "type": "string", + "format": "byte" + } + } + }, + "runtimeError": { + "type": "object", + "properties": { + "error": { + "type": "string" + }, + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "v3lockpbLockRequest": { + "type": "object", + "properties": { + "name": { + "type": "string", + "format": "byte", + "description": "name is the identifier for the distributed shared lock to be acquired." + }, + "lease": { + "type": "string", + "format": "int64", + "description": "lease is the ID of the lease that will be attached to ownership of the\nlock. If the lease expires or is revoked and currently holds the lock,\nthe lock is automatically released. Calls to Lock with the same lease will\nbe treated as a single acquisition; locking twice with the same lease is a\nno-op." + } + } + }, + "v3lockpbLockResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + }, + "key": { + "type": "string", + "format": "byte", + "description": "key is a key that will exist on etcd for the duration that the Lock caller\nowns the lock. Users should not modify this key or the lock may exhibit\nundefined behavior." + } + } + }, + "v3lockpbUnlockRequest": { + "type": "object", + "properties": { + "key": { + "type": "string", + "format": "byte", + "description": "key is the lock ownership key granted by Lock." + } + } + }, + "v3lockpbUnlockResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + } + } + } + } +} diff --git a/etcd-v3.5.9-linux-amd64/README-etcdctl.md b/etcd-v3.5.9-linux-amd64/README-etcdctl.md new file mode 100644 index 00000000..8dc9d2a1 --- /dev/null +++ b/etcd-v3.5.9-linux-amd64/README-etcdctl.md @@ -0,0 +1,1646 @@ +etcdctl +======== + +`etcdctl` is a command line client for [etcd][etcd]. + +The v3 API is used by default on main branch. For the v2 API, make sure to set environment variable `ETCDCTL_API=2`. See also [READMEv2][READMEv2]. + +If using released versions earlier than v3.4, set `ETCDCTL_API=3` to use v3 API. + +Global flags (e.g., `dial-timeout`, `--cacert`, `--cert`, `--key`) can be set with environment variables: + +``` +ETCDCTL_DIAL_TIMEOUT=3s +ETCDCTL_CACERT=/tmp/ca.pem +ETCDCTL_CERT=/tmp/cert.pem +ETCDCTL_KEY=/tmp/key.pem +``` + +Prefix flag strings with `ETCDCTL_`, convert all letters to upper-case, and replace dash(`-`) with underscore(`_`). Note that the environment variables with the prefix `ETCDCTL_` can only be used with the etcdctl global flags. Also, the environment variable `ETCDCTL_API` is a special case variable for etcdctl internal use only. + +## Key-value commands + +### PUT [options] \ \ + +PUT assigns the specified value with the specified key. If key already holds a value, it is overwritten. + +RPC: Put + +#### Options + +- lease -- lease ID (in hexadecimal) to attach to the key. + +- prev-kv -- return the previous key-value pair before modification. + +- ignore-value -- updates the key using its current value. + +- ignore-lease -- updates the key using its current lease. + +#### Output + +`OK` + +#### Examples + +```bash +./etcdctl put foo bar --lease=1234abcd +# OK +./etcdctl get foo +# foo +# bar +./etcdctl put foo --ignore-value # to detache lease +# OK +``` + +```bash +./etcdctl put foo bar --lease=1234abcd +# OK +./etcdctl put foo bar1 --ignore-lease # to use existing lease 1234abcd +# OK +./etcdctl get foo +# foo +# bar1 +``` + +```bash +./etcdctl put foo bar1 --prev-kv +# OK +# foo +# bar +./etcdctl get foo +# foo +# bar1 +``` + +#### Remarks + +If \ isn't given as command line argument, this command tries to read the value from standard input. + +When \ begins with '-', \ is interpreted as a flag. +Insert '--' for workaround: + +```bash +./etcdctl put -- +./etcdctl put -- +``` + +Providing \ in a new line after using `carriage return` is not supported and etcdctl may hang in that case. For example, following case is not supported: + +```bash +./etcdctl put \r + +``` + +A \ can have multiple lines or spaces but it must be provided with a double-quote as demonstrated below: + +```bash +./etcdctl put foo "bar1 2 3" +``` + +### GET [options] \ [range_end] + +GET gets the key or a range of keys [key, range_end) if range_end is given. + +RPC: Range + +#### Options + +- hex -- print out key and value as hex encode string + +- limit -- maximum number of results + +- prefix -- get keys by matching prefix + +- order -- order of results; ASCEND or DESCEND + +- sort-by -- sort target; CREATE, KEY, MODIFY, VALUE, or VERSION + +- rev -- specify the kv revision + +- print-value-only -- print only value when used with write-out=simple + +- consistency -- Linearizable(l) or Serializable(s) + +- from-key -- Get keys that are greater than or equal to the given key using byte compare + +- keys-only -- Get only the keys + +#### Output + +\\n\\n\\n\... + +#### Examples + +First, populate etcd with some keys: + +```bash +./etcdctl put foo bar +# OK +./etcdctl put foo1 bar1 +# OK +./etcdctl put foo2 bar2 +# OK +./etcdctl put foo3 bar3 +# OK +``` + +Get the key named `foo`: + +```bash +./etcdctl get foo +# foo +# bar +``` + +Get all keys: + +```bash +./etcdctl get --from-key '' +# foo +# bar +# foo1 +# bar1 +# foo2 +# foo2 +# foo3 +# bar3 +``` + +Get all keys with names greater than or equal to `foo1`: + +```bash +./etcdctl get --from-key foo1 +# foo1 +# bar1 +# foo2 +# bar2 +# foo3 +# bar3 +``` + +Get keys with names greater than or equal to `foo1` and less than `foo3`: + +```bash +./etcdctl get foo1 foo3 +# foo1 +# bar1 +# foo2 +# bar2 +``` + +#### Remarks + +If any key or value contains non-printable characters or control characters, simple formatted output can be ambiguous due to new lines. To resolve this issue, set `--hex` to hex encode all strings. + +### DEL [options] \ [range_end] + +Removes the specified key or range of keys [key, range_end) if range_end is given. + +RPC: DeleteRange + +#### Options + +- prefix -- delete keys by matching prefix + +- prev-kv -- return deleted key-value pairs + +- from-key -- delete keys that are greater than or equal to the given key using byte compare + +#### Output + +Prints the number of keys that were removed in decimal if DEL succeeded. + +#### Examples + +```bash +./etcdctl put foo bar +# OK +./etcdctl del foo +# 1 +./etcdctl get foo +``` + +```bash +./etcdctl put key val +# OK +./etcdctl del --prev-kv key +# 1 +# key +# val +./etcdctl get key +``` + +```bash +./etcdctl put a 123 +# OK +./etcdctl put b 456 +# OK +./etcdctl put z 789 +# OK +./etcdctl del --from-key a +# 3 +./etcdctl get --from-key a +``` + +```bash +./etcdctl put zoo val +# OK +./etcdctl put zoo1 val1 +# OK +./etcdctl put zoo2 val2 +# OK +./etcdctl del --prefix zoo +# 3 +./etcdctl get zoo2 +``` + +### TXN [options] + +TXN reads multiple etcd requests from standard input and applies them as a single atomic transaction. +A transaction consists of list of conditions, a list of requests to apply if all the conditions are true, and a list of requests to apply if any condition is false. + +RPC: Txn + +#### Options + +- hex -- print out keys and values as hex encoded strings. + +- interactive -- input transaction with interactive prompting. + +#### Input Format +```ebnf + ::= * "\n" "\n" "\n" + ::= (||||) "\n" + ::= "<" | "=" | ">" + := ("c"|"create")"("")" + ::= ("m"|"mod")"("")" + ::= ("val"|"value")"("")" + ::= ("ver"|"version")"("")" + ::= "lease("")" + ::= * + ::= * + ::= ((see put, get, del etcdctl command syntax)) "\n" + ::= (%q formatted string) + ::= (%q formatted string) + ::= "\""[0-9]+"\"" + ::= "\""[0-9]+"\"" + ::= "\""[0-9]+\"" +``` + +#### Output + +`SUCCESS` if etcd processed the transaction success list, `FAILURE` if etcd processed the transaction failure list. Prints the output for each command in the executed request list, each separated by a blank line. + +#### Examples + +txn in interactive mode: +```bash +./etcdctl txn -i +# compares: +mod("key1") > "0" + +# success requests (get, put, delete): +put key1 "overwrote-key1" + +# failure requests (get, put, delete): +put key1 "created-key1" +put key2 "some extra key" + +# FAILURE + +# OK + +# OK +``` + +txn in non-interactive mode: +```bash +./etcdctl txn <<<'mod("key1") > "0" + +put key1 "overwrote-key1" + +put key1 "created-key1" +put key2 "some extra key" + +' + +# FAILURE + +# OK + +# OK +``` + +#### Remarks + +When using multi-line values within a TXN command, newlines must be represented as `\n`. Literal newlines will cause parsing failures. This differs from other commands (such as PUT) where the shell will convert literal newlines for us. For example: + +```bash +./etcdctl txn <<<'mod("key1") > "0" + +put key1 "overwrote-key1" + +put key1 "created-key1" +put key2 "this is\na multi-line\nvalue" + +' + +# FAILURE + +# OK + +# OK +``` + +### COMPACTION [options] \ + +COMPACTION discards all etcd event history prior to a given revision. Since etcd uses a multiversion concurrency control +model, it preserves all key updates as event history. When the event history up to some revision is no longer needed, +all superseded keys may be compacted away to reclaim storage space in the etcd backend database. + +RPC: Compact + +#### Options + +- physical -- 'true' to wait for compaction to physically remove all old revisions + +#### Output + +Prints the compacted revision. + +#### Example +```bash +./etcdctl compaction 1234 +# compacted revision 1234 +``` + +### WATCH [options] [key or prefix] [range_end] [--] [exec-command arg1 arg2 ...] + +Watch watches events stream on keys or prefixes, [key or prefix, range_end) if range_end is given. The watch command runs until it encounters an error or is terminated by the user. If range_end is given, it must be lexicographically greater than key or "\x00". + +RPC: Watch + +#### Options + +- hex -- print out key and value as hex encode string + +- interactive -- begins an interactive watch session + +- prefix -- watch on a prefix if prefix is set. + +- prev-kv -- get the previous key-value pair before the event happens. + +- rev -- the revision to start watching. Specifying a revision is useful for observing past events. + +#### Input format + +Input is only accepted for interactive mode. + +``` +watch [options] \n +``` + +#### Output + +\[\n\\n\]\n\\n\\n\\n\\n\\n... + +#### Examples + +##### Non-interactive + +```bash +./etcdctl watch foo +# PUT +# foo +# bar +``` + +```bash +ETCDCTL_WATCH_KEY=foo ./etcdctl watch +# PUT +# foo +# bar +``` + +Receive events and execute `echo watch event received`: + +```bash +./etcdctl watch foo -- echo watch event received +# PUT +# foo +# bar +# watch event received +``` + +Watch response is set via `ETCD_WATCH_*` environmental variables: + +```bash +./etcdctl watch foo -- sh -c "env | grep ETCD_WATCH_" + +# PUT +# foo +# bar +# ETCD_WATCH_REVISION=11 +# ETCD_WATCH_KEY="foo" +# ETCD_WATCH_EVENT_TYPE="PUT" +# ETCD_WATCH_VALUE="bar" +``` + +Watch with environmental variables and execute `echo watch event received`: + +```bash +export ETCDCTL_WATCH_KEY=foo +./etcdctl watch -- echo watch event received +# PUT +# foo +# bar +# watch event received +``` + +```bash +export ETCDCTL_WATCH_KEY=foo +export ETCDCTL_WATCH_RANGE_END=foox +./etcdctl watch -- echo watch event received +# PUT +# fob +# bar +# watch event received +``` + +##### Interactive + +```bash +./etcdctl watch -i +watch foo +watch foo +# PUT +# foo +# bar +# PUT +# foo +# bar +``` + +Receive events and execute `echo watch event received`: + +```bash +./etcdctl watch -i +watch foo -- echo watch event received +# PUT +# foo +# bar +# watch event received +``` + +Watch with environmental variables and execute `echo watch event received`: + +```bash +export ETCDCTL_WATCH_KEY=foo +./etcdctl watch -i +watch -- echo watch event received +# PUT +# foo +# bar +# watch event received +``` + +```bash +export ETCDCTL_WATCH_KEY=foo +export ETCDCTL_WATCH_RANGE_END=foox +./etcdctl watch -i +watch -- echo watch event received +# PUT +# fob +# bar +# watch event received +``` + +### LEASE \ + +LEASE provides commands for key lease management. + +### LEASE GRANT \ + +LEASE GRANT creates a fresh lease with a server-selected time-to-live in seconds +greater than or equal to the requested TTL value. + +RPC: LeaseGrant + +#### Output + +Prints a message with the granted lease ID. + +#### Example + +```bash +./etcdctl lease grant 60 +# lease 32695410dcc0ca06 granted with TTL(60s) +``` + +### LEASE REVOKE \ + +LEASE REVOKE destroys a given lease, deleting all attached keys. + +RPC: LeaseRevoke + +#### Output + +Prints a message indicating the lease is revoked. + +#### Example + +```bash +./etcdctl lease revoke 32695410dcc0ca06 +# lease 32695410dcc0ca06 revoked +``` + +### LEASE TIMETOLIVE \ [options] + +LEASE TIMETOLIVE retrieves the lease information with the given lease ID. + +RPC: LeaseTimeToLive + +#### Options + +- keys -- Get keys attached to this lease + +#### Output + +Prints lease information. + +#### Example + +```bash +./etcdctl lease grant 500 +# lease 2d8257079fa1bc0c granted with TTL(500s) + +./etcdctl put foo1 bar --lease=2d8257079fa1bc0c +# OK + +./etcdctl put foo2 bar --lease=2d8257079fa1bc0c +# OK + +./etcdctl lease timetolive 2d8257079fa1bc0c +# lease 2d8257079fa1bc0c granted with TTL(500s), remaining(481s) + +./etcdctl lease timetolive 2d8257079fa1bc0c --keys +# lease 2d8257079fa1bc0c granted with TTL(500s), remaining(472s), attached keys([foo2 foo1]) + +./etcdctl lease timetolive 2d8257079fa1bc0c --write-out=json +# {"cluster_id":17186838941855831277,"member_id":4845372305070271874,"revision":3,"raft_term":2,"id":3279279168933706764,"ttl":465,"granted-ttl":500,"keys":null} + +./etcdctl lease timetolive 2d8257079fa1bc0c --write-out=json --keys +# {"cluster_id":17186838941855831277,"member_id":4845372305070271874,"revision":3,"raft_term":2,"id":3279279168933706764,"ttl":459,"granted-ttl":500,"keys":["Zm9vMQ==","Zm9vMg=="]} + +./etcdctl lease timetolive 2d8257079fa1bc0c +# lease 2d8257079fa1bc0c already expired +``` + +### LEASE LIST + +LEASE LIST lists all active leases. + +RPC: LeaseLeases + +#### Output + +Prints a message with a list of active leases. + +#### Example + +```bash +./etcdctl lease grant 60 +# lease 32695410dcc0ca06 granted with TTL(60s) + +./etcdctl lease list +32695410dcc0ca06 +``` + +### LEASE KEEP-ALIVE \ + +LEASE KEEP-ALIVE periodically refreshes a lease so it does not expire. + +RPC: LeaseKeepAlive + +#### Output + +Prints a message for every keep alive sent or prints a message indicating the lease is gone. + +#### Example +```bash +./etcdctl lease keep-alive 32695410dcc0ca0 +# lease 32695410dcc0ca0 keepalived with TTL(100) +# lease 32695410dcc0ca0 keepalived with TTL(100) +# lease 32695410dcc0ca0 keepalived with TTL(100) +... +``` + +## Cluster maintenance commands + +### MEMBER \ + +MEMBER provides commands for managing etcd cluster membership. + +### MEMBER ADD \ [options] + +MEMBER ADD introduces a new member into the etcd cluster as a new peer. + +RPC: MemberAdd + +#### Options + +- peer-urls -- comma separated list of URLs to associate with the new member. + +#### Output + +Prints the member ID of the new member and the cluster ID. + +#### Example + +```bash +./etcdctl member add newMember --peer-urls=https://127.0.0.1:12345 + +Member ced000fda4d05edf added to cluster 8c4281cc65c7b112 + +ETCD_NAME="newMember" +ETCD_INITIAL_CLUSTER="newMember=https://127.0.0.1:12345,default=http://10.0.0.30:2380" +ETCD_INITIAL_CLUSTER_STATE="existing" +``` + +### MEMBER UPDATE \ [options] + +MEMBER UPDATE sets the peer URLs for an existing member in the etcd cluster. + +RPC: MemberUpdate + +#### Options + +- peer-urls -- comma separated list of URLs to associate with the updated member. + +#### Output + +Prints the member ID of the updated member and the cluster ID. + +#### Example + +```bash +./etcdctl member update 2be1eb8f84b7f63e --peer-urls=https://127.0.0.1:11112 +# Member 2be1eb8f84b7f63e updated in cluster ef37ad9dc622a7c4 +``` + +### MEMBER REMOVE \ + +MEMBER REMOVE removes a member of an etcd cluster from participating in cluster consensus. + +RPC: MemberRemove + +#### Output + +Prints the member ID of the removed member and the cluster ID. + +#### Example + +```bash +./etcdctl member remove 2be1eb8f84b7f63e +# Member 2be1eb8f84b7f63e removed from cluster ef37ad9dc622a7c4 +``` + +### MEMBER LIST + +MEMBER LIST prints the member details for all members associated with an etcd cluster. + +RPC: MemberList + +#### Output + +Prints a humanized table of the member IDs, statuses, names, peer addresses, and client addresses. + +#### Examples + +```bash +./etcdctl member list +# 8211f1d0f64f3269, started, infra1, http://127.0.0.1:12380, http://127.0.0.1:2379 +# 91bc3c398fb3c146, started, infra2, http://127.0.0.1:22380, http://127.0.0.1:22379 +# fd422379fda50e48, started, infra3, http://127.0.0.1:32380, http://127.0.0.1:32379 +``` + +```bash +./etcdctl -w json member list +# {"header":{"cluster_id":17237436991929493444,"member_id":9372538179322589801,"raft_term":2},"members":[{"ID":9372538179322589801,"name":"infra1","peerURLs":["http://127.0.0.1:12380"],"clientURLs":["http://127.0.0.1:2379"]},{"ID":10501334649042878790,"name":"infra2","peerURLs":["http://127.0.0.1:22380"],"clientURLs":["http://127.0.0.1:22379"]},{"ID":18249187646912138824,"name":"infra3","peerURLs":["http://127.0.0.1:32380"],"clientURLs":["http://127.0.0.1:32379"]}]} +``` + +```bash +./etcdctl -w table member list ++------------------+---------+--------+------------------------+------------------------+ +| ID | STATUS | NAME | PEER ADDRS | CLIENT ADDRS | ++------------------+---------+--------+------------------------+------------------------+ +| 8211f1d0f64f3269 | started | infra1 | http://127.0.0.1:12380 | http://127.0.0.1:2379 | +| 91bc3c398fb3c146 | started | infra2 | http://127.0.0.1:22380 | http://127.0.0.1:22379 | +| fd422379fda50e48 | started | infra3 | http://127.0.0.1:32380 | http://127.0.0.1:32379 | ++------------------+---------+--------+------------------------+------------------------+ +``` + +### ENDPOINT \ + +ENDPOINT provides commands for querying individual endpoints. + +#### Options + +- cluster -- fetch and use all endpoints from the etcd cluster member list + +### ENDPOINT HEALTH + +ENDPOINT HEALTH checks the health of the list of endpoints with respect to cluster. An endpoint is unhealthy +when it cannot participate in consensus with the rest of the cluster. + +#### Output + +If an endpoint can participate in consensus, prints a message indicating the endpoint is healthy. If an endpoint fails to participate in consensus, prints a message indicating the endpoint is unhealthy. + +#### Example + +Check the default endpoint's health: + +```bash +./etcdctl endpoint health +# 127.0.0.1:2379 is healthy: successfully committed proposal: took = 2.095242ms +``` + +Check all endpoints for the cluster associated with the default endpoint: + +```bash +./etcdctl endpoint --cluster health +# http://127.0.0.1:2379 is healthy: successfully committed proposal: took = 1.060091ms +# http://127.0.0.1:22379 is healthy: successfully committed proposal: took = 903.138µs +# http://127.0.0.1:32379 is healthy: successfully committed proposal: took = 1.113848ms +``` + +### ENDPOINT STATUS + +ENDPOINT STATUS queries the status of each endpoint in the given endpoint list. + +#### Output + +##### Simple format + +Prints a humanized table of each endpoint URL, ID, version, database size, leadership status, raft term, and raft status. + +##### JSON format + +Prints a line of JSON encoding each endpoint URL, ID, version, database size, leadership status, raft term, and raft status. + +#### Examples + +Get the status for the default endpoint: + +```bash +./etcdctl endpoint status +# 127.0.0.1:2379, 8211f1d0f64f3269, 3.0.0, 25 kB, false, 2, 63 +``` + +Get the status for the default endpoint as JSON: + +```bash +./etcdctl -w json endpoint status +# [{"Endpoint":"127.0.0.1:2379","Status":{"header":{"cluster_id":17237436991929493444,"member_id":9372538179322589801,"revision":2,"raft_term":2},"version":"3.0.0","dbSize":24576,"leader":18249187646912138824,"raftIndex":32623,"raftTerm":2}}] +``` + +Get the status for all endpoints in the cluster associated with the default endpoint: + +```bash +./etcdctl -w table endpoint --cluster status ++------------------------+------------------+----------------+---------+-----------+-----------+------------+ +| ENDPOINT | ID | VERSION | DB SIZE | IS LEADER | RAFT TERM | RAFT INDEX | ++------------------------+------------------+----------------+---------+-----------+-----------+------------+ +| http://127.0.0.1:2379 | 8211f1d0f64f3269 | 3.2.0-rc.1+git | 25 kB | false | 2 | 8 | +| http://127.0.0.1:22379 | 91bc3c398fb3c146 | 3.2.0-rc.1+git | 25 kB | false | 2 | 8 | +| http://127.0.0.1:32379 | fd422379fda50e48 | 3.2.0-rc.1+git | 25 kB | true | 2 | 8 | ++------------------------+------------------+----------------+---------+-----------+-----------+------------+ +``` + +### ENDPOINT HASHKV + +ENDPOINT HASHKV fetches the hash of the key-value store of an endpoint. + +#### Output + +##### Simple format + +Prints a humanized table of each endpoint URL and KV history hash. + +##### JSON format + +Prints a line of JSON encoding each endpoint URL and KV history hash. + +#### Examples + +Get the hash for the default endpoint: + +```bash +./etcdctl endpoint hashkv +# 127.0.0.1:2379, 1084519789 +``` + +Get the status for the default endpoint as JSON: + +```bash +./etcdctl -w json endpoint hashkv +# [{"Endpoint":"127.0.0.1:2379","Hash":{"header":{"cluster_id":14841639068965178418,"member_id":10276657743932975437,"revision":1,"raft_term":3},"hash":1084519789,"compact_revision":-1}}] +``` + +Get the status for all endpoints in the cluster associated with the default endpoint: + +```bash +./etcdctl -w table endpoint --cluster hashkv ++------------------------+------------+ +| ENDPOINT | HASH | ++------------------------+------------+ +| http://127.0.0.1:2379 | 1084519789 | +| http://127.0.0.1:22379 | 1084519789 | +| http://127.0.0.1:32379 | 1084519789 | ++------------------------+------------+ +``` + +### ALARM \ + +Provides alarm related commands + +### ALARM DISARM + +`alarm disarm` Disarms all alarms + +RPC: Alarm + +#### Output + +`alarm:` if alarm is present and disarmed. + +#### Examples + +```bash +./etcdctl alarm disarm +``` + +If NOSPACE alarm is present: + +```bash +./etcdctl alarm disarm +# alarm:NOSPACE +``` + +### ALARM LIST + +`alarm list` lists all alarms. + +RPC: Alarm + +#### Output + +`alarm:` if alarm is present, empty string if no alarms present. + +#### Examples + +```bash +./etcdctl alarm list +``` + +If NOSPACE alarm is present: + +```bash +./etcdctl alarm list +# alarm:NOSPACE +``` + +### DEFRAG [options] + +DEFRAG defragments the backend database file for a set of given endpoints while etcd is running, ~~or directly defragments an etcd data directory while etcd is not running~~. When an etcd member reclaims storage space from deleted and compacted keys, the space is kept in a free list and the database file remains the same size. By defragmenting the database, the etcd member releases this free space back to the file system. + +**Note: to defragment offline (`--data-dir` flag), use: `etcutl defrag` instead** + +**Note that defragmentation to a live member blocks the system from reading and writing data while rebuilding its states.** + +**Note that defragmentation request does not get replicated over cluster. That is, the request is only applied to the local node. Specify all members in `--endpoints` flag or `--cluster` flag to automatically find all cluster members.** + +#### Options + +- data-dir -- Optional. **Deprecated**. If present, defragments a data directory not in use by etcd. To be removed in v3.6. + +#### Output + +For each endpoints, prints a message indicating whether the endpoint was successfully defragmented. + +#### Example + +```bash +./etcdctl --endpoints=localhost:2379,badendpoint:2379 defrag +# Finished defragmenting etcd member[localhost:2379] +# Failed to defragment etcd member[badendpoint:2379] (grpc: timed out trying to connect) +``` + +Run defragment operations for all endpoints in the cluster associated with the default endpoint: + +```bash +./etcdctl defrag --cluster +Finished defragmenting etcd member[http://127.0.0.1:2379] +Finished defragmenting etcd member[http://127.0.0.1:22379] +Finished defragmenting etcd member[http://127.0.0.1:32379] +``` + +To defragment a data directory directly, use the `etcdutl` with `--data-dir` flag +(`etcdctl` will remove this flag in v3.6): + +``` bash +# Defragment while etcd is not running +./etcdutl defrag --data-dir default.etcd +# success (exit status 0) +# Error: cannot open database at default.etcd/member/snap/db +``` + +#### Remarks + +DEFRAG returns a zero exit code only if it succeeded defragmenting all given endpoints. + +### SNAPSHOT \ + +SNAPSHOT provides commands to restore a snapshot of a running etcd server into a fresh cluster. + +### SNAPSHOT SAVE \ + +SNAPSHOT SAVE writes a point-in-time snapshot of the etcd backend database to a file. + +#### Output + +The backend snapshot is written to the given file path. + +#### Example + +Save a snapshot to "snapshot.db": +``` +./etcdctl snapshot save snapshot.db +``` + +### SNAPSHOT RESTORE [options] \ + +Note: Deprecated. Use `etcdutl snapshot restore` instead. To be removed in v3.6. + +SNAPSHOT RESTORE creates an etcd data directory for an etcd cluster member from a backend database snapshot and a new cluster configuration. Restoring the snapshot into each member for a new cluster configuration will initialize a new etcd cluster preloaded by the snapshot data. + +#### Options + +The snapshot restore options closely resemble to those used in the `etcd` command for defining a cluster. + +- data-dir -- Path to the data directory. Uses \.etcd if none given. + +- wal-dir -- Path to the WAL directory. Uses data directory if none given. + +- initial-cluster -- The initial cluster configuration for the restored etcd cluster. + +- initial-cluster-token -- Initial cluster token for the restored etcd cluster. + +- initial-advertise-peer-urls -- List of peer URLs for the member being restored. + +- name -- Human-readable name for the etcd cluster member being restored. + +- skip-hash-check -- Ignore snapshot integrity hash value (required if copied from data directory) + +#### Output + +A new etcd data directory initialized with the snapshot. + +#### Example + +Save a snapshot, restore into a new 3 node cluster, and start the cluster: +``` +./etcdctl snapshot save snapshot.db + +# restore members +bin/etcdctl snapshot restore snapshot.db --initial-cluster-token etcd-cluster-1 --initial-advertise-peer-urls http://127.0.0.1:12380 --name sshot1 --initial-cluster 'sshot1=http://127.0.0.1:12380,sshot2=http://127.0.0.1:22380,sshot3=http://127.0.0.1:32380' +bin/etcdctl snapshot restore snapshot.db --initial-cluster-token etcd-cluster-1 --initial-advertise-peer-urls http://127.0.0.1:22380 --name sshot2 --initial-cluster 'sshot1=http://127.0.0.1:12380,sshot2=http://127.0.0.1:22380,sshot3=http://127.0.0.1:32380' +bin/etcdctl snapshot restore snapshot.db --initial-cluster-token etcd-cluster-1 --initial-advertise-peer-urls http://127.0.0.1:32380 --name sshot3 --initial-cluster 'sshot1=http://127.0.0.1:12380,sshot2=http://127.0.0.1:22380,sshot3=http://127.0.0.1:32380' + +# launch members +bin/etcd --name sshot1 --listen-client-urls http://127.0.0.1:2379 --advertise-client-urls http://127.0.0.1:2379 --listen-peer-urls http://127.0.0.1:12380 & +bin/etcd --name sshot2 --listen-client-urls http://127.0.0.1:22379 --advertise-client-urls http://127.0.0.1:22379 --listen-peer-urls http://127.0.0.1:22380 & +bin/etcd --name sshot3 --listen-client-urls http://127.0.0.1:32379 --advertise-client-urls http://127.0.0.1:32379 --listen-peer-urls http://127.0.0.1:32380 & +``` + +### SNAPSHOT STATUS \ + +Note: Deprecated. Use `etcdutl snapshot restore` instead. To be removed in v3.6. + +SNAPSHOT STATUS lists information about a given backend database snapshot file. + +#### Output + +##### Simple format + +Prints a humanized table of the database hash, revision, total keys, and size. + +##### JSON format + +Prints a line of JSON encoding the database hash, revision, total keys, and size. + +#### Examples +```bash +./etcdctl snapshot status file.db +# cf1550fb, 3, 3, 25 kB +``` + +```bash +./etcdctl --write-out=json snapshot status file.db +# {"hash":3474280699,"revision":3,"totalKey":3,"totalSize":24576} +``` + +```bash +./etcdctl --write-out=table snapshot status file.db ++----------+----------+------------+------------+ +| HASH | REVISION | TOTAL KEYS | TOTAL SIZE | ++----------+----------+------------+------------+ +| cf1550fb | 3 | 3 | 25 kB | ++----------+----------+------------+------------+ +``` + +### MOVE-LEADER \ + +MOVE-LEADER transfers leadership from the leader to another member in the cluster. + +#### Example + +```bash +# to choose transferee +transferee_id=$(./etcdctl \ + --endpoints localhost:2379,localhost:22379,localhost:32379 \ + endpoint status | grep -m 1 "false" | awk -F', ' '{print $2}') +echo ${transferee_id} +# c89feb932daef420 + +# endpoints should include leader node +./etcdctl --endpoints ${transferee_ep} move-leader ${transferee_id} +# Error: no leader endpoint given at [localhost:22379 localhost:32379] + +# request to leader with target node ID +./etcdctl --endpoints ${leader_ep} move-leader ${transferee_id} +# Leadership transferred from 45ddc0e800e20b93 to c89feb932daef420 +``` + +## Concurrency commands + +### LOCK [options] \ [command arg1 arg2 ...] + +LOCK acquires a distributed mutex with a given name. Once the lock is acquired, it will be held until etcdctl is terminated. + +#### Options + +- ttl - time out in seconds of lock session. + +#### Output + +Once the lock is acquired but no command is given, the result for the GET on the unique lock holder key is displayed. + +If a command is given, it will be executed with environment variables `ETCD_LOCK_KEY` and `ETCD_LOCK_REV` set to the lock's holder key and revision. + +#### Example + +Acquire lock with standard output display: + +```bash +./etcdctl lock mylock +# mylock/1234534535445 +``` + +Acquire lock and execute `echo lock acquired`: + +```bash +./etcdctl lock mylock echo lock acquired +# lock acquired +``` + +Acquire lock and execute `etcdctl put` command +```bash +./etcdctl lock mylock ./etcdctl put foo bar +# OK +``` + +#### Remarks + +LOCK returns a zero exit code only if it is terminated by a signal and releases the lock. + +If LOCK is abnormally terminated or fails to contact the cluster to release the lock, the lock will remain held until the lease expires. Progress may be delayed by up to the default lease length of 60 seconds. + +### ELECT [options] \ [proposal] + +ELECT participates on a named election. A node announces its candidacy in the election by providing +a proposal value. If a node wishes to observe the election, ELECT listens for new leaders values. +Whenever a leader is elected, its proposal is given as output. + +#### Options + +- listen -- observe the election. + +#### Output + +- If a candidate, ELECT displays the GET on the leader key once the node is elected election. + +- If observing, ELECT streams the result for a GET on the leader key for the current election and all future elections. + +#### Example + +```bash +./etcdctl elect myelection foo +# myelection/1456952310051373265 +# foo +``` + +#### Remarks + +ELECT returns a zero exit code only if it is terminated by a signal and can revoke its candidacy or leadership, if any. + +If a candidate is abnormally terminated, election rogress may be delayed by up to the default lease length of 60 seconds. + +## Authentication commands + +### AUTH \ + +`auth enable` activates authentication on an etcd cluster and `auth disable` deactivates. When authentication is enabled, etcd checks all requests for appropriate authorization. + +RPC: AuthEnable/AuthDisable + +#### Output + +`Authentication Enabled`. + +#### Examples + +```bash +./etcdctl user add root +# Password of root:#type password for root +# Type password of root again for confirmation:#re-type password for root +# User root created +./etcdctl user grant-role root root +# Role root is granted to user root +./etcdctl user get root +# User: root +# Roles: root +./etcdctl role add root +# Role root created +./etcdctl role get root +# Role root +# KV Read: +# KV Write: +./etcdctl auth enable +# Authentication Enabled +``` + +### ROLE \ + +ROLE is used to specify different roles which can be assigned to etcd user(s). + +### ROLE ADD \ + +`role add` creates a role. + +RPC: RoleAdd + +#### Output + +`Role created`. + +#### Examples + +```bash +./etcdctl --user=root:123 role add myrole +# Role myrole created +``` + +### ROLE GET \ + +`role get` lists detailed role information. + +RPC: RoleGet + +#### Output + +Detailed role information. + +#### Examples + +```bash +./etcdctl --user=root:123 role get myrole +# Role myrole +# KV Read: +# foo +# KV Write: +# foo +``` + +### ROLE DELETE \ + +`role delete` deletes a role. + +RPC: RoleDelete + +#### Output + +`Role deleted`. + +#### Examples + +```bash +./etcdctl --user=root:123 role delete myrole +# Role myrole deleted +``` + +### ROLE LIST \ + +`role list` lists all roles in etcd. + +RPC: RoleList + +#### Output + +A role per line. + +#### Examples + +```bash +./etcdctl --user=root:123 role list +# roleA +# roleB +# myrole +``` + +### ROLE GRANT-PERMISSION [options] \ \ \ [endkey] + +`role grant-permission` grants a key to a role. + +RPC: RoleGrantPermission + +#### Options + +- from-key -- grant a permission of keys that are greater than or equal to the given key using byte compare + +- prefix -- grant a prefix permission + +#### Output + +`Role updated`. + +#### Examples + +Grant read and write permission on the key `foo` to role `myrole`: + +```bash +./etcdctl --user=root:123 role grant-permission myrole readwrite foo +# Role myrole updated +``` + +Grant read permission on the wildcard key pattern `foo/*` to role `myrole`: + +```bash +./etcdctl --user=root:123 role grant-permission --prefix myrole readwrite foo/ +# Role myrole updated +``` + +### ROLE REVOKE-PERMISSION \ \ \ [endkey] + +`role revoke-permission` revokes a key from a role. + +RPC: RoleRevokePermission + +#### Options + +- from-key -- revoke a permission of keys that are greater than or equal to the given key using byte compare + +- prefix -- revoke a prefix permission + +#### Output + +`Permission of key is revoked from role ` for single key. `Permission of range [, ) is revoked from role ` for a key range. Exit code is zero. + +#### Examples + +```bash +./etcdctl --user=root:123 role revoke-permission myrole foo +# Permission of key foo is revoked from role myrole +``` + +### USER \ + +USER provides commands for managing users of etcd. + +### USER ADD \ [options] + +`user add` creates a user. + +RPC: UserAdd + +#### Options + +- interactive -- Read password from stdin instead of interactive terminal + +#### Output + +`User created`. + +#### Examples + +```bash +./etcdctl --user=root:123 user add myuser +# Password of myuser: #type password for my user +# Type password of myuser again for confirmation:#re-type password for my user +# User myuser created +``` + +### USER GET \ [options] + +`user get` lists detailed user information. + +RPC: UserGet + +#### Options + +- detail -- Show permissions of roles granted to the user + +#### Output + +Detailed user information. + +#### Examples + +```bash +./etcdctl --user=root:123 user get myuser +# User: myuser +# Roles: +``` + +### USER DELETE \ + +`user delete` deletes a user. + +RPC: UserDelete + +#### Output + +`User deleted`. + +#### Examples + +```bash +./etcdctl --user=root:123 user delete myuser +# User myuser deleted +``` + +### USER LIST + +`user list` lists detailed user information. + +RPC: UserList + +#### Output + +- List of users, one per line. + +#### Examples + +```bash +./etcdctl --user=root:123 user list +# user1 +# user2 +# myuser +``` + +### USER PASSWD \ [options] + +`user passwd` changes a user's password. + +RPC: UserChangePassword + +#### Options + +- interactive -- if true, read password in interactive terminal + +#### Output + +`Password updated`. + +#### Examples + +```bash +./etcdctl --user=root:123 user passwd myuser +# Password of myuser: #type new password for my user +# Type password of myuser again for confirmation: #re-type the new password for my user +# Password updated +``` + +### USER GRANT-ROLE \ \ + +`user grant-role` grants a role to a user + +RPC: UserGrantRole + +#### Output + +`Role is granted to user `. + +#### Examples + +```bash +./etcdctl --user=root:123 user grant-role userA roleA +# Role roleA is granted to user userA +``` + +### USER REVOKE-ROLE \ \ + +`user revoke-role` revokes a role from a user + +RPC: UserRevokeRole + +#### Output + +`Role is revoked from user `. + +#### Examples + +```bash +./etcdctl --user=root:123 user revoke-role userA roleA +# Role roleA is revoked from user userA +``` + +## Utility commands + +### MAKE-MIRROR [options] \ + +[make-mirror][mirror] mirrors a key prefix in an etcd cluster to a destination etcd cluster. + +#### Options + +- dest-cacert -- TLS certificate authority file for destination cluster + +- dest-cert -- TLS certificate file for destination cluster + +- dest-key -- TLS key file for destination cluster + +- prefix -- The key-value prefix to mirror + +- dest-prefix -- The destination prefix to mirror a prefix to a different prefix in the destination cluster + +- no-dest-prefix -- Mirror key-values to the root of the destination cluster + +- dest-insecure-transport -- Disable transport security for client connections + +#### Output + +The approximate total number of keys transferred to the destination cluster, updated every 30 seconds. + +#### Examples + +``` +./etcdctl make-mirror mirror.example.com:2379 +# 10 +# 18 +``` + +[mirror]: ./doc/mirror_maker.md + + +### VERSION + +Prints the version of etcdctl. + +#### Output + +Prints etcd version and API version. + +#### Examples + +```bash +./etcdctl version +# etcdctl version: 3.1.0-alpha.0+git +# API version: 3.1 +``` + +### CHECK \ + +CHECK provides commands for checking properties of the etcd cluster. + +### CHECK PERF [options] + +CHECK PERF checks the performance of the etcd cluster for 60 seconds. Running the `check perf` often can create a large keyspace history which can be auto compacted and defragmented using the `--auto-compact` and `--auto-defrag` options as described below. + +RPC: CheckPerf + +#### Options + +- load -- the performance check's workload model. Accepted workloads: s(small), m(medium), l(large), xl(xLarge) + +- prefix -- the prefix for writing the performance check's keys. + +- auto-compact -- if true, compact storage with last revision after test is finished. + +- auto-defrag -- if true, defragment storage after test is finished. + +#### Output + +Prints the result of performance check on different criteria like throughput. Also prints an overall status of the check as pass or fail. + +#### Examples + +Shows examples of both, pass and fail, status. The failure is due to the fact that a large workload was tried on a single node etcd cluster running on a laptop environment created for development and testing purpose. + +```bash +./etcdctl check perf --load="s" +# 60 / 60 Booooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo! 100.00%1m0s +# PASS: Throughput is 150 writes/s +# PASS: Slowest request took 0.087509s +# PASS: Stddev is 0.011084s +# PASS +./etcdctl check perf --load="l" +# 60 / 60 Booooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo! 100.00%1m0s +# FAIL: Throughput too low: 6808 writes/s +# PASS: Slowest request took 0.228191s +# PASS: Stddev is 0.033547s +# FAIL +``` + +### CHECK DATASCALE [options] + +CHECK DATASCALE checks the memory usage of holding data for different workloads on a given server endpoint. Running the `check datascale` often can create a large keyspace history which can be auto compacted and defragmented using the `--auto-compact` and `--auto-defrag` options as described below. + +RPC: CheckDatascale + +#### Options + +- load -- the datascale check's workload model. Accepted workloads: s(small), m(medium), l(large), xl(xLarge) + +- prefix -- the prefix for writing the datascale check's keys. + +- auto-compact -- if true, compact storage with last revision after test is finished. + +- auto-defrag -- if true, defragment storage after test is finished. + +#### Output + +Prints the system memory usage for a given workload. Also prints status of compact and defragment if related options are passed. + +#### Examples + +```bash +./etcdctl check datascale --load="s" --auto-compact=true --auto-defrag=true +# Start data scale check for work load [10000 key-value pairs, 1024 bytes per key-value, 50 concurrent clients]. +# Compacting with revision 18346204 +# Compacted with revision 18346204 +# Defragmenting "127.0.0.1:2379" +# Defragmented "127.0.0.1:2379" +# PASS: Approximate system memory used : 64.30 MB. +``` + +## Exit codes + +For all commands, a successful execution return a zero exit code. All failures will return non-zero exit codes. + +## Output formats + +All commands accept an output format by setting `-w` or `--write-out`. All commands default to the "simple" output format, which is meant to be human-readable. The simple format is listed in each command's `Output` description since it is customized for each command. If a command has a corresponding RPC, it will respect all output formats. + +If a command fails, returning a non-zero exit code, an error string will be written to standard error regardless of output format. + +### Simple + +A format meant to be easy to parse and human-readable. Specific to each command. + +### JSON + +The JSON encoding of the command's [RPC response][etcdrpc]. Since etcd's RPCs use byte strings, the JSON output will encode keys and values in base64. + +Some commands without an RPC also support JSON; see the command's `Output` description. + +### Protobuf + +The protobuf encoding of the command's [RPC response][etcdrpc]. If an RPC is streaming, the stream messages will be concetenated. If an RPC is not given for a command, the protobuf output is not defined. + +### Fields + +An output format similar to JSON but meant to parse with coreutils. For an integer field named `Field`, it writes a line in the format `"Field" : %d` where `%d` is go's integer formatting. For byte array fields, it writes `"Field" : %q` where `%q` is go's quoted string formatting (e.g., `[]byte{'a', '\n'}` is written as `"a\n"`). + +## Compatibility Support + +etcdctl is still in its early stage. We try out best to ensure fully compatible releases, however we might break compatibility to fix bugs or improve commands. If we intend to release a version of etcdctl with backward incompatibilities, we will provide notice prior to release and have instructions on how to upgrade. + +### Input Compatibility + +Input includes the command name, its flags, and its arguments. We ensure backward compatibility of the input of normal commands in non-interactive mode. + +### Output Compatibility + +Output includes output from etcdctl and its exit code. etcdctl provides `simple` output format by default. +We ensure compatibility for the `simple` output format of normal commands in non-interactive mode. Currently, we do not ensure +backward compatibility for `JSON` format and the format in non-interactive mode. Currently, we do not ensure backward compatibility of utility commands. + +### TODO: compatibility with etcd server + +[etcd]: https://github.com/coreos/etcd +[READMEv2]: READMEv2.md +[v2key]: ../store/node_extern.go#L28-L37 +[v3key]: ../api/mvccpb/kv.proto#L12-L29 +[etcdrpc]: ../api/etcdserverpb/rpc.proto +[storagerpc]: ../api/mvccpb/kv.proto diff --git a/etcd-v3.5.9-linux-amd64/README-etcdutl.md b/etcd-v3.5.9-linux-amd64/README-etcdutl.md new file mode 100644 index 00000000..966a6151 --- /dev/null +++ b/etcd-v3.5.9-linux-amd64/README-etcdutl.md @@ -0,0 +1,196 @@ +etcdutl +======== + +`etcdutl` is a command line administration utility for [etcd][etcd]. + +It's designed to operate directly on etcd data files. +For operations over a network, please use `etcdctl`. + +### DEFRAG [options] + +DEFRAG directly defragments an etcd data directory while etcd is not running. +When an etcd member reclaims storage space from deleted and compacted keys, the space is kept in a free list and the database file remains the same size. By defragmenting the database, the etcd member releases this free space back to the file system. + +In order to defrag a live etcd instances over the network, please use `etcdctl defrag` instead. + +#### Options + +- data-dir -- Optional. If present, defragments a data directory not in use by etcd. + +#### Output + +Exit status '0' when the process was successful. + +#### Example + +To defragment a data directory directly, use the `--data-dir` flag: + +``` bash +# Defragment while etcd is not running +./etcdutl defrag --data-dir default.etcd +# success (exit status 0) +# Error: cannot open database at default.etcd/member/snap/db +``` + +#### Remarks + +DEFRAG returns a zero exit code only if it succeeded in defragmenting all given endpoints. + + +### SNAPSHOT RESTORE [options] \ + +SNAPSHOT RESTORE creates an etcd data directory for an etcd cluster member from a backend database snapshot and a new cluster configuration. Restoring the snapshot into each member for a new cluster configuration will initialize a new etcd cluster preloaded by the snapshot data. + +#### Options + +The snapshot restore options closely resemble to those used in the `etcd` command for defining a cluster. + +- data-dir -- Path to the data directory. Uses \.etcd if none given. + +- wal-dir -- Path to the WAL directory. Uses data directory if none given. + +- initial-cluster -- The initial cluster configuration for the restored etcd cluster. + +- initial-cluster-token -- Initial cluster token for the restored etcd cluster. + +- initial-advertise-peer-urls -- List of peer URLs for the member being restored. + +- name -- Human-readable name for the etcd cluster member being restored. + +- skip-hash-check -- Ignore snapshot integrity hash value (required if copied from data directory) + +#### Output + +A new etcd data directory initialized with the snapshot. + +#### Example + +Save a snapshot, restore into a new 3 node cluster, and start the cluster: +``` +./etcdutl snapshot save snapshot.db + +# restore members +bin/etcdutl snapshot restore snapshot.db --initial-cluster-token etcd-cluster-1 --initial-advertise-peer-urls http://127.0.0.1:12380 --name sshot1 --initial-cluster 'sshot1=http://127.0.0.1:12380,sshot2=http://127.0.0.1:22380,sshot3=http://127.0.0.1:32380' +bin/etcdutl snapshot restore snapshot.db --initial-cluster-token etcd-cluster-1 --initial-advertise-peer-urls http://127.0.0.1:22380 --name sshot2 --initial-cluster 'sshot1=http://127.0.0.1:12380,sshot2=http://127.0.0.1:22380,sshot3=http://127.0.0.1:32380' +bin/etcdutl snapshot restore snapshot.db --initial-cluster-token etcd-cluster-1 --initial-advertise-peer-urls http://127.0.0.1:32380 --name sshot3 --initial-cluster 'sshot1=http://127.0.0.1:12380,sshot2=http://127.0.0.1:22380,sshot3=http://127.0.0.1:32380' + +# launch members +bin/etcd --name sshot1 --listen-client-urls http://127.0.0.1:2379 --advertise-client-urls http://127.0.0.1:2379 --listen-peer-urls http://127.0.0.1:12380 & +bin/etcd --name sshot2 --listen-client-urls http://127.0.0.1:22379 --advertise-client-urls http://127.0.0.1:22379 --listen-peer-urls http://127.0.0.1:22380 & +bin/etcd --name sshot3 --listen-client-urls http://127.0.0.1:32379 --advertise-client-urls http://127.0.0.1:32379 --listen-peer-urls http://127.0.0.1:32380 & +``` + +### SNAPSHOT STATUS \ + +SNAPSHOT STATUS lists information about a given backend database snapshot file. + +#### Output + +##### Simple format + +Prints a humanized table of the database hash, revision, total keys, and size. + +##### JSON format + +Prints a line of JSON encoding the database hash, revision, total keys, and size. + +#### Examples +```bash +./etcdutl snapshot status file.db +# cf1550fb, 3, 3, 25 kB +``` + +```bash +./etcdutl --write-out=json snapshot status file.db +# {"hash":3474280699,"revision":3,"totalKey":3,"totalSize":24576} +``` + +```bash +./etcdutl --write-out=table snapshot status file.db ++----------+----------+------------+------------+ +| HASH | REVISION | TOTAL KEYS | TOTAL SIZE | ++----------+----------+------------+------------+ +| cf1550fb | 3 | 3 | 25 kB | ++----------+----------+------------+------------+ +``` + +### VERSION + +Prints the version of etcdutl. + +#### Output + +Prints etcd version and API version. + +#### Examples + +```bash +./etcdutl version +# etcdutl version: 3.1.0-alpha.0+git +# API version: 3.1 +``` + +### VERSION + +Prints the version of etcdctl. + +#### Output + +Prints etcd version and API version. + +#### Examples + +```bash +./etcdutl version +# etcdutl version: 3.5.0 +# API version: 3.1 +``` + + +## Exit codes + +For all commands, a successful execution returns a zero exit code. All failures will return non-zero exit codes. + +## Output formats + +All commands accept an output format by setting `-w` or `--write-out`. All commands default to the "simple" output format, which is meant to be human-readable. The simple format is listed in each command's `Output` description since it is customized for each command. If a command has a corresponding RPC, it will respect all output formats. + +If a command fails, returning a non-zero exit code, an error string will be written to standard error regardless of output format. + +### Simple + +A format meant to be easy to parse and human-readable. Specific to each command. + +### JSON + +The JSON encoding of the command's [RPC response][etcdrpc]. Since etcd's RPCs use byte strings, the JSON output will encode keys and values in base64. + +Some commands without an RPC also support JSON; see the command's `Output` description. + +### Protobuf + +The protobuf encoding of the command's [RPC response][etcdrpc]. If an RPC is streaming, the stream messages will be concatenated. If an RPC is not given for a command, the protobuf output is not defined. + +### Fields + +An output format similar to JSON but meant to parse with coreutils. For an integer field named `Field`, it writes a line in the format `"Field" : %d` where `%d` is go's integer formatting. For byte array fields, it writes `"Field" : %q` where `%q` is go's quoted string formatting (e.g., `[]byte{'a', '\n'}` is written as `"a\n"`). + +## Compatibility Support + +etcdutl is still in its early stage. We try out best to ensure fully compatible releases, however we might break compatibility to fix bugs or improve commands. If we intend to release a version of etcdutl with backward incompatibilities, we will provide notice prior to release and have instructions on how to upgrade. + +### Input Compatibility + +Input includes the command name, its flags, and its arguments. We ensure backward compatibility of the input of normal commands in non-interactive mode. + +### Output Compatibility +Currently, we do not ensure backward compatibility of utility commands. + +### TODO: compatibility with etcd server + +[etcd]: https://github.com/coreos/etcd +[READMEv2]: READMEv2.md +[v2key]: ../store/node_extern.go#L28-L37 +[v3key]: ../api/mvccpb/kv.proto#L12-L29 +[etcdrpc]: ../api/etcdserverpb/rpc.proto +[storagerpc]: ../api/mvccpb/kv.proto diff --git a/etcd-v3.5.9-linux-amd64/README.md b/etcd-v3.5.9-linux-amd64/README.md new file mode 100644 index 00000000..fc438ae7 --- /dev/null +++ b/etcd-v3.5.9-linux-amd64/README.md @@ -0,0 +1,210 @@ +# etcd + +[![Go Report Card](https://goreportcard.com/badge/github.com/etcd-io/etcd?style=flat-square)](https://goreportcard.com/report/github.com/etcd-io/etcd) +[![Coverage](https://codecov.io/gh/etcd-io/etcd/branch/master/graph/badge.svg)](https://codecov.io/gh/etcd-io/etcd) +[![Tests](https://github.com/etcd-io/etcd/actions/workflows/tests.yaml/badge.svg)](https://github.com/etcd-io/etcd/actions/workflows/tests.yaml) +[![asset-transparency](https://github.com/etcd-io/etcd/actions/workflows/asset-transparency.yaml/badge.svg)](https://github.com/etcd-io/etcd/actions/workflows/asset-transparency.yaml) +[![codeql-analysis](https://github.com/etcd-io/etcd/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/etcd-io/etcd/actions/workflows/codeql-analysis.yml) +[![self-hosted-linux-arm64-graviton2-tests](https://github.com/etcd-io/etcd/actions/workflows/self-hosted-linux-arm64-graviton2-tests.yml/badge.svg)](https://github.com/etcd-io/etcd/actions/workflows/self-hosted-linux-arm64-graviton2-tests.yml) +[![Docs](https://img.shields.io/badge/docs-latest-green.svg)](https://etcd.io/docs) +[![Godoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](https://godoc.org/github.com/etcd-io/etcd) +[![Releases](https://img.shields.io/github/release/etcd-io/etcd/all.svg?style=flat-square)](https://github.com/etcd-io/etcd/releases) +[![LICENSE](https://img.shields.io/github/license/etcd-io/etcd.svg?style=flat-square)](https://github.com/etcd-io/etcd/blob/main/LICENSE) + +**Note**: The `main` branch may be in an *unstable or even broken state* during development. For stable versions, see [releases][github-release]. + +![etcd Logo](logos/etcd-horizontal-color.svg) + +etcd is a distributed reliable key-value store for the most critical data of a distributed system, with a focus on being: + +* *Simple*: well-defined, user-facing API (gRPC) +* *Secure*: automatic TLS with optional client cert authentication +* *Fast*: benchmarked 10,000 writes/sec +* *Reliable*: properly distributed using Raft + +etcd is written in Go and uses the [Raft][] consensus algorithm to manage a highly-available replicated log. + +etcd is used [in production by many companies](./ADOPTERS.md), and the development team stands behind it in critical deployment scenarios, where etcd is frequently teamed with applications such as [Kubernetes][k8s], [locksmith][], [vulcand][], [Doorman][], and many others. Reliability is further ensured by [**rigorous testing**](https://github.com/etcd-io/etcd/tree/main/tests/functional). + +See [etcdctl][etcdctl] for a simple command line client. + +[raft]: https://raft.github.io/ +[k8s]: http://kubernetes.io/ +[doorman]: https://github.com/youtube/doorman +[locksmith]: https://github.com/coreos/locksmith +[vulcand]: https://github.com/vulcand/vulcand +[etcdctl]: https://github.com/etcd-io/etcd/tree/main/etcdctl + +## Community meetings + +etcd contributors and maintainers have monthly (every four weeks) meetings at 11:00 AM (USA Pacific) on Thursday. + +An initial agenda will be posted to the [shared Google docs][shared-meeting-notes] a day before each meeting, and everyone is welcome to suggest additional topics or other agendas. + +[shared-meeting-notes]: https://docs.google.com/document/d/16XEGyPBisZvmmoIHSZzv__LoyOeluC5a4x353CX0SIM/edit + + +Time: +- [Jan 10th, 2019 11:00 AM video](https://www.youtube.com/watch?v=0Cphtbd1OSc&feature=youtu.be) +- [Feb 7th, 2019 11:00 AM video](https://youtu.be/U80b--oAlYM) +- [Mar 7th, 2019 11:00 AM video](https://youtu.be/w9TI5B7D1zg) +- [Apr 4th, 2019 11:00 AM video](https://youtu.be/oqQR2XH1L_A) +- [May 2nd, 2019 11:00 AM video](https://youtu.be/wFwQePuDWVw) +- [May 30th, 2019 11:00 AM video](https://youtu.be/2t1R5NATYG4) +- [Jul 11th, 2019 11:00 AM video](https://youtu.be/k_FZEipWD6Y) +- [Jul 25, 2019 11:00 AM video](https://youtu.be/VSUJTACO93I) +- [Aug 22, 2019 11:00 AM video](https://youtu.be/6IBQ-VxQmuM) +- [Sep 19, 2019 11:00 AM video](https://youtu.be/SqfxU9DhBOc) +- Nov 14, 2019 11:00 AM +- Dec 12, 2019 11:00 AM +- Jan 09, 2020 11:00 AM +- Feb 06, 2020 11:00 AM +- Mar 05, 2020 11:00 AM +- Apr 02, 2020 11:00 AM +- Apr 30, 2020 11:00 AM +- May 28, 2020 11:00 AM +- Jun 25, 2020 11:00 AM +- Jul 23, 2020 11:00 AM +- Aug 20, 2020 11:00 AM +- Sep 17, 2020 11:00 AM +- Oct 15, 2020 11:00 AM +- Nov 12, 2020 11:00 AM +- Dec 10, 2020 11:00 AM + +Join Hangouts Meet: [meet.google.com/umg-nrxn-qvs](https://meet.google.com/umg-nrxn-qvs) + +Join by phone: +1 405-792-0633‬ PIN: ‪299 906‬# + + +## Getting started + +### Getting etcd + +The easiest way to get etcd is to use one of the pre-built release binaries which are available for OSX, Linux, Windows, and Docker on the [release page][github-release]. + +For more installation guides, please check out [play.etcd.io](http://play.etcd.io) and [operating etcd](https://etcd.io/docs/latest/op-guide). + +For those wanting to try the very latest version, [build the latest version of etcd][dl-build] from the `main` branch. This first needs [*Go*](https://golang.org/) installed ([version 1.16+](/go.mod#L3) is required). All development occurs on `main`, including new features and bug fixes. Bug fixes are first targeted at `main` and subsequently ported to release branches, as described in the [branch management][branch-management] guide. + +[github-release]: https://github.com/etcd-io/etcd/releases +[branch-management]: https://etcd.io/docs/latest/branch_management +[dl-build]: https://etcd.io/docs/latest/dl-build#build-the-latest-version + +### Running etcd + +First start a single-member cluster of etcd. + +If etcd is installed using the [pre-built release binaries][github-release], run it from the installation location as below: + +```bash +/tmp/etcd-download-test/etcd +``` + +The etcd command can be simply run as such if it is moved to the system path as below: + +```bash +mv /tmp/etcd-download-test/etcd /usr/local/bin/ +etcd +``` + +If etcd is [built from the main branch][dl-build], run it as below: + +```bash +./bin/etcd +``` + +This will bring up etcd listening on port 2379 for client communication and on port 2380 for server-to-server communication. + +Next, let's set a single key, and then retrieve it: + +``` +etcdctl put mykey "this is awesome" +etcdctl get mykey +``` + +etcd is now running and serving client requests. For more, please check out: + +- [Interactive etcd playground](http://play.etcd.io) +- [Animated quick demo](https://etcd.io/docs/latest/demo) + +### etcd TCP ports + +The [official etcd ports][iana-ports] are 2379 for client requests, and 2380 for peer communication. + +[iana-ports]: http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.txt + +### Running a local etcd cluster + +First install [goreman](https://github.com/mattn/goreman), which manages Procfile-based applications. + +Our [Procfile script](./Procfile) will set up a local example cluster. Start it with: + +```bash +goreman start +``` + +This will bring up 3 etcd members `infra1`, `infra2` and `infra3` and optionally etcd `grpc-proxy`, which runs locally and composes a cluster. + +Every cluster member and proxy accepts key value reads and key value writes. + +Follow the steps in [Procfile.learner](./Procfile.learner) to add a learner node to the cluster. Start the learner node with: + +```bash +goreman -f ./Procfile.learner start +``` + +### Next steps + +Now it's time to dig into the full etcd API and other guides. + +- Read the full [documentation][]. +- Explore the full gRPC [API][]. +- Set up a [multi-machine cluster][clustering]. +- Learn the [config format, env variables and flags][configuration]. +- Find [language bindings and tools][integrations]. +- Use TLS to [secure an etcd cluster][security]. +- [Tune etcd][tuning]. + +[documentation]: https://etcd.io/docs/latest +[api]: https://etcd.io/docs/latest/learning/api +[clustering]: https://etcd.io/docs/latest/op-guide/clustering +[configuration]: https://etcd.io/docs/latest/op-guide/configuration +[integrations]: https://etcd.io/docs/latest/integrations +[security]: https://etcd.io/docs/latest/op-guide/security +[tuning]: https://etcd.io/docs/latest/tuning + +## Contact + +- Mailing list: [etcd-dev](https://groups.google.com/forum/?hl=en#!forum/etcd-dev) +- IRC: #[etcd](irc://irc.freenode.org:6667/#etcd) on freenode.org +- Planning/Roadmap: [milestones](https://github.com/etcd-io/etcd/milestones), [roadmap](./ROADMAP.md) +- Bugs: [issues](https://github.com/etcd-io/etcd/issues) + +## Contributing + +See [CONTRIBUTING](CONTRIBUTING.md) for details on submitting patches and the contribution workflow. + +## Reporting bugs + +See [reporting bugs](https://etcd.io/docs/latest/reporting-bugs) for details about reporting any issues. + +## Reporting a security vulnerability + +See [security disclosure and release process](security/README.md) for details on how to report a security vulnerability and how the etcd team manages it. + +## Issue and PR management + +See [issue triage guidelines](https://etcd.io/docs/current/triage/issues/) for details on how issues are managed. + +See [PR management](https://etcd.io/docs/current/triage/prs/) for guidelines on how pull requests are managed. + +## etcd Emeritus Maintainers + +These emeritus maintainers dedicated a part of their career to etcd and reviewed code, triaged bugs, and pushed the project forward over a substantial period of time. Their contribution is greatly appreciated. + +* Fanmin Shi +* Anthony Romano + +### License + +etcd is under the Apache 2.0 license. See the [LICENSE](LICENSE) file for details. diff --git a/etcd-v3.5.9-linux-amd64/READMEv2-etcdctl.md b/etcd-v3.5.9-linux-amd64/READMEv2-etcdctl.md new file mode 100644 index 00000000..8c7fc1e5 --- /dev/null +++ b/etcd-v3.5.9-linux-amd64/READMEv2-etcdctl.md @@ -0,0 +1,336 @@ +etcdctl +======== + +`etcdctl` is a command line client for [etcd][etcd]. +It can be used in scripts or for administrators to explore an etcd cluster. + +## Getting etcdctl + +The latest release is available as a binary at [Github][github-release] along with etcd. + +etcdctl can also be built from source using the build script found in the parent directory. + +## Configuration +### --debug ++ output cURL commands which can be used to reproduce the request + +### --no-sync ++ don't synchronize cluster information before sending request ++ Use this to access non-published client endpoints ++ Without this flag, values from `--endpoint` flag will be overwritten by etcd cluster when it does internal sync. + +### --output, -o ++ output response in the given format (`simple`, `extended` or `json`) ++ default: `"simple"` + +### --discovery-srv, -D ++ domain name to query for SRV records describing cluster endpoints ++ default: none ++ env variable: ETCDCTL_DISCOVERY_SRV + +### --peers ++ a comma-delimited list of machine addresses in the cluster ++ default: `"http://127.0.0.1:2379"` ++ env variable: ETCDCTL_PEERS + +### --endpoint ++ a comma-delimited list of machine addresses in the cluster ++ default: `"http://127.0.0.1:2379"` ++ env variable: ETCDCTL_ENDPOINT ++ Without `--no-sync` flag, this will be overwritten by etcd cluster when it does internal sync. + +### --cert-file ++ identify HTTPS client using this SSL certificate file ++ default: none ++ env variable: ETCDCTL_CERT_FILE + +### --key-file ++ identify HTTPS client using this SSL key file ++ default: none ++ env variable: ETCDCTL_KEY_FILE + +### --ca-file ++ verify certificates of HTTPS-enabled servers using this CA bundle ++ default: none ++ env variable: ETCDCTL_CA_FILE + +### --username, -u ++ provide username[:password] and prompt if password is not supplied ++ default: none ++ env variable: ETCDCTL_USERNAME + +### --timeout ++ connection timeout per request ++ default: `"1s"` + +### --total-timeout ++ timeout for the command execution (except watch) ++ default: `"5s"` + +## Usage + +### Setting Key Values + +Set a value on the `/foo/bar` key: + +```sh +$ etcdctl set /foo/bar "Hello world" +Hello world +``` + +Set a value on the `/foo/bar` key with a value that expires in 60 seconds: + +```sh +$ etcdctl set /foo/bar "Hello world" --ttl 60 +Hello world +``` + +Conditionally set a value on `/foo/bar` if the previous value was "Hello world": + +```sh +$ etcdctl set /foo/bar "Goodbye world" --swap-with-value "Hello world" +Goodbye world +``` + +Conditionally set a value on `/foo/bar` if the previous etcd index was 12: + +```sh +$ etcdctl set /foo/bar "Goodbye world" --swap-with-index 12 +Goodbye world +``` + +Create a new key `/foo/bar`, only if the key did not previously exist: + +```sh +$ etcdctl mk /foo/new_bar "Hello world" +Hello world +``` + +Create a new in-order key under dir `/fooDir`: + +```sh +$ etcdctl mk --in-order /fooDir "Hello world" +``` + +Create a new dir `/fooDir`, only if the key did not previously exist: + +```sh +$ etcdctl mkdir /fooDir +``` + +Update an existing key `/foo/bar`, only if the key already existed: + +```sh +$ etcdctl update /foo/bar "Hola mundo" +Hola mundo +``` + +Create or update a directory called `/mydir`: + +```sh +$ etcdctl setdir /mydir +``` + + +### Retrieving a key value + +Get the current value for a single key in the local etcd node: + +```sh +$ etcdctl get /foo/bar +Hello world +``` + +Get the value of a key with additional metadata in a parseable format: + +```sh +$ etcdctl -o extended get /foo/bar +Key: /foo/bar +Modified-Index: 72 +TTL: 0 +Etcd-Index: 72 +Raft-Index: 5611 +Raft-Term: 1 + +Hello World +``` + +### Listing a directory + +Explore the keyspace using the `ls` command + +```sh +$ etcdctl ls +/akey +/adir +$ etcdctl ls /adir +/adir/key1 +/adir/key2 +``` + +Add `--recursive` to recursively list subdirectories encountered. + +```sh +$ etcdctl ls --recursive +/akey +/adir +/adir/key1 +/adir/key2 +``` + +Directories can also have a trailing `/` added to output using `-p`. + +```sh +$ etcdctl ls -p +/akey +/adir/ +``` + +### Deleting a key + +Delete a key: + +```sh +$ etcdctl rm /foo/bar +``` + +Delete an empty directory or a key-value pair + +```sh +$ etcdctl rmdir /path/to/dir +``` + +or + +```sh +$ etcdctl rm /path/to/dir --dir +``` + +Recursively delete a key and all child keys: + +```sh +$ etcdctl rm /path/to/dir --recursive +``` + +Conditionally delete `/foo/bar` if the previous value was "Hello world": + +```sh +$ etcdctl rm /foo/bar --with-value "Hello world" +``` + +Conditionally delete `/foo/bar` if the previous etcd index was 12: + +```sh +$ etcdctl rm /foo/bar --with-index 12 +``` + +### Watching for changes + +Watch for only the next change on a key: + +```sh +$ etcdctl watch /foo/bar +Hello world +``` + +Continuously watch a key: + +```sh +$ etcdctl watch /foo/bar --forever +Hello world +.... client hangs forever until ctrl+C printing values as key change +``` + +Continuously watch a key, starting with a given etcd index: + +```sh +$ etcdctl watch /foo/bar --forever --index 12 +Hello world +.... client hangs forever until ctrl+C printing values as key change +``` + +Continuously watch a key and exec a program: + +```sh +$ etcdctl exec-watch /foo/bar -- sh -c "env | grep ETCD" +ETCD_WATCH_ACTION=set +ETCD_WATCH_VALUE=My configuration stuff +ETCD_WATCH_MODIFIED_INDEX=1999 +ETCD_WATCH_KEY=/foo/bar +ETCD_WATCH_ACTION=set +ETCD_WATCH_VALUE=My new configuration stuff +ETCD_WATCH_MODIFIED_INDEX=2000 +ETCD_WATCH_KEY=/foo/bar +``` + +Continuously and recursively watch a key and exec a program: +```sh +$ etcdctl exec-watch --recursive /foo -- sh -c "env | grep ETCD" +ETCD_WATCH_ACTION=set +ETCD_WATCH_VALUE=My configuration stuff +ETCD_WATCH_MODIFIED_INDEX=1999 +ETCD_WATCH_KEY=/foo/bar +ETCD_WATCH_ACTION=set +ETCD_WATCH_VALUE=My new configuration stuff +ETCD_WATCH_MODIFIED_INDEX=2000 +ETCD_WATCH_KEY=/foo/barbar +``` + +## Return Codes + +The following exit codes can be returned from etcdctl: + +``` +0 Success +1 Malformed etcdctl arguments +2 Failed to connect to host +3 Failed to auth (client cert rejected, ca validation failure, etc) +4 400 error from etcd +5 500 error from etcd +``` + +## Endpoint + +If the etcd cluster isn't available on `http://127.0.0.1:2379`, specify a `--endpoint` flag or `ETCDCTL_ENDPOINT` environment variable. One endpoint or a comma-separated list of endpoints can be listed. This option is ignored if the `--discovery-srv` option is provided. + +```sh +ETCDCTL_ENDPOINT="http://10.0.28.1:4002" etcdctl set my-key to-a-value +ETCDCTL_ENDPOINT="http://10.0.28.1:4002,http://10.0.28.2:4002,http://10.0.28.3:4002" etcdctl set my-key to-a-value +etcdctl --endpoint http://10.0.28.1:4002 my-key to-a-value +etcdctl --endpoint http://10.0.28.1:4002,http://10.0.28.2:4002,http://10.0.28.3:4002 etcdctl set my-key to-a-value +``` + +## Username and Password + +If the etcd cluster is protected by [authentication][authentication], specify username and password using the [`--username`][username-flag] or `ETCDCTL_USERNAME` environment variable. When `--username` flag or `ETCDCTL_USERNAME` environment variable doesn't contain password, etcdctl will prompt password in interactive mode. + +```sh +ETCDCTL_USERNAME="root:password" etcdctl set my-key to-a-value +``` + +## DNS Discovery + +To discover the etcd cluster through domain SRV records, specify a `--discovery-srv` flag or `ETCDCTL_DISCOVERY_SRV` environment variable. This option takes precedence over the `--endpoint` flag. + +```sh +ETCDCTL_DISCOVERY_SRV="some-domain" etcdctl set my-key to-a-value +etcdctl --discovery-srv some-domain set my-key to-a-value +``` + +## Project Details + +### Versioning + +etcdctl uses [semantic versioning][semver]. +Releases will follow lockstep with the etcd release cycle. + +### License + +etcdctl is under the Apache 2.0 license. See the [LICENSE][license] file for details. + +[authentication]: https://github.com/etcd-io/website/blob/main/content/docs/v2/authentication.md +[etcd]: https://github.com/coreos/etcd +[github-release]: https://github.com/coreos/etcd/releases/ +[license]: ../LICENSE +[semver]: http://semver.org/ +[username-flag]: #--username--u diff --git a/etcd-v3.5.9-linux-amd64/etcd b/etcd-v3.5.9-linux-amd64/etcd new file mode 100755 index 00000000..a6365a2a Binary files /dev/null and b/etcd-v3.5.9-linux-amd64/etcd differ diff --git a/etcd-v3.5.9-linux-amd64/etcdctl b/etcd-v3.5.9-linux-amd64/etcdctl new file mode 100755 index 00000000..1b9cf6a6 Binary files /dev/null and b/etcd-v3.5.9-linux-amd64/etcdctl differ diff --git a/etcd-v3.5.9-linux-amd64/etcdutl b/etcd-v3.5.9-linux-amd64/etcdutl new file mode 100755 index 00000000..19c03f8f Binary files /dev/null and b/etcd-v3.5.9-linux-amd64/etcdutl differ diff --git a/examples/edge_offload_agent.py b/examples/edge_offload_agent.py new file mode 100644 index 00000000..9c9beaf4 --- /dev/null +++ b/examples/edge_offload_agent.py @@ -0,0 +1,41 @@ +def handler(event): + try: + # Serverledge passes parameters directly as dictionary keys + data = event if isinstance(event, dict) else {} + + cpu_load = float(data.get("cpu_load", 0.75)) + queue_length = int(data.get("queue_length", 12)) + available_memory = float(data.get("available_memory", 424.0)) + except Exception: + cpu_load = 0.75 + queue_length = 12 + available_memory = 424.0 + + # AI Agent Multi-Metric Load Scoring Model + load_score = (cpu_load * 0.5) + (min(queue_length, 50) / 50 * 0.3) + (max(0, (1024 - available_memory) / 1024) * 0.2) + + if load_score > 0.85: + decision = "OFFLOAD_VERTICAL" + target_node = "cloud_datacenter_primary" + reasoning = "Critical congestion threshold reached; routing task upstream to cloud backend." + elif load_score > 0.65: + decision = "OFFLOAD_HORIZONTAL" + target_node = "peer_edge_node_rome_secondary" + reasoning = "Local node approaching capacity; offloading horizontally via etcd cluster coordination." + else: + decision = "PROCESS_LOCAL" + target_node = "current_edge_node_rome" + reasoning = "Node operating within stable capacity; executing locally in warm container pool." + + return { + "ai_agent_status": "active", + "calculated_load_score": round(load_score, 3), + "decision": decision, + "target_node": target_node, + "reasoning": reasoning, + "telemetry_evaluated": { + "cpu_load": cpu_load, + "queue_length": queue_length, + "available_memory_mb": available_memory + } + } \ No newline at end of file