Get desktop application:
View/edit binary Protocol Buffers messages
The lock service exposes client-side locking facilities as a gRPC interface.
Lock acquires a distributed shared lock on a given named lock. On success, it will return a unique key that exists so long as the lock is held by the caller. This key can be used in conjunction with transactions to safely ensure updates to etcd only occur while holding lock ownership. The lock is held until Unlock is called on the key or the lease associate with the owner expires.
option (google.api.http) = { post: "/v3/lock/lock" body: "*" };
name is the identifier for the distributed shared lock to be acquired.
lease is the ID of the lease that will be attached to ownership of the lock. If the lease expires or is revoked and currently holds the lock, the lock is automatically released. Calls to Lock with the same lease will be treated as a single acquisition; locking twice with the same lease is a no-op.
key is a key that will exist on etcd for the duration that the Lock caller owns the lock. Users should not modify this key or the lock may exhibit undefined behavior.
Unlock takes a key returned by Lock and releases the hold on lock. The next Lock caller waiting for the lock will then be woken up and given ownership of the lock.
option (google.api.http) = { post: "/v3/lock/unlock" body: "*" };
key is the lock ownership key granted by Lock.