Create
Creates a user in a cluster.
- TypeScript
- Python
import {
cloudApi,
decodeMessage,
serviceClients,
Session,
waitForOperation,
} from "@yandex-cloud/nodejs-sdk";
const CreateUserRequest =
cloudApi.mdb.clickhouse_user_service.CreateUserRequest;
const User = cloudApi.datasphere.user.User;
const UserSettings_CountDistinctImplementation =
cloudApi.mdb.clickhouse_user.UserSettings_CountDistinctImplementation;
const UserSettings_DateTimeInputFormat =
cloudApi.mdb.clickhouse_user.UserSettings_DateTimeInputFormat;
const UserSettings_DateTimeOutputFormat =
cloudApi.mdb.clickhouse_user.UserSettings_DateTimeOutputFormat;
const UserSettings_DistributedProductMode =
cloudApi.mdb.clickhouse_user.UserSettings_DistributedProductMode;
const UserSettings_FormatRegexpEscapingRule =
cloudApi.mdb.clickhouse_user.UserSettings_FormatRegexpEscapingRule;
const UserSettings_GroupByOverflowMode =
cloudApi.mdb.clickhouse_user.UserSettings_GroupByOverflowMode;
const UserSettings_JoinAlgorithm =
cloudApi.mdb.clickhouse_user.UserSettings_JoinAlgorithm;
const UserSettings_LoadBalancing =
cloudApi.mdb.clickhouse_user.UserSettings_LoadBalancing;
const UserSettings_LocalFilesystemReadMethod =
cloudApi.mdb.clickhouse_user.UserSettings_LocalFilesystemReadMethod;
const UserSettings_OverflowMode =
cloudApi.mdb.clickhouse_user.UserSettings_OverflowMode;
const UserSettings_QuotaMode =
cloudApi.mdb.clickhouse_user.UserSettings_QuotaMode;
const UserSettings_RemoteFilesystemReadMethod =
cloudApi.mdb.clickhouse_user.UserSettings_RemoteFilesystemReadMethod;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.UserServiceClient);
const operation = await client.create(
CreateUserRequest.fromPartial({
clusterId: "clusterId",
userSpec: {
name: "name",
password: "password",
// permissions: [{
// databaseName: "databaseName"
// }],
// settings: {
// readonly: {
// value: 0
// },
// allowDdl: {
// value: true
// },
// allowIntrospectionFunctions: {
// value: true
// },
// connectTimeout: {
// value: 0
// },
// connectTimeoutWithFailover: {
// value: 0
// },
// receiveTimeout: {
// value: 0
// },
// sendTimeout: {
// value: 0
// },
// timeoutBeforeCheckingExecutionSpeed: {
// value: 0
// },
// insertQuorum: {
// value: 0
// },
// insertQuorumTimeout: {
// value: 0
// },
// insertQuorumParallel: {
// value: true
// },
// insertNullAsDefault: {
// value: true
// },
// selectSequentialConsistency: {
// value: true
// },
// deduplicateBlocksInDependentMaterializedViews: {
// value: true
// },
// replicationAlterPartitionsSync: {
// value: 0
// },
// maxReplicaDelayForDistributedQueries: {
// value: 0
// },
// fallbackToStaleReplicasForDistributedQueries: {
// value: true
// },
// distributedProductMode: UserSettings_DistributedProductMode.DISTRIBUTED_PRODUCT_MODE_DENY,
// distributedAggregationMemoryEfficient: {
// value: true
// },
// distributedDdlTaskTimeout: {
// value: 0
// },
// skipUnavailableShards: {
// value: true
// },
// compileExpressions: {
// value: true
// },
// minCountToCompileExpression: {
// value: 0
// },
// maxBlockSize: {
// value: 0
// },
// minInsertBlockSizeRows: {
// value: 0
// },
// minInsertBlockSizeBytes: {
// value: 0
// },
// maxInsertBlockSize: {
// value: 0
// },
// minBytesToUseDirectIo: {
// value: 0
// },
// useUncompressedCache: {
// value: true
// },
// mergeTreeMaxRowsToUseCache: {
// value: 0
// },
// mergeTreeMaxBytesToUseCache: {
// value: 0
// },
// mergeTreeMinRowsForConcurrentRead: {
// value: 0
// },
// mergeTreeMinBytesForConcurrentRead: {
// value: 0
// },
// maxBytesBeforeExternalGroupBy: {
// value: 0
// },
// maxBytesBeforeExternalSort: {
// value: 0
// },
// groupByTwoLevelThreshold: {
// value: 0
// },
// groupByTwoLevelThresholdBytes: {
// value: 0
// },
// priority: {
// value: 0
// },
// maxThreads: {
// value: 0
// },
// maxMemoryUsage: {
// value: 0
// },
// maxMemoryUsageForUser: {
// value: 0
// },
// maxNetworkBandwidth: {
// value: 0
// },
// maxNetworkBandwidthForUser: {
// value: 0
// },
// maxPartitionsPerInsertBlock: {
// value: 0
// },
// maxConcurrentQueriesForUser: {
// value: 0
// },
// forceIndexByDate: {
// value: true
// },
// forcePrimaryKey: {
// value: true
// },
// maxRowsToRead: {
// value: 0
// },
// maxBytesToRead: {
// value: 0
// },
// readOverflowMode: UserSettings_OverflowMode.OVERFLOW_MODE_THROW,
// maxRowsToGroupBy: {
// value: 0
// },
// groupByOverflowMode: UserSettings_GroupByOverflowMode.GROUP_BY_OVERFLOW_MODE_THROW,
// maxRowsToSort: {
// value: 0
// },
// maxBytesToSort: {
// value: 0
// },
// sortOverflowMode: UserSettings_OverflowMode.OVERFLOW_MODE_THROW,
// maxResultRows: {
// value: 0
// },
// maxResultBytes: {
// value: 0
// },
// resultOverflowMode: UserSettings_OverflowMode.OVERFLOW_MODE_THROW,
// maxRowsInDistinct: {
// value: 0
// },
// maxBytesInDistinct: {
// value: 0
// },
// distinctOverflowMode: UserSettings_OverflowMode.OVERFLOW_MODE_THROW,
// maxRowsToTransfer: {
// value: 0
// },
// maxBytesToTransfer: {
// value: 0
// },
// transferOverflowMode: UserSettings_OverflowMode.OVERFLOW_MODE_THROW,
// maxExecutionTime: {
// value: 0
// },
// timeoutOverflowMode: UserSettings_OverflowMode.OVERFLOW_MODE_THROW,
// maxRowsInSet: {
// value: 0
// },
// maxBytesInSet: {
// value: 0
// },
// setOverflowMode: UserSettings_OverflowMode.OVERFLOW_MODE_THROW,
// maxRowsInJoin: {
// value: 0
// },
// maxBytesInJoin: {
// value: 0
// },
// joinOverflowMode: UserSettings_OverflowMode.OVERFLOW_MODE_THROW,
// joinAlgorithm: [UserSettings_JoinAlgorithm.JOIN_ALGORITHM_HASH],
// anyJoinDistinctRightTableKeys: {
// value: true
// },
// maxColumnsToRead: {
// value: 0
// },
// maxTemporaryColumns: {
// value: 0
// },
// maxTemporaryNonConstColumns: {
// value: 0
// },
// maxQuerySize: {
// value: 0
// },
// maxAstDepth: {
// value: 0
// },
// maxAstElements: {
// value: 0
// },
// maxExpandedAstElements: {
// value: 0
// },
// minExecutionSpeed: {
// value: 0
// },
// minExecutionSpeedBytes: {
// value: 0
// },
// countDistinctImplementation: UserSettings_CountDistinctImplementation.COUNT_DISTINCT_IMPLEMENTATION_UNIQ,
// inputFormatValuesInterpretExpressions: {
// value: true
// },
// inputFormatDefaultsForOmittedFields: {
// value: true
// },
// inputFormatNullAsDefault: {
// value: true
// },
// dateTimeInputFormat: UserSettings_DateTimeInputFormat.DATE_TIME_INPUT_FORMAT_BEST_EFFORT,
// inputFormatWithNamesUseHeader: {
// value: true
// },
// outputFormatJsonQuote_64bitIntegers: {
// value: true
// },
// outputFormatJsonQuoteDenormals: {
// value: true
// },
// dateTimeOutputFormat: UserSettings_DateTimeOutputFormat.DATE_TIME_OUTPUT_FORMAT_SIMPLE,
// lowCardinalityAllowInNativeFormat: {
// value: true
// },
// allowSuspiciousLowCardinalityTypes: {
// value: true
// },
// emptyResultForAggregationByEmptySet: {
// value: true
// },
// httpConnectionTimeout: {
// value: 0
// },
// httpReceiveTimeout: {
// value: 0
// },
// httpSendTimeout: {
// value: 0
// },
// enableHttpCompression: {
// value: true
// },
// sendProgressInHttpHeaders: {
// value: true
// },
// httpHeadersProgressInterval: {
// value: 0
// },
// addHttpCorsHeader: {
// value: true
// },
// cancelHttpReadonlyQueriesOnClientClose: {
// value: true
// },
// maxHttpGetRedirects: {
// value: 0
// },
// joinedSubqueryRequiresAlias: {
// value: true
// },
// joinUseNulls: {
// value: true
// },
// transformNullIn: {
// value: true
// },
// quotaMode: UserSettings_QuotaMode.QUOTA_MODE_DEFAULT,
// flattenNested: {
// value: true
// },
// formatRegexp: "formatRegexp",
// formatRegexpEscapingRule: UserSettings_FormatRegexpEscapingRule.FORMAT_REGEXP_ESCAPING_RULE_ESCAPED,
// formatRegexpSkipUnmatched: {
// value: true
// },
// asyncInsert: {
// value: true
// },
// asyncInsertThreads: {
// value: 0
// },
// waitForAsyncInsert: {
// value: true
// },
// waitForAsyncInsertTimeout: {
// value: 0
// },
// asyncInsertMaxDataSize: {
// value: 0
// },
// asyncInsertBusyTimeout: {
// value: 0
// },
// asyncInsertStaleTimeout: {
// value: 0
// },
// memoryProfilerStep: {
// value: 0
// },
// memoryProfilerSampleProbability: {
// value: 0
// },
// maxFinalThreads: {
// value: 0
// },
// inputFormatParallelParsing: {
// value: true
// },
// inputFormatImportNestedJson: {
// value: true
// },
// localFilesystemReadMethod: UserSettings_LocalFilesystemReadMethod.LOCAL_FILESYSTEM_READ_METHOD_READ,
// maxReadBufferSize: {
// value: 0
// },
// insertKeeperMaxRetries: {
// value: 0
// },
// maxTemporaryDataOnDiskSizeForUser: {
// value: 0
// },
// maxTemporaryDataOnDiskSizeForQuery: {
// value: 0
// },
// maxParserDepth: {
// value: 0
// },
// remoteFilesystemReadMethod: UserSettings_RemoteFilesystemReadMethod.REMOTE_FILESYSTEM_READ_METHOD_READ,
// memoryOvercommitRatioDenominator: {
// value: 0
// },
// memoryOvercommitRatioDenominatorForUser: {
// value: 0
// },
// memoryUsageOvercommitMaxWaitMicroseconds: {
// value: 0
// },
// logQueryThreads: {
// value: true
// },
// maxInsertThreads: {
// value: 0
// },
// useHedgedRequests: {
// value: true
// },
// idleConnectionTimeout: {
// value: 0
// },
// hedgedConnectionTimeoutMs: {
// value: 0
// },
// loadBalancing: UserSettings_LoadBalancing.LOAD_BALANCING_RANDOM,
// preferLocalhostReplica: {
// value: true
// },
// compile: {
// value: true
// },
// minCountToCompile: {
// value: 0
// }
// },
// quotas: [{
// intervalDuration: {
// value: 0
// },
// queries: {
// value: 0
// },
// errors: {
// value: 0
// },
// resultRows: {
// value: 0
// },
// readRows: {
// value: 0
// },
// executionTime: {
// value: 0
// }
// }]
},
})
);
const finishedOp = await waitForOperation(operation, session);
if (finishedOp.response) {
const result = decodeMessage<typeof User>(finishedOp.response);
console.log(result);
}
})();
import os
import grpc
import yandexcloud
from yandex.cloud.mdb.clickhouse.v1.user_service_pb2 import CreateUserMetadata
from yandex.cloud.mdb.clickhouse.v1.user_service_pb2 import CreateUserRequest
from yandex.cloud.mdb.clickhouse.v1.user_pb2 import Permission
from yandex.cloud.datasphere.v2.user_pb2 import User
from yandex.cloud.mdb.clickhouse.v1.user_pb2 import UserQuota
from yandex.cloud.mdb.clickhouse.v1.user_service_pb2_grpc import UserServiceStub
from yandex.cloud.mdb.clickhouse.v1.user_pb2 import UserSettings
from yandex.cloud.mdb.clickhouse.v1.user_pb2 import UserSpec
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(UserServiceStub)
operation = service.Create(
CreateUserRequest(
cluster_id="clusterId",
user_spec=UserSpec(
name="name",
password="password",
# permissions = [Permission(
# database_name = "databaseName"
# )],
# settings = UserSettings(
# readonly = Int64Value(
# value = 0
# ),
# allow_ddl = BoolValue(
# value = true
# ),
# allow_introspection_functions = BoolValue(
# value = true
# ),
# connect_timeout = Int64Value(
# value = 0
# ),
# connect_timeout_with_failover = Int64Value(
# value = 0
# ),
# receive_timeout = Int64Value(
# value = 0
# ),
# send_timeout = Int64Value(
# value = 0
# ),
# timeout_before_checking_execution_speed = Int64Value(
# value = 0
# ),
# insert_quorum = Int64Value(
# value = 0
# ),
# insert_quorum_timeout = Int64Value(
# value = 0
# ),
# insert_quorum_parallel = BoolValue(
# value = true
# ),
# insert_null_as_default = BoolValue(
# value = true
# ),
# select_sequential_consistency = BoolValue(
# value = true
# ),
# deduplicate_blocks_in_dependent_materialized_views = BoolValue(
# value = true
# ),
# replication_alter_partitions_sync = Int64Value(
# value = 0
# ),
# max_replica_delay_for_distributed_queries = Int64Value(
# value = 0
# ),
# fallback_to_stale_replicas_for_distributed_queries = BoolValue(
# value = true
# ),
# distributed_product_mode = UserSettings.DistributedProductMode.DISTRIBUTED_PRODUCT_MODE_DENY,
# distributed_aggregation_memory_efficient = BoolValue(
# value = true
# ),
# distributed_ddl_task_timeout = Int64Value(
# value = 0
# ),
# skip_unavailable_shards = BoolValue(
# value = true
# ),
# compile_expressions = BoolValue(
# value = true
# ),
# min_count_to_compile_expression = Int64Value(
# value = 0
# ),
# max_block_size = Int64Value(
# value = 0
# ),
# min_insert_block_size_rows = Int64Value(
# value = 0
# ),
# min_insert_block_size_bytes = Int64Value(
# value = 0
# ),
# max_insert_block_size = Int64Value(
# value = 0
# ),
# min_bytes_to_use_direct_io = Int64Value(
# value = 0
# ),
# use_uncompressed_cache = BoolValue(
# value = true
# ),
# merge_tree_max_rows_to_use_cache = Int64Value(
# value = 0
# ),
# merge_tree_max_bytes_to_use_cache = Int64Value(
# value = 0
# ),
# merge_tree_min_rows_for_concurrent_read = Int64Value(
# value = 0
# ),
# merge_tree_min_bytes_for_concurrent_read = Int64Value(
# value = 0
# ),
# max_bytes_before_external_group_by = Int64Value(
# value = 0
# ),
# max_bytes_before_external_sort = Int64Value(
# value = 0
# ),
# group_by_two_level_threshold = Int64Value(
# value = 0
# ),
# group_by_two_level_threshold_bytes = Int64Value(
# value = 0
# ),
# priority = Int64Value(
# value = 0
# ),
# max_threads = Int64Value(
# value = 0
# ),
# max_memory_usage = Int64Value(
# value = 0
# ),
# max_memory_usage_for_user = Int64Value(
# value = 0
# ),
# max_network_bandwidth = Int64Value(
# value = 0
# ),
# max_network_bandwidth_for_user = Int64Value(
# value = 0
# ),
# max_partitions_per_insert_block = Int64Value(
# value = 0
# ),
# max_concurrent_queries_for_user = Int64Value(
# value = 0
# ),
# force_index_by_date = BoolValue(
# value = true
# ),
# force_primary_key = BoolValue(
# value = true
# ),
# max_rows_to_read = Int64Value(
# value = 0
# ),
# max_bytes_to_read = Int64Value(
# value = 0
# ),
# read_overflow_mode = UserSettings.OverflowMode.OVERFLOW_MODE_THROW,
# max_rows_to_group_by = Int64Value(
# value = 0
# ),
# group_by_overflow_mode = UserSettings.GroupByOverflowMode.GROUP_BY_OVERFLOW_MODE_THROW,
# max_rows_to_sort = Int64Value(
# value = 0
# ),
# max_bytes_to_sort = Int64Value(
# value = 0
# ),
# sort_overflow_mode = UserSettings.OverflowMode.OVERFLOW_MODE_THROW,
# max_result_rows = Int64Value(
# value = 0
# ),
# max_result_bytes = Int64Value(
# value = 0
# ),
# result_overflow_mode = UserSettings.OverflowMode.OVERFLOW_MODE_THROW,
# max_rows_in_distinct = Int64Value(
# value = 0
# ),
# max_bytes_in_distinct = Int64Value(
# value = 0
# ),
# distinct_overflow_mode = UserSettings.OverflowMode.OVERFLOW_MODE_THROW,
# max_rows_to_transfer = Int64Value(
# value = 0
# ),
# max_bytes_to_transfer = Int64Value(
# value = 0
# ),
# transfer_overflow_mode = UserSettings.OverflowMode.OVERFLOW_MODE_THROW,
# max_execution_time = Int64Value(
# value = 0
# ),
# timeout_overflow_mode = UserSettings.OverflowMode.OVERFLOW_MODE_THROW,
# max_rows_in_set = Int64Value(
# value = 0
# ),
# max_bytes_in_set = Int64Value(
# value = 0
# ),
# set_overflow_mode = UserSettings.OverflowMode.OVERFLOW_MODE_THROW,
# max_rows_in_join = Int64Value(
# value = 0
# ),
# max_bytes_in_join = Int64Value(
# value = 0
# ),
# join_overflow_mode = UserSettings.OverflowMode.OVERFLOW_MODE_THROW,
# join_algorithm = [UserSettings.JoinAlgorithm.JOIN_ALGORITHM_HASH],
# any_join_distinct_right_table_keys = BoolValue(
# value = true
# ),
# max_columns_to_read = Int64Value(
# value = 0
# ),
# max_temporary_columns = Int64Value(
# value = 0
# ),
# max_temporary_non_const_columns = Int64Value(
# value = 0
# ),
# max_query_size = Int64Value(
# value = 0
# ),
# max_ast_depth = Int64Value(
# value = 0
# ),
# max_ast_elements = Int64Value(
# value = 0
# ),
# max_expanded_ast_elements = Int64Value(
# value = 0
# ),
# min_execution_speed = Int64Value(
# value = 0
# ),
# min_execution_speed_bytes = Int64Value(
# value = 0
# ),
# count_distinct_implementation = UserSettings.CountDistinctImplementation.COUNT_DISTINCT_IMPLEMENTATION_UNIQ,
# input_format_values_interpret_expressions = BoolValue(
# value = true
# ),
# input_format_defaults_for_omitted_fields = BoolValue(
# value = true
# ),
# input_format_null_as_default = BoolValue(
# value = true
# ),
# date_time_input_format = UserSettings.DateTimeInputFormat.DATE_TIME_INPUT_FORMAT_BEST_EFFORT,
# input_format_with_names_use_header = BoolValue(
# value = true
# ),
# output_format_json_quote_64_bit_integers = BoolValue(
# value = true
# ),
# output_format_json_quote_denormals = BoolValue(
# value = true
# ),
# date_time_output_format = UserSettings.DateTimeOutputFormat.DATE_TIME_OUTPUT_FORMAT_SIMPLE,
# low_cardinality_allow_in_native_format = BoolValue(
# value = true
# ),
# allow_suspicious_low_cardinality_types = BoolValue(
# value = true
# ),
# empty_result_for_aggregation_by_empty_set = BoolValue(
# value = true
# ),
# http_connection_timeout = Int64Value(
# value = 0
# ),
# http_receive_timeout = Int64Value(
# value = 0
# ),
# http_send_timeout = Int64Value(
# value = 0
# ),
# enable_http_compression = BoolValue(
# value = true
# ),
# send_progress_in_http_headers = BoolValue(
# value = true
# ),
# http_headers_progress_interval = Int64Value(
# value = 0
# ),
# add_http_cors_header = BoolValue(
# value = true
# ),
# cancel_http_readonly_queries_on_client_close = BoolValue(
# value = true
# ),
# max_http_get_redirects = Int64Value(
# value = 0
# ),
# joined_subquery_requires_alias = BoolValue(
# value = true
# ),
# join_use_nulls = BoolValue(
# value = true
# ),
# transform_null_in = BoolValue(
# value = true
# ),
# quota_mode = UserSettings.QuotaMode.QUOTA_MODE_DEFAULT,
# flatten_nested = BoolValue(
# value = true
# ),
# format_regexp = "formatRegexp",
# format_regexp_escaping_rule = UserSettings.FormatRegexpEscapingRule.FORMAT_REGEXP_ESCAPING_RULE_ESCAPED,
# format_regexp_skip_unmatched = BoolValue(
# value = true
# ),
# async_insert = BoolValue(
# value = true
# ),
# async_insert_threads = Int64Value(
# value = 0
# ),
# wait_for_async_insert = BoolValue(
# value = true
# ),
# wait_for_async_insert_timeout = Int64Value(
# value = 0
# ),
# async_insert_max_data_size = Int64Value(
# value = 0
# ),
# async_insert_busy_timeout = Int64Value(
# value = 0
# ),
# async_insert_stale_timeout = Int64Value(
# value = 0
# ),
# memory_profiler_step = Int64Value(
# value = 0
# ),
# memory_profiler_sample_probability = DoubleValue(
# value = 0
# ),
# max_final_threads = Int64Value(
# value = 0
# ),
# input_format_parallel_parsing = BoolValue(
# value = true
# ),
# input_format_import_nested_json = BoolValue(
# value = true
# ),
# local_filesystem_read_method = UserSettings.LocalFilesystemReadMethod.LOCAL_FILESYSTEM_READ_METHOD_READ,
# max_read_buffer_size = Int64Value(
# value = 0
# ),
# insert_keeper_max_retries = Int64Value(
# value = 0
# ),
# max_temporary_data_on_disk_size_for_user = Int64Value(
# value = 0
# ),
# max_temporary_data_on_disk_size_for_query = Int64Value(
# value = 0
# ),
# max_parser_depth = Int64Value(
# value = 0
# ),
# remote_filesystem_read_method = UserSettings.RemoteFilesystemReadMethod.REMOTE_FILESYSTEM_READ_METHOD_READ,
# memory_overcommit_ratio_denominator = Int64Value(
# value = 0
# ),
# memory_overcommit_ratio_denominator_for_user = Int64Value(
# value = 0
# ),
# memory_usage_overcommit_max_wait_microseconds = Int64Value(
# value = 0
# ),
# log_query_threads = BoolValue(
# value = true
# ),
# max_insert_threads = Int64Value(
# value = 0
# ),
# use_hedged_requests = BoolValue(
# value = true
# ),
# idle_connection_timeout = Int64Value(
# value = 0
# ),
# hedged_connection_timeout_ms = Int64Value(
# value = 0
# ),
# load_balancing = UserSettings.LoadBalancing.LOAD_BALANCING_RANDOM,
# prefer_localhost_replica = BoolValue(
# value = true
# ),
# compile = BoolValue(
# value = true
# ),
# min_count_to_compile = Int64Value(
# value = 0
# )
# ),
# quotas = [UserQuota(
# interval_duration = Int64Value(
# value = 0
# ),
# queries = Int64Value(
# value = 0
# ),
# errors = Int64Value(
# value = 0
# ),
# result_rows = Int64Value(
# value = 0
# ),
# read_rows = Int64Value(
# value = 0
# ),
# execution_time = Int64Value(
# value = 0
# )
# )]
),
)
)
operation_result = sdk.wait_operation_and_get_result(
operation,
response_type=User,
meta_type=CreateUserMetadata,
)
print(operation_result)
CreateUserRequest
clusterId
: string
ID of the cluster to create the user in.
To get this ID, make a ClusterService.List request.
userSpec
: UserSpec
Configuration of the user.
UserSpec
name
: string
Name of the user.
password
: string
Password of the user.
permissions
: Permission
Set of permissions granted to the user to access specific databases. One permission per database.
When a permission for a database is set, the user will have access to the database.
globalPermissions
: GlobalPermission
Set of global permissions to grant to the user.
connectionLimits
: ConnectionLimits
Set of user connection limits.
authenticationPlugin
: AuthPlugin
User authentication plugin.
Permission
Privilege
PRIVILEGE_UNSPECIFIED
ALL_PRIVILEGES
All privileges that can be made available to the user.
ALTER
Altering tables.
ALTER_ROUTINE
Altering stored routines and functions.
CREATE
Creating tables or indexes.
CREATE_ROUTINE
Creating stored routines.
CREATE_TEMPORARY_TABLES
Creating temporary tables.
CREATE_VIEW
Creating views.
DELETE
Deleting tables.
DROP
Removing tables or views.
EVENT
Creating, altering, dropping, or displaying events for the Event Scheduler.
EXECUTE
Executing stored routines.
INDEX
Creating and removing indexes.
INSERT
Inserting rows into the database.
LOCK_TABLES
Using
LOCK TABLES
statement for tables available withSELECT
privilege.SELECT
Selecting rows from tables. Some
SELECT
statements can be allowed without theSELECT
privilege. All statements that read column values require theSELECT
privilege. See MySQL documentation for details.SHOW_VIEW
Using the
SHOW CREATE VIEW
statement. Also needed for views used withEXPLAIN
.TRIGGER
Creating, removing, executing, or displaying triggers for a table.
UPDATE
Updating rows in the database.
REFERENCES
Creation of a foreign key constraint for the parent table.
databaseName
: string
Name of the database that the permission grants access to.
roles
: Privilege
Roles granted to the user within the database.
See the documentation for details.
ConnectionLimits
maxQuestionsPerHour
: google.protobuf.Int64Value
The maximum permitted number of user questions per hour.
maxUpdatesPerHour
: google.protobuf.Int64Value
The maximum permitted number of user updates per hour.
maxConnectionsPerHour
: google.protobuf.Int64Value
The maximum permitted number of simultaneous client connections per hour.
maxUserConnections
: google.protobuf.Int64Value
The maximum number of simultaneous connections permitted to any given MySQL user account.
Operation
An Operation resource. For more information, see Operation.
id
: string
ID of the operation.
description
: string
Description of the operation. 0-256 characters long.
createdAt
: google.protobuf.Timestamp
Creation timestamp.
createdBy
: string
ID of the user or service account who initiated the operation.
modifiedAt
: google.protobuf.Timestamp
The time when the Operation resource was last modified.
done
: bool
If the value is false
, it means the operation is still in progress.
If true
, the operation is completed, and either error
or response
is available.
metadata
: google.protobuf.Any
Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any.
One of result
The operation result.
If done == false
and there was no failure detected, neither error
nor response
is set.
If done == false
and there was a failure detected, error
is set.
If done == true
, exactly one of error
or response
is set.
error
: google.rpc.StatusThe error result of the operation in case of failure or cancellation.
response
: google.protobuf.AnyThe normal response of the operation in case of success.
If the original method returns no data on success, such as Delete, the response is google.protobuf.Empty. If the original method is the standard Create/Update, the response should be the target resource of the operation. Any method that returns a long-running operation should document the response type, if any.