Skip to main content

Get

Returns information about specified host type.

import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";

const GetHostTypeRequest =
cloudApi.compute.host_type_service.GetHostTypeRequest;

(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.HostTypeServiceClient);

const result = await client.get(
GetHostTypeRequest.fromPartial({
hostTypeId: "hostTypeId",
})
);
console.log(result);
})();

GetHostTypeRequest

hostTypeId : string

ID of the host type to return.

To get a host type ID make a HostTypeService.List request.

HostType

Represents host resources. Note: Platform can use hosts with different number of memory and cores. TODO: Do we need sockets here?

id : string

Unique type identifier.

cores : int64

Total number of cores available for instances.

memory : int64

Ammount of memory available for instances.

disks : int64

Number of local disks available for instances

diskSize : int64

Size of each local disk