List
Retrieves the list of MySQL clusters that belong to 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 MySQL clusters 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.
pageToken
: string
Page token. To get the next page of results, set page_token to the ListClustersResponse.next_page_token returned by the 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 only use filtering with the Cluster.name field.
- An
=
operator. - The value in double quotes (
"
). Must be 1-63 characters long and match the regular expression[a-zA-Z0-9_-]+
.
ListClustersResponse
clusters
: Cluster
List of MySQL clusters.
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 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 MySQL cluster. For more information, see the documentation.
Environment
ENVIRONMENT_UNSPECIFIED
PRODUCTION
Stable environment with a conservative update policy: only hotfixes are applied during regular maintenance.
PRESTABLE
Environment with more aggressive update policy: new versions are rolled out irrespective of backward compatibility.
Health
HEALTH_UNKNOWN
State of the cluster is unknown ([Host.health][11] for every host in the cluster is UNKNOWN).
ALIVE
Cluster is alive and well ([Host.health][12] for every host in the cluster is ALIVE).
DEAD
Cluster is inoperable ([Host.health][13] for every host in the cluster is DEAD).
DEGRADED
Cluster is working below capacity ([Host.health][14] for at least one host in the cluster is not ALIVE).
Status
STATUS_UNKNOWN
Cluster state is unknown.
CREATING
Cluster is being created.
RUNNING
Cluster is running normally.
ERROR
Cluster encountered a problem and cannot operate.
UPDATING
Cluster is being updated.
STOPPING
Cluster is stopping.
STOPPED
Cluster stopped.
STARTING
Cluster is starting.
id
: string
ID of the MySQL cluster. This ID is assigned by Managed Service for MySQL at creation time.
folderId
: string
ID of the folder that the MySQL cluster belongs to.
createdAt
: google.protobuf.Timestamp
name
: string
Name of the MySQL cluster. The name must be unique within the folder, comply with RFC 1035 and be 1-63 characters long.
description
: string
Description of the MySQL cluster. 0-256 characters long.
labels
: string
Custom labels for the MySQL cluster as key:value
pairs.
Maximum 64 per resource.
environment
: Environment
Deployment environment of the MySQL cluster.
monitoring
: Monitoring
Description of monitoring systems relevant to the MySQL cluster.
config
: ClusterConfig
Configuration of the MySQL cluster.
networkId
: string
ID of the network that the cluster belongs to.
health
: Health
Aggregated cluster health.
status
: Status
Current state of the cluster.
Monitoring
name
: string
Name of the monitoring system.
description
: string
Description of the monitoring system.
link
: string
Link to the monitoring system charts for the MySQL cluster.
ClusterConfig
version
: string
Version of MySQL server software.
One of mysqlConfig
Configuration for MySQL servers in the cluster.
mysqlConfig_5_7
: config.MysqlConfigSet5_7Configuration of a MySQL 5.7 server.
resources
: Resources
Resources allocated to MySQL hosts.
backupWindowStart
: google.type.TimeOfDay
Time to start the daily backup, in the UTC timezone.
MysqlConfigSet5_7
effectiveConfig
: MysqlConfig5_7
Effective settings for a MySQL 5.7 cluster (a combination of settings defined in user_config and default_config).
userConfig
: MysqlConfig5_7
User-defined settings for a MySQL 5.7 cluster.
defaultConfig
: MysqlConfig5_7
Default configuration for a MySQL 5.7 cluster.
Resources
resourcePresetId
: string
ID of the preset for computational resources available to a host (CPU, memory etc.). All available presets are listed in the documentation.
diskSize
: int64
Volume of the storage available to a host.
diskTypeId
: string
Type of the storage environment for the host. Possible values:
- network-ssd - network SSD drive,
- local-ssd - local SSD storage.
MysqlConfig5_7
Options and structure of MysqlConfig5_7
reflects MySQL 5.7 configuration file
innodbBufferPoolSize
: google.protobuf.Int64Value
Size of the InnoDB buffer pool used for caching table and index data.
For details, see MySQL documentation for the parameter.
maxConnections
: google.protobuf.Int64Value
The maximum permitted number of simultaneous client connections.
For details, see MySQL documentation for the variable.
longQueryTime
: google.protobuf.DoubleValue
Time that it takes to process a query before it is considered slow.
For details, see MySQL documentation for the variable.