Get
Returns information about specified host type.
- TypeScript
- Python
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);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.compute.v1.host_type_service_pb2 import GetHostTypeRequest
from yandex.cloud.compute.v1.host_type_service_pb2_grpc import HostTypeServiceStub
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(HostTypeServiceStub)
response = service.Get(GetHostTypeRequest(host_type_id="hostTypeId"))
print(response)
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