List
Retrieves the list of Kubernetes cluster in the specified folder.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const ListClustersRequest =
cloudApi.dataproc.cluster_service.ListClustersRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.ClusterServiceClient);
const result = await client.list(
ListClustersRequest.fromPartial({
folderId: "folderId",
// pageSize: 0,
// pageToken: "pageToken",
// filter: "filter"
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.dataproc.v1.cluster_service_pb2_grpc import ClusterServiceStub
from yandex.cloud.dataproc.v1.cluster_service_pb2 import ListClustersRequest
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(ClusterServiceStub)
response = service.List(
ListClustersRequest(
folder_id="folderId",
# page_size = 0,
# page_token = "pageToken",
# filter = "filter"
)
)
print(response)
ListClustersRequest
folderId
: string
ID of the folder to list Kubernetes cluster in. To get the folder ID use a yandex.cloud.resourcemanager.v1.FolderService.List request.
pageSize
: int64
The maximum number of results per page to return. If the number of available results is larger than page_size, the service returns a ListClustersResponse.next_page_token that can be used to get the next page of results in subsequent list requests. Default value: 100.
pageToken
: string
Page token. To get the next page of results, set page_token
to the
ListClustersResponse.next_page_token returned by a previous list request.
filter
: string
A filter expression that filters resources listed in the response. The expression must specify:
- The field name. Currently you can use filtering only on Cluster.name field.
- An
=
operator. - The value in double quotes (
"
). Must be 3-63 characters long and match the regular expression[a-z][-a-z0-9]{1,61}[a-z0-9]
.
ListClustersResponse
clusters
: Cluster
List of Kubernetes cluster.
nextPageToken
: string
This token allows you to get the next page of results for list requests. If the number of results
is larger than ListClustersRequest.page_size, use
the next_page_token
as the value
for the ListClustersRequest.page_token query parameter
in the next list request. Each subsequent list request will have its own
next_page_token
to continue paging through the results.
Cluster
A Kubernetes cluster.
Status
STATUS_UNSPECIFIED
PROVISIONING
Kubernetes cluster is waiting for resources to be allocated.
RUNNING
Kubernetes cluster is running.
RECONCILING
Kubernetes cluster is being reconciled.
STOPPING
Kubernetes cluster is being stopped.
STOPPED
Kubernetes cluster stopped.
DELETING
Kubernetes cluster is being deleted.
STARTING
Kubernetes cluster is being started.
Health
HEALTH_UNSPECIFIED
HEALTHY
Kubernetes cluster is alive and well.
UNHEALTHY
Kubernetes cluster is inoperable.
id
: string
ID of the Kubernetes cluster.
folderId
: string
ID of the folder that the Kubernetes cluster belongs to.
createdAt
: google.protobuf.Timestamp
Creation timestamp.
name
: string
Name of the Kubernetes cluster.
description
: string
Description of the Kubernetes cluster. 0-256 characters long.
labels
: string
Resource labels as key:value
pairs. Maximum of 64 per resource.
status
: Status
Status of the Kubernetes cluster.
health
: Health
Health of the Kubernetes cluster.
networkId
: string
ID of the network the Kubernetes cluster belongs to.
master
: Master
Properties of the master for the Kubernetes cluster.
ipAllocationPolicy
: IPAllocationPolicy
Allocation policy for IP addresses of services and pods inside the Kubernetes cluster in different availability zones.
One of internetGateway
gatewayIpv4Address
: stringGateway IPv4 address.
serviceAccountId
: string
Service account to be used for provisioning Compute Cloud and VPC resources for Kubernetes cluster.
nodeServiceAccountId
: string
Service account to be used by the worker nodes of the Kubernetes cluster to access Container Registry or to push node logs and metrics.
releaseChannel
: ReleaseChannel
When creating a Kubernetes cluster, you should specify one of three release channels. The release channel contains several Kubernetes versions. Channels differ in the set of available versions, the management of auto-updates, and the updates received. You can't change the channel once the Kubernetes cluster is created, you can only recreate the Kubernetes cluster and specify a new release channel. For more details see documentation.
networkPolicy
: NetworkPolicy
kmsProvider
: KMSProvider
KMS provider configuration.
logGroupId
: string
Log group where cluster stores cluster system logs, like audit, events, or controlplane logs.
One of networkImplementation
cilium
: Cilium
Master
One of masterType
zonalMaster
: ZonalMasterParameters of the availability zone for the master.
regionalMaster
: RegionalMasterParameters of the region for the master.
locations
: Location
Locations specification for Kubernetes control-plane (master) instances.
etcdClusterSize
: int64
Number of etcd nodes in cluster.
version
: string
Version of Kubernetes components that runs on the master.
endpoints
: MasterEndpoints
Endpoints of the master. Endpoints constitute of scheme and port (i.e. https://ip-address:port
)
and can be used by the clients to communicate with the Kubernetes API of the Kubernetes cluster.
masterAuth
: MasterAuth
Master authentication parameters are used to establish trust between the master and a client.
versionInfo
: VersionInfo
Detailed information about the Kubernetes version that is running on the master.
maintenancePolicy
: MasterMaintenancePolicy
Maintenance policy of the master.
securityGroupIds
: string
Master security groups.
masterLogging
: MasterLogging
Cloud Logging for master components.
IPAllocationPolicy
clusterIpv4CidrBlock
: string
CIDR block. IP range for allocating pod addresses.
It should not overlap with any subnet in the network the Kubernetes cluster located in. Static routes will be set up for this CIDR blocks in node subnets.
nodeIpv4CidrMaskSize
: int64
Size of the masks that are assigned for each node in the cluster.
If not specified, 24 is used.
serviceIpv4CidrBlock
: string
CIDR block. IP range Kubernetes service Kubernetes cluster IP addresses will be allocated from.
It should not overlap with any subnet in the network the Kubernetes cluster located in.
clusterIpv6CidrBlock
: string
IPv6 range for allocating pod IP addresses.
serviceIpv6CidrBlock
: string
IPv6 range for allocating Kubernetes service IP addresses
NetworkPolicy
Provider
PROVIDER_UNSPECIFIED
CALICO
provider
: Provider
KMSProvider
keyId
: string
KMS key ID for secrets encryption. To obtain a KMS key ID use a yandex.cloud.kms.v1.SymmetricKeyService.List request.
Cilium
RoutingMode
ROUTING_MODE_UNSPECIFIED
TUNNEL
routingMode
: RoutingMode
ZonalMaster
zoneId
: string
ID of the availability zone where the master resides.
internalV4Address
: string
IPv4 internal network address that is assigned to the master.
externalV4Address
: string
IPv4 external network address that is assigned to the master.
RegionalMaster
regionId
: string
ID of the region where the master resides.
internalV4Address
: string
IPv4 internal network address that is assigned to the master.
externalV4Address
: string
IPv4 external network address that is assigned to the master.
externalV6Address
: string
IPv6 external network address that is assigned to the master.
Location
zoneId
: string
ID of the availability zone where the master resides.
subnetId
: string
ID of the VPC network's subnet where the master resides.
MasterEndpoints
internalV4Endpoint
: string
Internal endpoint that can be used to connect to the master from cloud networks.
externalV4Endpoint
: string
External endpoint that can be used to access Kubernetes cluster API from the internet (outside of the cloud).
externalV6Endpoint
: string
External IPv6 endpoint that can be used to access Kubernetes cluster API from the internet (outside of the cloud).
MasterAuth
clusterCaCertificate
: string
PEM-encoded public certificate that is the root of trust for the Kubernetes cluster.
VersionInfo
currentVersion
: string
Current Kubernetes version, format: major.minor (e.g. 1.15).
newRevisionAvailable
: bool
Newer revisions may include Kubernetes patches (e.g 1.15.1 -> 1.15.2) as well as some internal component updates - new features or bug fixes in platform specific components either on the master or nodes.
newRevisionSummary
: string
Description of the changes to be applied when updating to the latest revision. Empty if new_revision_available is false.
versionDeprecated
: bool
The current version is on the deprecation schedule, component (master or node group) should be upgraded.
MasterMaintenancePolicy
autoUpgrade
: bool
If set to true, automatic updates are installed in the specified period of time with no interaction from the user. If set to false, automatic upgrades are disabled.
maintenanceWindow
: MaintenanceWindow
Maintenance window settings. Update will start at the specified time and last no more than the specified duration. The time is set in UTC.
MasterLogging
enabled
: bool
Identifies whether Cloud Logging is enabled for master components.
One of destination
The destination of master components' logs.
logGroupId
: stringID of the log group where logs of master components should be stored.
folderId
: stringID of the folder where logs should be stored (in default group).
auditEnabled
: bool
Identifies whether Cloud Logging is enabled for audit logs.
clusterAutoscalerEnabled
: bool
Identifies whether Cloud Logging is enabled for cluster-autoscaler.
kubeApiserverEnabled
: bool
Identifies whether Cloud Logging is enabled for kube-apiserver.
eventsEnabled
: bool
Identifies whether Cloud Logging is enabled for events.
MaintenanceWindow
One of policy
Maintenance policy.
anytime
: AnytimeMaintenanceWindowUpdating the master at any time.
dailyMaintenanceWindow
: DailyMaintenanceWindowUpdating the master on any day during the specified time window.
weeklyMaintenanceWindow
: WeeklyMaintenanceWindowUpdating the master on selected days during the specified time window.
AnytimeMaintenanceWindow
DailyMaintenanceWindow
startTime
: google.type.TimeOfDay
Window start time, in the UTC timezone.
duration
: google.protobuf.Duration
Window duration.
WeeklyMaintenanceWindow
daysOfWeek
: DaysOfWeekMaintenanceWindow
Days of the week and the maintenance window for these days when automatic updates are allowed.
DaysOfWeekMaintenanceWindow
days
: google.type.DayOfWeek
Days of the week when automatic updates are allowed.
startTime
: google.type.TimeOfDay
Window start time, in the UTC timezone.
duration
: google.protobuf.Duration
Window duration.