Skip to main content

Get

Returns the specified MongoDB User resource.

To get the list of available MongoDB User resources, make a List request.

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);
})();

GetUserRequest

clusterId : string

ID of the MongoDB cluster the user belongs to. To get the cluster ID, use a ClusterService.List request.

userName : string

Name of the MongoDB User resource to return. To get the name of the user, use a UserService.List request.

User

A MongoDB User resource. For more information, see the Developer's Guide.

name : string

Name of the MongoDB user.

clusterId : string

ID of the MongoDB cluster the user belongs to.

permissions : Permission

Set of permissions granted to the user.

Permission

databaseName : string

Name of the database that the permission grants access to.

roles : string

MongoDB roles for the database_name database that the permission grants.