xref: /aosp_15_r20/external/googleapis/google/cloud/sql/v1/cloud_sql_flags.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.cloud.sql.v1;
18
19import "google/api/annotations.proto";
20import "google/api/client.proto";
21import "google/cloud/sql/v1/cloud_sql_resources.proto";
22import "google/protobuf/wrappers.proto";
23
24option go_package = "cloud.google.com/go/sql/apiv1/sqlpb;sqlpb";
25option java_multiple_files = true;
26option java_outer_classname = "CloudSqlFlagsProto";
27option java_package = "com.google.cloud.sql.v1";
28
29// LINT: LEGACY_NAMES
30
31// Service to manage database flags for Cloud SQL instances.
32service SqlFlagsService {
33  option (google.api.default_host) = "sqladmin.googleapis.com";
34  option (google.api.oauth_scopes) =
35      "https://www.googleapis.com/auth/cloud-platform,"
36      "https://www.googleapis.com/auth/sqlservice.admin";
37
38  // Lists all available database flags for Cloud SQL instances.
39  rpc List(SqlFlagsListRequest) returns (FlagsListResponse) {
40    option (google.api.http) = {
41      get: "/v1/flags"
42    };
43  }
44}
45
46// Flags list request.
47message SqlFlagsListRequest {
48  // Database type and version you want to retrieve flags for. By default, this
49  // method returns flags for all database types and versions.
50  string database_version = 1;
51}
52
53// Flags list response.
54message FlagsListResponse {
55  // This is always `sql#flagsList`.
56  string kind = 1;
57
58  // List of flags.
59  repeated Flag items = 2;
60}
61
62// A flag resource.
63message Flag {
64  // This is the name of the flag. Flag names always use underscores, not
65  // hyphens, for example: `max_allowed_packet`
66  string name = 1;
67
68  // The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`,
69  // `INTEGER` or `NONE`. `NONE` is used for flags that do not take a
70  // value, such as `skip_grant_tables`.
71  SqlFlagType type = 2;
72
73  // The database version this flag applies to. Can be
74  // MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
75  // or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
76  // `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
77  // `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
78  // `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
79  // `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
80  // `SQLSERVER_2019_WEB`.
81  // See [the complete
82  // list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
83  repeated SqlDatabaseVersion applies_to = 3;
84
85  // For `STRING` flags, a list of strings that the value can be set to.
86  repeated string allowed_string_values = 4;
87
88  // For `INTEGER` flags, the minimum allowed value.
89  google.protobuf.Int64Value min_value = 5;
90
91  // For `INTEGER` flags, the maximum allowed value.
92  google.protobuf.Int64Value max_value = 6;
93
94  // Indicates whether changing this flag will trigger a database restart. Only
95  // applicable to Second Generation instances.
96  google.protobuf.BoolValue requires_restart = 7;
97
98  // This is always `sql#flag`.
99  string kind = 8;
100
101  // Whether or not the flag is considered in beta.
102  google.protobuf.BoolValue in_beta = 9;
103
104  // Use this field if only certain integers are accepted. Can be combined
105  // with min_value and max_value to add additional values.
106  repeated int64 allowed_int_values = 10;
107}
108
109enum SqlFlagType {
110  // This is an unknown flag type.
111  SQL_FLAG_TYPE_UNSPECIFIED = 0;
112
113  // Boolean type flag.
114  BOOLEAN = 1;
115
116  // String type flag.
117  STRING = 2;
118
119  // Integer type flag.
120  INTEGER = 3;
121
122  // Flag type used for a server startup option.
123  NONE = 4;
124
125  // Type introduced specially for MySQL TimeZone offset. Accept a string value
126  // with the format [-12:59, 13:00].
127  MYSQL_TIMEZONE_OFFSET = 5;
128
129  // Float type flag.
130  FLOAT = 6;
131
132  // Comma-separated list of the strings in a SqlFlagType enum.
133  REPEATED_STRING = 7;
134}
135