Get
Returns the specified Elasticsearch user.
To get the list of available Elasticsearch users, make a List request.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const GetUserRequest = cloudApi.mdb.clickhouse_user_service.GetUserRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.UserServiceClient);
const result = await client.get(
GetUserRequest.fromPartial({
clusterId: "clusterId",
userName: "userName",
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.mdb.clickhouse.v1.user_service_pb2 import GetUserRequest
from yandex.cloud.mdb.clickhouse.v1.user_service_pb2_grpc import UserServiceStub
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(UserServiceStub)
response = service.Get(GetUserRequest(cluster_id="clusterId", user_name="userName"))
print(response)
GetUserRequest
clusterId
: string
ID of the Elasticsearch cluster the user belongs to.
To get the cluster ID, make a ClusterService.List request.
userName
: string
Name of the Elasticsearch user to return.
To get the name of the user, make a UserService.List request.
User
An Elasticsearch user.
name
: string
Name of the Elasticsearch user.
clusterId
: string
ID of the Elasticsearch cluster the user belongs to.