Get
Returns the specified host group.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const GetHostGroupRequest =
cloudApi.compute.host_group_service.GetHostGroupRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.HostGroupServiceClient);
const result = await client.get(
GetHostGroupRequest.fromPartial({
hostGroupId: "hostGroupId",
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.compute.v1.host_group_service_pb2 import GetHostGroupRequest
from yandex.cloud.compute.v1.host_group_service_pb2_grpc import HostGroupServiceStub
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(HostGroupServiceStub)
response = service.Get(GetHostGroupRequest(host_group_id="hostGroupId"))
print(response)
GetHostGroupRequest
hostGroupId
: string
ID of the host group to return. To get the host group ID, use HostGroupService.List request.
HostGroup
Represents group of dedicated hosts
Status
STATUS_UNSPECIFIED
CREATING
READY
UPDATING
DELETING
id
: string
ID of the group.
folderId
: string
ID of the folder that the group belongs to.
createdAt
: google.protobuf.Timestamp
Creation timestamp in RFC3339 text format.
name
: string
Name of the group. The name is unique within the folder.
description
: string
Description of the group.
labels
: string
Resource labels as key:value
pairs.
zoneId
: string
Availability zone where all dedicated hosts are allocated.
status
: Status
Status of the group.
typeId
: string
ID of host type. Resources provided by each host of the group.
maintenancePolicy
: MaintenancePolicy
Behaviour on maintenance events.
scalePolicy
: ScalePolicy
Scale policy. Only fixed number of hosts are supported at this moment.
ScalePolicy
FixedScale
size
: int64
One of scaleType
fixedScale
: FixedScale