• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.orchestration.airflow.service.v1;
18
19import "google/api/annotations.proto";
20import "google/api/client.proto";
21import "google/api/field_behavior.proto";
22import "google/api/resource.proto";
23import "google/cloud/orchestration/airflow/service/v1/operations.proto";
24import "google/longrunning/operations.proto";
25import "google/protobuf/empty.proto";
26import "google/protobuf/field_mask.proto";
27import "google/protobuf/timestamp.proto";
28
29option go_package = "cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb;servicepb";
30option java_multiple_files = true;
31option java_package = "com.google.cloud.orchestration.airflow.service.v1";
32
33// Managed Apache Airflow Environments.
34service Environments {
35  option (google.api.default_host) = "composer.googleapis.com";
36  option (google.api.oauth_scopes) =
37      "https://www.googleapis.com/auth/cloud-platform";
38
39  // Create a new environment.
40  rpc CreateEnvironment(CreateEnvironmentRequest)
41      returns (google.longrunning.Operation) {
42    option (google.api.http) = {
43      post: "/v1/{parent=projects/*/locations/*}/environments"
44      body: "environment"
45    };
46    option (google.api.method_signature) = "parent,environment";
47    option (google.longrunning.operation_info) = {
48      response_type: "Environment"
49      metadata_type: "google.cloud.orchestration.airflow.service.v1.OperationMetadata"
50    };
51  }
52
53  // Get an existing environment.
54  rpc GetEnvironment(GetEnvironmentRequest) returns (Environment) {
55    option (google.api.http) = {
56      get: "/v1/{name=projects/*/locations/*/environments/*}"
57    };
58    option (google.api.method_signature) = "name";
59  }
60
61  // List environments.
62  rpc ListEnvironments(ListEnvironmentsRequest)
63      returns (ListEnvironmentsResponse) {
64    option (google.api.http) = {
65      get: "/v1/{parent=projects/*/locations/*}/environments"
66    };
67    option (google.api.method_signature) = "parent";
68  }
69
70  // Update an environment.
71  rpc UpdateEnvironment(UpdateEnvironmentRequest)
72      returns (google.longrunning.Operation) {
73    option (google.api.http) = {
74      patch: "/v1/{name=projects/*/locations/*/environments/*}"
75      body: "environment"
76    };
77    option (google.api.method_signature) = "name,environment,update_mask";
78    option (google.longrunning.operation_info) = {
79      response_type: "Environment"
80      metadata_type: "google.cloud.orchestration.airflow.service.v1.OperationMetadata"
81    };
82  }
83
84  // Delete an environment.
85  rpc DeleteEnvironment(DeleteEnvironmentRequest)
86      returns (google.longrunning.Operation) {
87    option (google.api.http) = {
88      delete: "/v1/{name=projects/*/locations/*/environments/*}"
89    };
90    option (google.api.method_signature) = "name";
91    option (google.longrunning.operation_info) = {
92      response_type: "google.protobuf.Empty"
93      metadata_type: "google.cloud.orchestration.airflow.service.v1.OperationMetadata"
94    };
95  }
96
97  // Executes Airflow CLI command.
98  rpc ExecuteAirflowCommand(ExecuteAirflowCommandRequest)
99      returns (ExecuteAirflowCommandResponse) {
100    option (google.api.http) = {
101      post: "/v1/{environment=projects/*/locations/*/environments/*}:executeAirflowCommand"
102      body: "*"
103    };
104  }
105
106  // Stops Airflow CLI command execution.
107  rpc StopAirflowCommand(StopAirflowCommandRequest)
108      returns (StopAirflowCommandResponse) {
109    option (google.api.http) = {
110      post: "/v1/{environment=projects/*/locations/*/environments/*}:stopAirflowCommand"
111      body: "*"
112    };
113  }
114
115  // Polls Airflow CLI command execution and fetches logs.
116  rpc PollAirflowCommand(PollAirflowCommandRequest)
117      returns (PollAirflowCommandResponse) {
118    option (google.api.http) = {
119      post: "/v1/{environment=projects/*/locations/*/environments/*}:pollAirflowCommand"
120      body: "*"
121    };
122  }
123
124  // Lists workloads in a Cloud Composer environment. Workload is a unit that
125  // runs a single Composer component.
126  //
127  // This method is supported for Cloud Composer environments in versions
128  // composer-3.*.*-airflow-*.*.* and newer.
129  rpc ListWorkloads(ListWorkloadsRequest) returns (ListWorkloadsResponse) {
130    option (google.api.http) = {
131      get: "/v1/{parent=projects/*/locations/*/environments/*}/workloads"
132    };
133    option (google.api.method_signature) = "parent";
134  }
135
136  // Creates a user workloads Secret.
137  //
138  // This method is supported for Cloud Composer environments in versions
139  // composer-3.*.*-airflow-*.*.* and newer.
140  rpc CreateUserWorkloadsSecret(CreateUserWorkloadsSecretRequest)
141      returns (UserWorkloadsSecret) {
142    option (google.api.http) = {
143      post: "/v1/{parent=projects/*/locations/*/environments/*}/userWorkloadsSecrets"
144      body: "user_workloads_secret"
145    };
146    option (google.api.method_signature) = "parent,user_workloads_secret";
147  }
148
149  // Gets an existing user workloads Secret.
150  // Values of the "data" field in the response are cleared.
151  //
152  // This method is supported for Cloud Composer environments in versions
153  // composer-3.*.*-airflow-*.*.* and newer.
154  rpc GetUserWorkloadsSecret(GetUserWorkloadsSecretRequest)
155      returns (UserWorkloadsSecret) {
156    option (google.api.http) = {
157      get: "/v1/{name=projects/*/locations/*/environments/*/userWorkloadsSecrets/*}"
158    };
159    option (google.api.method_signature) = "name";
160  }
161
162  // Lists user workloads Secrets.
163  //
164  // This method is supported for Cloud Composer environments in versions
165  // composer-3.*.*-airflow-*.*.* and newer.
166  rpc ListUserWorkloadsSecrets(ListUserWorkloadsSecretsRequest)
167      returns (ListUserWorkloadsSecretsResponse) {
168    option (google.api.http) = {
169      get: "/v1/{parent=projects/*/locations/*/environments/*}/userWorkloadsSecrets"
170    };
171    option (google.api.method_signature) = "parent";
172  }
173
174  // Updates a user workloads Secret.
175  //
176  // This method is supported for Cloud Composer environments in versions
177  // composer-3.*.*-airflow-*.*.* and newer.
178  rpc UpdateUserWorkloadsSecret(UpdateUserWorkloadsSecretRequest)
179      returns (UserWorkloadsSecret) {
180    option (google.api.http) = {
181      put: "/v1/{user_workloads_secret.name=projects/*/locations/*/environments/*/userWorkloadsSecrets/*}"
182      body: "user_workloads_secret"
183    };
184    option (google.api.method_signature) = "user_workloads_secret";
185  }
186
187  // Deletes a user workloads Secret.
188  //
189  // This method is supported for Cloud Composer environments in versions
190  // composer-3.*.*-airflow-*.*.* and newer.
191  rpc DeleteUserWorkloadsSecret(DeleteUserWorkloadsSecretRequest)
192      returns (google.protobuf.Empty) {
193    option (google.api.http) = {
194      delete: "/v1/{name=projects/*/locations/*/environments/*/userWorkloadsSecrets/*}"
195    };
196    option (google.api.method_signature) = "name";
197  }
198
199  // Creates a user workloads ConfigMap.
200  //
201  // This method is supported for Cloud Composer environments in versions
202  // composer-3.*.*-airflow-*.*.* and newer.
203  rpc CreateUserWorkloadsConfigMap(CreateUserWorkloadsConfigMapRequest)
204      returns (UserWorkloadsConfigMap) {
205    option (google.api.http) = {
206      post: "/v1/{parent=projects/*/locations/*/environments/*}/userWorkloadsConfigMaps"
207      body: "user_workloads_config_map"
208    };
209    option (google.api.method_signature) = "parent,user_workloads_config_map";
210  }
211
212  // Gets an existing user workloads ConfigMap.
213  //
214  // This method is supported for Cloud Composer environments in versions
215  // composer-3.*.*-airflow-*.*.* and newer.
216  rpc GetUserWorkloadsConfigMap(GetUserWorkloadsConfigMapRequest)
217      returns (UserWorkloadsConfigMap) {
218    option (google.api.http) = {
219      get: "/v1/{name=projects/*/locations/*/environments/*/userWorkloadsConfigMaps/*}"
220    };
221    option (google.api.method_signature) = "name";
222  }
223
224  // Lists user workloads ConfigMaps.
225  //
226  // This method is supported for Cloud Composer environments in versions
227  // composer-3.*.*-airflow-*.*.* and newer.
228  rpc ListUserWorkloadsConfigMaps(ListUserWorkloadsConfigMapsRequest)
229      returns (ListUserWorkloadsConfigMapsResponse) {
230    option (google.api.http) = {
231      get: "/v1/{parent=projects/*/locations/*/environments/*}/userWorkloadsConfigMaps"
232    };
233    option (google.api.method_signature) = "parent";
234  }
235
236  // Updates a user workloads ConfigMap.
237  //
238  // This method is supported for Cloud Composer environments in versions
239  // composer-3.*.*-airflow-*.*.* and newer.
240  rpc UpdateUserWorkloadsConfigMap(UpdateUserWorkloadsConfigMapRequest)
241      returns (UserWorkloadsConfigMap) {
242    option (google.api.http) = {
243      put: "/v1/{user_workloads_config_map.name=projects/*/locations/*/environments/*/userWorkloadsConfigMaps/*}"
244      body: "user_workloads_config_map"
245    };
246    option (google.api.method_signature) = "user_workloads_config_map";
247  }
248
249  // Deletes a user workloads ConfigMap.
250  //
251  // This method is supported for Cloud Composer environments in versions
252  // composer-3.*.*-airflow-*.*.* and newer.
253  rpc DeleteUserWorkloadsConfigMap(DeleteUserWorkloadsConfigMapRequest)
254      returns (google.protobuf.Empty) {
255    option (google.api.http) = {
256      delete: "/v1/{name=projects/*/locations/*/environments/*/userWorkloadsConfigMaps/*}"
257    };
258    option (google.api.method_signature) = "name";
259  }
260
261  // Creates a snapshots of a Cloud Composer environment.
262  //
263  // As a result of this operation, snapshot of environment's state is stored
264  // in a location specified in the SaveSnapshotRequest.
265  rpc SaveSnapshot(SaveSnapshotRequest) returns (google.longrunning.Operation) {
266    option (google.api.http) = {
267      post: "/v1/{environment=projects/*/locations/*/environments/*}:saveSnapshot"
268      body: "*"
269    };
270    option (google.longrunning.operation_info) = {
271      response_type: "google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse"
272      metadata_type: "google.cloud.orchestration.airflow.service.v1.OperationMetadata"
273    };
274  }
275
276  // Loads a snapshot of a Cloud Composer environment.
277  //
278  // As a result of this operation, a snapshot of environment's specified in
279  // LoadSnapshotRequest is loaded into the environment.
280  rpc LoadSnapshot(LoadSnapshotRequest) returns (google.longrunning.Operation) {
281    option (google.api.http) = {
282      post: "/v1/{environment=projects/*/locations/*/environments/*}:loadSnapshot"
283      body: "*"
284    };
285    option (google.longrunning.operation_info) = {
286      response_type: "google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse"
287      metadata_type: "google.cloud.orchestration.airflow.service.v1.OperationMetadata"
288    };
289  }
290
291  // Triggers database failover (only for highly resilient environments).
292  rpc DatabaseFailover(DatabaseFailoverRequest)
293      returns (google.longrunning.Operation) {
294    option (google.api.http) = {
295      post: "/v1/{environment=projects/*/locations/*/environments/*}:databaseFailover"
296      body: "*"
297    };
298    option (google.longrunning.operation_info) = {
299      response_type: "google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse"
300      metadata_type: "google.cloud.orchestration.airflow.service.v1.OperationMetadata"
301    };
302  }
303
304  // Fetches database properties.
305  rpc FetchDatabaseProperties(FetchDatabasePropertiesRequest)
306      returns (FetchDatabasePropertiesResponse) {
307    option (google.api.http) = {
308      get: "/v1/{environment=projects/*/locations/*/environments/*}:fetchDatabaseProperties"
309    };
310  }
311}
312
313// Create a new environment.
314message CreateEnvironmentRequest {
315  // The parent must be of the form
316  // "projects/{projectId}/locations/{locationId}".
317  string parent = 1;
318
319  // The environment to create.
320  Environment environment = 2;
321}
322
323// Get an environment.
324message GetEnvironmentRequest {
325  // The resource name of the environment to get, in the form:
326  // "projects/{projectId}/locations/{locationId}/environments/{environmentId}"
327  string name = 1;
328}
329
330// List environments in a project and location.
331message ListEnvironmentsRequest {
332  // List environments in the given project and location, in the form:
333  // "projects/{projectId}/locations/{locationId}"
334  string parent = 1;
335
336  // The maximum number of environments to return.
337  int32 page_size = 2;
338
339  // The next_page_token value returned from a previous List request, if any.
340  string page_token = 3;
341}
342
343// The environments in a project and location.
344message ListEnvironmentsResponse {
345  // The list of environments returned by a ListEnvironmentsRequest.
346  repeated Environment environments = 1;
347
348  // The page token used to query for the next page if one exists.
349  string next_page_token = 2;
350}
351
352// Delete an environment.
353message DeleteEnvironmentRequest {
354  // The environment to delete, in the form:
355  // "projects/{projectId}/locations/{locationId}/environments/{environmentId}"
356  string name = 1;
357}
358
359// Update an environment.
360message UpdateEnvironmentRequest {
361  // The relative resource name of the environment to update, in the form:
362  // "projects/{projectId}/locations/{locationId}/environments/{environmentId}"
363  string name = 2;
364
365  // A patch environment. Fields specified by the `updateMask` will be copied
366  // from the patch environment into the environment under update.
367  Environment environment = 1;
368
369  // Required. A comma-separated list of paths, relative to `Environment`, of
370  // fields to update.
371  // For example, to set the version of scikit-learn to install in the
372  // environment to 0.19.0 and to remove an existing installation of
373  // numpy, the `updateMask` parameter would include the following two
374  // `paths` values: "config.softwareConfig.pypiPackages.scikit-learn" and
375  // "config.softwareConfig.pypiPackages.numpy". The included patch
376  // environment would specify the scikit-learn version as follows:
377  //
378  //     {
379  //       "config":{
380  //         "softwareConfig":{
381  //           "pypiPackages":{
382  //             "scikit-learn":"==0.19.0"
383  //           }
384  //         }
385  //       }
386  //     }
387  //
388  // Note that in the above example, any existing PyPI packages
389  // other than scikit-learn and numpy will be unaffected.
390  //
391  // Only one update type may be included in a single request's `updateMask`.
392  // For example, one cannot update both the PyPI packages and
393  // labels in the same request. However, it is possible to update multiple
394  // members of a map field simultaneously in the same request. For example,
395  // to set the labels "label1" and "label2" while clearing "label3" (assuming
396  // it already exists), one can
397  // provide the paths "labels.label1", "labels.label2", and "labels.label3"
398  // and populate the patch environment as follows:
399  //
400  //     {
401  //       "labels":{
402  //         "label1":"new-label1-value"
403  //         "label2":"new-label2-value"
404  //       }
405  //     }
406  //
407  // Note that in the above example, any existing labels that are not
408  // included in the `updateMask` will be unaffected.
409  //
410  // It is also possible to replace an entire map field by providing the
411  // map field's path in the `updateMask`. The new value of the field will
412  // be that which is provided in the patch environment. For example, to
413  // delete all pre-existing user-specified PyPI packages and
414  // install botocore at version 1.7.14, the `updateMask` would contain
415  // the path "config.softwareConfig.pypiPackages", and
416  // the patch environment would be the following:
417  //
418  //     {
419  //       "config":{
420  //         "softwareConfig":{
421  //           "pypiPackages":{
422  //             "botocore":"==1.7.14"
423  //           }
424  //         }
425  //       }
426  //     }
427  //
428  // **Note:** Only the following fields can be updated:
429  //
430  // * `config.softwareConfig.pypiPackages`
431  //     * Replace all custom custom PyPI packages. If a replacement
432  //       package map is not included in `environment`, all custom
433  //       PyPI packages are cleared. It is an error to provide both
434  //       this mask and a mask specifying an individual package.
435  // * `config.softwareConfig.pypiPackages.`packagename
436  //     * Update the custom PyPI package *packagename*,
437  //       preserving other packages. To delete the package, include it in
438  //       `updateMask`, and omit the mapping for it in
439  //       `environment.config.softwareConfig.pypiPackages`. It is an error
440  //       to provide both a mask of this form and the
441  //       `config.softwareConfig.pypiPackages` mask.
442  // * `labels`
443  //     * Replace all environment labels. If a replacement labels map is not
444  //       included in `environment`, all labels are cleared. It is an error to
445  //       provide both this mask and a mask specifying one or more individual
446  //       labels.
447  // * `labels.`labelName
448  //     * Set the label named *labelName*, while preserving other
449  //       labels. To delete the label, include it in `updateMask` and omit its
450  //       mapping in `environment.labels`. It is an error to provide both a
451  //       mask of this form and the `labels` mask.
452  // * `config.nodeCount`
453  //     * Horizontally scale the number of nodes in the environment. An integer
454  //       greater than or equal to 3 must be provided in the `config.nodeCount`
455  //       field. Supported for Cloud Composer environments in versions
456  //       composer-1.*.*-airflow-*.*.*.
457  // * `config.webServerNetworkAccessControl`
458  //     * Replace the environment's current `WebServerNetworkAccessControl`.
459  // * `config.softwareConfig.airflowConfigOverrides`
460  //     * Replace all Apache Airflow config overrides. If a replacement config
461  //       overrides map is not included in `environment`, all config overrides
462  //       are cleared.
463  //       It is an error to provide both this mask and a mask specifying one or
464  //       more individual config overrides.
465  // * `config.softwareConfig.airflowConfigOverrides.`section-name
466  //     * Override the Apache Airflow config property *name* in the
467  //       section named *section*, preserving other properties. To
468  //       delete the property override, include it in `updateMask` and omit its
469  //       mapping in
470  //       `environment.config.softwareConfig.airflowConfigOverrides`.
471  //       It is an error to provide both a mask of this form and the
472  //       `config.softwareConfig.airflowConfigOverrides` mask.
473  // * `config.softwareConfig.envVariables`
474  //     * Replace all environment variables. If a replacement environment
475  //       variable map is not included in `environment`, all custom environment
476  //       variables are cleared.
477  // * `config.softwareConfig.schedulerCount`
478  //     * Horizontally scale the number of schedulers in Airflow. A positive
479  //       integer not greater than the number of nodes must be provided in the
480  //       `config.softwareConfig.schedulerCount` field. Supported for Cloud
481  //       Composer environments in versions composer-1.*.*-airflow-2.*.*.
482  // * `config.databaseConfig.machineType`
483  //     * Cloud SQL machine type used by Airflow database.
484  //       It has to be one of: db-n1-standard-2, db-n1-standard-4,
485  //       db-n1-standard-8 or db-n1-standard-16. Supported for Cloud Composer
486  //       environments in versions composer-1.*.*-airflow-*.*.*.
487  // * `config.webServerConfig.machineType`
488  //     * Machine type on which Airflow web server is running.
489  //       It has to be one of: composer-n1-webserver-2, composer-n1-webserver-4
490  //       or composer-n1-webserver-8. Supported for Cloud Composer environments
491  //       in versions composer-1.*.*-airflow-*.*.*.
492  google.protobuf.FieldMask update_mask = 3;
493}
494
495// Execute Airflow Command request.
496message ExecuteAirflowCommandRequest {
497  // The resource name of the environment in the form:
498  // "projects/{projectId}/locations/{locationId}/environments/{environmentId}".
499  string environment = 1;
500
501  // Airflow command.
502  string command = 2;
503
504  // Airflow subcommand.
505  string subcommand = 3;
506
507  // Parameters for the Airflow command/subcommand as an array of arguments.
508  // It may contain positional arguments like `["my-dag-id"]`, key-value
509  // parameters like `["--foo=bar"]` or `["--foo","bar"]`,
510  // or other flags like `["-f"]`.
511  repeated string parameters = 4;
512}
513
514// Response to ExecuteAirflowCommandRequest.
515message ExecuteAirflowCommandResponse {
516  // The unique ID of the command execution for polling.
517  string execution_id = 1;
518
519  // The name of the pod where the command is executed.
520  string pod = 2;
521
522  // The namespace of the pod where the command is executed.
523  string pod_namespace = 3;
524
525  // Error message. Empty if there was no error.
526  string error = 4;
527}
528
529// Stop Airflow Command request.
530message StopAirflowCommandRequest {
531  // The resource name of the environment in the form:
532  // "projects/{projectId}/locations/{locationId}/environments/{environmentId}".
533  string environment = 1;
534
535  // The unique ID of the command execution.
536  string execution_id = 2;
537
538  // The name of the pod where the command is executed.
539  string pod = 3;
540
541  // The namespace of the pod where the command is executed.
542  string pod_namespace = 4;
543
544  // If true, the execution is terminated forcefully (SIGKILL). If false, the
545  // execution is stopped gracefully, giving it time for cleanup.
546  bool force = 5;
547}
548
549// Response to StopAirflowCommandRequest.
550message StopAirflowCommandResponse {
551  // Whether the execution is still running.
552  bool is_done = 1;
553
554  // Output message from stopping execution request.
555  repeated string output = 2;
556}
557
558// Poll Airflow Command request.
559message PollAirflowCommandRequest {
560  // The resource name of the environment in the form:
561  // "projects/{projectId}/locations/{locationId}/environments/{environmentId}"
562  string environment = 1;
563
564  // The unique ID of the command execution.
565  string execution_id = 2;
566
567  // The name of the pod where the command is executed.
568  string pod = 3;
569
570  // The namespace of the pod where the command is executed.
571  string pod_namespace = 4;
572
573  // Line number from which new logs should be fetched.
574  int32 next_line_number = 5;
575}
576
577// Response to PollAirflowCommandRequest.
578message PollAirflowCommandResponse {
579  // Contains information about a single line from logs.
580  message Line {
581    // Number of the line.
582    int32 line_number = 1;
583
584    // Text content of the log line.
585    string content = 2;
586  }
587
588  // Information about how a command ended.
589  message ExitInfo {
590    // The exit code from the command execution.
591    int32 exit_code = 1;
592
593    // Error message. Empty if there was no error.
594    string error = 2;
595  }
596
597  // Output from the command execution. It may not contain the full output
598  // and the caller may need to poll for more lines.
599  repeated Line output = 1;
600
601  // Whether the command execution has finished and there is no more output.
602  bool output_end = 2;
603
604  // The result exit status of the command.
605  ExitInfo exit_info = 3;
606}
607
608// Create user workloads Secret request.
609message CreateUserWorkloadsSecretRequest {
610  // Required. The environment name to create a Secret for, in the form:
611  // "projects/{projectId}/locations/{locationId}/environments/{environmentId}"
612  string parent = 1 [
613    (google.api.field_behavior) = REQUIRED,
614    (google.api.resource_reference) = {
615      type: "composer.googleapis.com/Environment"
616    }
617  ];
618
619  // Required. User workloads Secret to create.
620  UserWorkloadsSecret user_workloads_secret = 2
621      [(google.api.field_behavior) = REQUIRED];
622}
623
624// Get user workloads Secret request.
625message GetUserWorkloadsSecretRequest {
626  // Required. The resource name of the Secret to get, in the form:
627  // "projects/{projectId}/locations/{locationId}/environments/{environmentId}/userWorkloadsSecrets/{userWorkloadsSecretId}"
628  string name = 1 [
629    (google.api.field_behavior) = REQUIRED,
630    (google.api.resource_reference) = {
631      type: "composer.googleapis.com/UserWorkloadsSecret"
632    }
633  ];
634}
635
636// List user workloads Secrets request.
637message ListUserWorkloadsSecretsRequest {
638  // Required. List Secrets in the given environment, in the form:
639  // "projects/{projectId}/locations/{locationId}/environments/{environmentId}"
640  string parent = 1 [
641    (google.api.field_behavior) = REQUIRED,
642    (google.api.resource_reference) = {
643      type: "composer.googleapis.com/Environment"
644    }
645  ];
646
647  // Optional. The maximum number of Secrets to return.
648  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
649
650  // Optional. The next_page_token value returned from a previous List request,
651  // if any.
652  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
653}
654
655// Update user workloads Secret request.
656message UpdateUserWorkloadsSecretRequest {
657  // Optional. User workloads Secret to override.
658  UserWorkloadsSecret user_workloads_secret = 1
659      [(google.api.field_behavior) = OPTIONAL];
660}
661
662// Delete user workloads Secret request.
663message DeleteUserWorkloadsSecretRequest {
664  // Required. The Secret to delete, in the form:
665  // "projects/{projectId}/locations/{locationId}/environments/{environmentId}/userWorkloadsSecrets/{userWorkloadsSecretId}"
666  string name = 1 [
667    (google.api.field_behavior) = REQUIRED,
668    (google.api.resource_reference) = {
669      type: "composer.googleapis.com/UserWorkloadsSecret"
670    }
671  ];
672}
673
674// Create user workloads ConfigMap request.
675message CreateUserWorkloadsConfigMapRequest {
676  // Required. The environment name to create a ConfigMap for, in the form:
677  // "projects/{projectId}/locations/{locationId}/environments/{environmentId}"
678  string parent = 1 [
679    (google.api.field_behavior) = REQUIRED,
680    (google.api.resource_reference) = {
681      type: "composer.googleapis.com/Environment"
682    }
683  ];
684
685  // Required. User workloads ConfigMap to create.
686  UserWorkloadsConfigMap user_workloads_config_map = 2
687      [(google.api.field_behavior) = REQUIRED];
688}
689
690// Get user workloads ConfigMap request.
691message GetUserWorkloadsConfigMapRequest {
692  // Required. The resource name of the ConfigMap to get, in the form:
693  // "projects/{projectId}/locations/{locationId}/environments/{environmentId}/userWorkloadsConfigMaps/{userWorkloadsConfigMapId}"
694  string name = 1 [
695    (google.api.field_behavior) = REQUIRED,
696    (google.api.resource_reference) = {
697      type: "composer.googleapis.com/UserWorkloadsConfigMap"
698    }
699  ];
700}
701
702// List user workloads ConfigMaps request.
703message ListUserWorkloadsConfigMapsRequest {
704  // Required. List ConfigMaps in the given environment, in the form:
705  // "projects/{projectId}/locations/{locationId}/environments/{environmentId}"
706  string parent = 1 [
707    (google.api.field_behavior) = REQUIRED,
708    (google.api.resource_reference) = {
709      type: "composer.googleapis.com/Environment"
710    }
711  ];
712
713  // Optional. The maximum number of ConfigMaps to return.
714  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
715
716  // Optional. The next_page_token value returned from a previous List request,
717  // if any.
718  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
719}
720
721// Update user workloads ConfigMap request.
722message UpdateUserWorkloadsConfigMapRequest {
723  // Optional. User workloads ConfigMap to override.
724  UserWorkloadsConfigMap user_workloads_config_map = 1
725      [(google.api.field_behavior) = OPTIONAL];
726}
727
728// Delete user workloads ConfigMap request.
729message DeleteUserWorkloadsConfigMapRequest {
730  // Required. The ConfigMap to delete, in the form:
731  // "projects/{projectId}/locations/{locationId}/environments/{environmentId}/userWorkloadsConfigMaps/{userWorkloadsConfigMapId}"
732  string name = 1 [
733    (google.api.field_behavior) = REQUIRED,
734    (google.api.resource_reference) = {
735      type: "composer.googleapis.com/UserWorkloadsConfigMap"
736    }
737  ];
738}
739
740// User workloads Secret used by Airflow tasks that run with Kubernetes executor
741// or KubernetesPodOperator.
742message UserWorkloadsSecret {
743  option (google.api.resource) = {
744    type: "composer.googleapis.com/UserWorkloadsSecret"
745    pattern: "projects/{project}/locations/{location}/environments/{environment}/userWorkloadsSecrets/{user_workloads_secret}"
746    plural: "userWorkloadsSecrets"
747    singular: "userWorkloadsSecret"
748  };
749
750  // Identifier. The resource name of the Secret, in the form:
751  // "projects/{projectId}/locations/{locationId}/environments/{environmentId}/userWorkloadsSecrets/{userWorkloadsSecretId}"
752  string name = 1 [(google.api.field_behavior) = IDENTIFIER];
753
754  // Optional. The "data" field of Kubernetes Secret, organized in key-value
755  // pairs, which can contain sensitive values such as a password, a token, or a
756  // key. The values for all keys have to be base64-encoded strings. For details
757  // see: https://kubernetes.io/docs/concepts/configuration/secret/
758  map<string, string> data = 2 [(google.api.field_behavior) = OPTIONAL];
759}
760
761// The user workloads Secrets for a given environment.
762message ListUserWorkloadsSecretsResponse {
763  // The list of Secrets returned by a ListUserWorkloadsSecretsRequest.
764  repeated UserWorkloadsSecret user_workloads_secrets = 1;
765
766  // The page token used to query for the next page if one exists.
767  string next_page_token = 2;
768}
769
770// User workloads ConfigMap used by Airflow tasks that run with Kubernetes
771// executor or KubernetesPodOperator.
772message UserWorkloadsConfigMap {
773  option (google.api.resource) = {
774    type: "composer.googleapis.com/UserWorkloadsConfigMap"
775    pattern: "projects/{project}/locations/{location}/environments/{environment}/userWorkloadsConfigMaps/{user_workloads_config_map}"
776    plural: "userWorkloadsConfigMaps"
777    singular: "userWorkloadsConfigMap"
778  };
779
780  // Identifier. The resource name of the ConfigMap, in the form:
781  // "projects/{projectId}/locations/{locationId}/environments/{environmentId}/userWorkloadsConfigMaps/{userWorkloadsConfigMapId}"
782  string name = 1 [(google.api.field_behavior) = IDENTIFIER];
783
784  // Optional. The "data" field of Kubernetes ConfigMap, organized in key-value
785  // pairs. For details see:
786  // https://kubernetes.io/docs/concepts/configuration/configmap/
787  map<string, string> data = 2 [(google.api.field_behavior) = OPTIONAL];
788}
789
790// The user workloads ConfigMaps for a given environment.
791message ListUserWorkloadsConfigMapsResponse {
792  // The list of ConfigMaps returned by a ListUserWorkloadsConfigMapsRequest.
793  repeated UserWorkloadsConfigMap user_workloads_config_maps = 1;
794
795  // The page token used to query for the next page if one exists.
796  string next_page_token = 2;
797}
798
799// Request for listing workloads in a Cloud Composer environment.
800message ListWorkloadsRequest {
801  // Required. The environment name to get workloads for, in the form:
802  // "projects/{projectId}/locations/{locationId}/environments/{environmentId}"
803  string parent = 1 [
804    (google.api.field_behavior) = REQUIRED,
805    (google.api.resource_reference) = {
806      type: "composer.googleapis.com/Environment"
807    }
808  ];
809
810  // Optional. The maximum number of environments to return.
811  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
812
813  // Optional. The next_page_token value returned from a previous List request,
814  // if any.
815  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
816
817  // Optional. The list filter.
818  // Currently only supports equality on the type field. The value of a field
819  // specified in the filter expression must be one ComposerWorkloadType enum
820  // option. It's possible to get multiple types using "OR" operator, e.g.:
821  // "type=SCHEDULER OR type=CELERY_WORKER". If not specified, all items are
822  // returned.
823  string filter = 4 [(google.api.field_behavior) = OPTIONAL];
824}
825
826// Response to ListWorkloadsRequest.
827message ListWorkloadsResponse {
828  // Information about a single workload.
829  message ComposerWorkload {
830    // Name of a workload.
831    string name = 1;
832
833    // Type of a workload.
834    ComposerWorkloadType type = 2;
835
836    // Output only. Status of a workload.
837    ComposerWorkloadStatus status = 3
838        [(google.api.field_behavior) = OUTPUT_ONLY];
839  }
840
841  // Supported workload types.
842  enum ComposerWorkloadType {
843    // Not able to determine the type of the workload.
844    COMPOSER_WORKLOAD_TYPE_UNSPECIFIED = 0;
845
846    // Celery worker.
847    CELERY_WORKER = 1;
848
849    // Kubernetes worker.
850    KUBERNETES_WORKER = 2;
851
852    // Workload created by Kubernetes Pod Operator.
853    KUBERNETES_OPERATOR_POD = 3;
854
855    // Airflow scheduler.
856    SCHEDULER = 4;
857
858    // Airflow Dag processor.
859    DAG_PROCESSOR = 5;
860
861    // Airflow triggerer.
862    TRIGGERER = 6;
863
864    // Airflow web server UI.
865    WEB_SERVER = 7;
866
867    // Redis.
868    REDIS = 8;
869  }
870
871  // Workload status.
872  message ComposerWorkloadStatus {
873    // Output only. Workload state.
874    ComposerWorkloadState state = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
875
876    // Output only. Text to provide more descriptive status.
877    string status_message = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
878
879    // Output only. Detailed message of the status.
880    string detailed_status_message = 3
881        [(google.api.field_behavior) = OUTPUT_ONLY];
882  }
883
884  // Workload states.
885  enum ComposerWorkloadState {
886    // Not able to determine the status of the workload.
887    COMPOSER_WORKLOAD_STATE_UNSPECIFIED = 0;
888
889    // Workload is in pending state and has not yet started.
890    PENDING = 1;
891
892    // Workload is running fine.
893    OK = 2;
894
895    // Workload is running but there are some non-critical problems.
896    WARNING = 3;
897
898    // Workload is not running due to an error.
899    ERROR = 4;
900
901    // Workload has finished execution with success.
902    SUCCEEDED = 5;
903
904    // Workload has finished execution with failure.
905    FAILED = 6;
906  }
907
908  // The list of environment workloads.
909  repeated ComposerWorkload workloads = 1;
910
911  // The page token used to query for the next page if one exists.
912  string next_page_token = 2;
913}
914
915// Request to create a snapshot of a Cloud Composer environment.
916message SaveSnapshotRequest {
917  // The resource name of the source environment in the form:
918  // "projects/{projectId}/locations/{locationId}/environments/{environmentId}"
919  string environment = 1;
920
921  // Location in a Cloud Storage where the snapshot is going to be stored, e.g.:
922  // "gs://my-bucket/snapshots".
923  string snapshot_location = 2;
924}
925
926// Response to SaveSnapshotRequest.
927message SaveSnapshotResponse {
928  // The fully-resolved Cloud Storage path of the created snapshot,
929  // e.g.:
930  // "gs://my-bucket/snapshots/project_location_environment_timestamp".
931  // This field is populated only if the snapshot creation was successful.
932  string snapshot_path = 1;
933}
934
935// Request to load a snapshot into a Cloud Composer environment.
936message LoadSnapshotRequest {
937  // The resource name of the target environment in the form:
938  // "projects/{projectId}/locations/{locationId}/environments/{environmentId}"
939  string environment = 1;
940
941  // A Cloud Storage path to a snapshot to load, e.g.:
942  // "gs://my-bucket/snapshots/project_location_environment_timestamp".
943  string snapshot_path = 2;
944
945  // Whether or not to skip installing Pypi packages when loading the
946  // environment's state.
947  bool skip_pypi_packages_installation = 3;
948
949  // Whether or not to skip setting environment variables when loading the
950  // environment's state.
951  bool skip_environment_variables_setting = 4;
952
953  // Whether or not to skip setting Airflow overrides when loading the
954  // environment's state.
955  bool skip_airflow_overrides_setting = 5;
956
957  // Whether or not to skip copying Cloud Storage data when loading the
958  // environment's state.
959  bool skip_gcs_data_copying = 6;
960}
961
962// Response to LoadSnapshotRequest.
963message LoadSnapshotResponse {}
964
965// Request to trigger database failover (only for highly resilient
966// environments).
967message DatabaseFailoverRequest {
968  // Target environment:
969  // "projects/{projectId}/locations/{locationId}/environments/{environmentId}"
970  string environment = 1;
971}
972
973// Response for DatabaseFailoverRequest.
974message DatabaseFailoverResponse {}
975
976// Request to fetch properties of environment's database.
977message FetchDatabasePropertiesRequest {
978  // Required. The resource name of the environment, in the form:
979  // "projects/{projectId}/locations/{locationId}/environments/{environmentId}"
980  string environment = 1 [
981    (google.api.field_behavior) = REQUIRED,
982    (google.api.resource_reference) = {
983      type: "composer.googleapis.com/Environment"
984    }
985  ];
986}
987
988// Response for FetchDatabasePropertiesRequest.
989message FetchDatabasePropertiesResponse {
990  // The Compute Engine zone that the instance is currently serving from.
991  string primary_gce_zone = 1;
992
993  // The Compute Engine zone that the failover instance is currently serving
994  // from for a regional Cloud SQL instance.
995  string secondary_gce_zone = 2;
996
997  // The availability status of the failover replica. A false status indicates
998  // that the failover replica is out of sync. The primary instance can only
999  // fail over to the failover replica when the status is true.
1000  bool is_failover_replica_available = 3;
1001}
1002
1003// The configuration for data storage in the environment.
1004message StorageConfig {
1005  // Optional. The name of the Cloud Storage bucket used by the environment. No
1006  // `gs://` prefix.
1007  string bucket = 1 [(google.api.field_behavior) = OPTIONAL];
1008}
1009
1010// Configuration information for an environment.
1011message EnvironmentConfig {
1012  // The size of the Cloud Composer environment.
1013  enum EnvironmentSize {
1014    // The size of the environment is unspecified.
1015    ENVIRONMENT_SIZE_UNSPECIFIED = 0;
1016
1017    // The environment size is small.
1018    ENVIRONMENT_SIZE_SMALL = 1;
1019
1020    // The environment size is medium.
1021    ENVIRONMENT_SIZE_MEDIUM = 2;
1022
1023    // The environment size is large.
1024    ENVIRONMENT_SIZE_LARGE = 3;
1025  }
1026
1027  // Resilience mode of the Cloud Composer Environment.
1028  enum ResilienceMode {
1029    // Default mode doesn't change environment parameters.
1030    RESILIENCE_MODE_UNSPECIFIED = 0;
1031
1032    // Enabled High Resilience mode, including Cloud SQL HA.
1033    HIGH_RESILIENCE = 1;
1034  }
1035
1036  // Output only. The Kubernetes Engine cluster used to run this environment.
1037  string gke_cluster = 1;
1038
1039  // Output only. The Cloud Storage prefix of the DAGs for this environment.
1040  // Although Cloud Storage objects reside in a flat namespace, a hierarchical
1041  // file tree can be simulated using "/"-delimited object name prefixes. DAG
1042  // objects for this environment reside in a simulated directory with the given
1043  // prefix.
1044  string dag_gcs_prefix = 2;
1045
1046  // The number of nodes in the Kubernetes Engine cluster that will be
1047  // used to run this environment.
1048  //
1049  // This field is supported for Cloud Composer environments in versions
1050  // composer-1.*.*-airflow-*.*.*.
1051  int32 node_count = 3;
1052
1053  // The configuration settings for software inside the environment.
1054  SoftwareConfig software_config = 4;
1055
1056  // The configuration used for the Kubernetes Engine cluster.
1057  NodeConfig node_config = 5;
1058
1059  // The configuration used for the Private IP Cloud Composer environment.
1060  PrivateEnvironmentConfig private_environment_config = 7;
1061
1062  // Optional. The network-level access control policy for the Airflow web
1063  // server. If unspecified, no network-level access restrictions will be
1064  // applied.
1065  WebServerNetworkAccessControl web_server_network_access_control = 8
1066      [(google.api.field_behavior) = OPTIONAL];
1067
1068  // Optional. The configuration settings for Cloud SQL instance used internally
1069  // by Apache Airflow software.
1070  DatabaseConfig database_config = 9 [(google.api.field_behavior) = OPTIONAL];
1071
1072  // Optional. The configuration settings for the Airflow web server App Engine
1073  // instance.
1074  WebServerConfig web_server_config = 10
1075      [(google.api.field_behavior) = OPTIONAL];
1076
1077  // Optional. The encryption options for the Cloud Composer environment
1078  // and its dependencies. Cannot be updated.
1079  EncryptionConfig encryption_config = 11
1080      [(google.api.field_behavior) = OPTIONAL];
1081
1082  // Optional. The maintenance window is the period when Cloud Composer
1083  // components may undergo maintenance. It is defined so that maintenance is
1084  // not executed during peak hours or critical time periods.
1085  //
1086  // The system will not be under maintenance for every occurrence of this
1087  // window, but when maintenance is planned, it will be scheduled
1088  // during the window.
1089  //
1090  // The maintenance window period must encompass at least 12 hours per week.
1091  // This may be split into multiple chunks, each with a size of
1092  // at least 4 hours.
1093  //
1094  // If this value is omitted, the default value for maintenance window will be
1095  // applied. The default value is Saturday and Sunday 00-06 GMT.
1096  MaintenanceWindow maintenance_window = 12
1097      [(google.api.field_behavior) = OPTIONAL];
1098
1099  // Optional. The workloads configuration settings for the GKE cluster
1100  // associated with the Cloud Composer environment. The GKE cluster runs
1101  // Airflow scheduler, web server and workers workloads.
1102  //
1103  // This field is supported for Cloud Composer environments in versions
1104  // composer-2.*.*-airflow-*.*.* and newer.
1105  WorkloadsConfig workloads_config = 15
1106      [(google.api.field_behavior) = OPTIONAL];
1107
1108  // Optional. The size of the Cloud Composer environment.
1109  //
1110  // This field is supported for Cloud Composer environments in versions
1111  // composer-2.*.*-airflow-*.*.* and newer.
1112  EnvironmentSize environment_size = 16
1113      [(google.api.field_behavior) = OPTIONAL];
1114
1115  // Output only. The URI of the Apache Airflow Web UI hosted within this
1116  // environment (see [Airflow web
1117  // interface](/composer/docs/how-to/accessing/airflow-web-interface)).
1118  string airflow_uri = 6;
1119
1120  // Output only. The 'bring your own identity' variant of the URI of the Apache
1121  // Airflow Web UI hosted within this environment, to be accessed with external
1122  // identities using workforce identity federation (see [Access environments
1123  // with workforce identity
1124  // federation](/composer/docs/composer-2/access-environments-with-workforce-identity-federation)).
1125  string airflow_byoid_uri = 20 [(google.api.field_behavior) = OUTPUT_ONLY];
1126
1127  // Optional. The configuration options for GKE cluster master authorized
1128  // networks. By default master authorized networks feature is:
1129  // - in case of private environment: enabled with no external networks
1130  // allowlisted.
1131  // - in case of public environment: disabled.
1132  MasterAuthorizedNetworksConfig master_authorized_networks_config = 17
1133      [(google.api.field_behavior) = OPTIONAL];
1134
1135  // Optional. The Recovery settings configuration of an environment.
1136  //
1137  // This field is supported for Cloud Composer environments in versions
1138  // composer-2.*.*-airflow-*.*.* and newer.
1139  RecoveryConfig recovery_config = 18 [(google.api.field_behavior) = OPTIONAL];
1140
1141  // Optional. Resilience mode of the Cloud Composer Environment.
1142  //
1143  // This field is supported for Cloud Composer environments in versions
1144  // composer-2.2.0-airflow-*.*.* and newer.
1145  ResilienceMode resilience_mode = 19 [(google.api.field_behavior) = OPTIONAL];
1146
1147  // Optional. The configuration setting for Airflow database data retention
1148  // mechanism.
1149  DataRetentionConfig data_retention_config = 21
1150      [(google.api.field_behavior) = OPTIONAL];
1151}
1152
1153// Network-level access control policy for the Airflow web server.
1154message WebServerNetworkAccessControl {
1155  // Allowed IP range with user-provided description.
1156  message AllowedIpRange {
1157    // IP address or range, defined using CIDR notation, of requests that this
1158    // rule applies to.
1159    // Examples: `192.168.1.1` or `192.168.0.0/16` or `2001:db8::/32`
1160    //           or `2001:0db8:0000:0042:0000:8a2e:0370:7334`.
1161    //
1162    // IP range prefixes should be properly truncated. For example,
1163    // `1.2.3.4/24` should be truncated to `1.2.3.0/24`. Similarly, for IPv6,
1164    // `2001:db8::1/32` should be truncated to `2001:db8::/32`.
1165    string value = 1;
1166
1167    // Optional. User-provided description. It must contain at most 300
1168    // characters.
1169    string description = 2 [(google.api.field_behavior) = OPTIONAL];
1170  }
1171
1172  // A collection of allowed IP ranges with descriptions.
1173  repeated AllowedIpRange allowed_ip_ranges = 1;
1174}
1175
1176// The configuration of Cloud SQL instance that is used by the Apache Airflow
1177// software.
1178message DatabaseConfig {
1179  // Optional. Cloud SQL machine type used by Airflow database.
1180  // It has to be one of: db-n1-standard-2, db-n1-standard-4, db-n1-standard-8
1181  // or db-n1-standard-16. If not specified, db-n1-standard-2 will be used.
1182  // Supported for Cloud Composer environments in versions
1183  // composer-1.*.*-airflow-*.*.*.
1184  string machine_type = 1 [(google.api.field_behavior) = OPTIONAL];
1185
1186  // Optional. The Compute Engine zone where the Airflow database is created. If
1187  // zone is provided, it must be in the region selected for the environment. If
1188  // zone is not provided, a zone is automatically selected. The zone can only
1189  // be set during environment creation. Supported for Cloud Composer
1190  // environments in versions composer-2.*.*-airflow-*.*.*.
1191  string zone = 2 [(google.api.field_behavior) = OPTIONAL];
1192}
1193
1194// The configuration settings for the Airflow web server App Engine instance.
1195// Supported for Cloud Composer environments in versions
1196// composer-1.*.*-airflow-*.*.*
1197message WebServerConfig {
1198  // Optional. Machine type on which Airflow web server is running.
1199  // It has to be one of: composer-n1-webserver-2, composer-n1-webserver-4 or
1200  // composer-n1-webserver-8.
1201  // If not specified, composer-n1-webserver-2 will be used.
1202  // Value custom is returned only in response, if Airflow web server parameters
1203  // were manually changed to a non-standard values.
1204  string machine_type = 1 [(google.api.field_behavior) = OPTIONAL];
1205}
1206
1207// The encryption options for the Cloud Composer environment
1208// and its dependencies.Supported for Cloud Composer environments in versions
1209// composer-1.*.*-airflow-*.*.*.
1210message EncryptionConfig {
1211  // Optional. Customer-managed Encryption Key available through Google's Key
1212  // Management Service. Cannot be updated. If not specified, Google-managed key
1213  // will be used.
1214  string kms_key_name = 1 [(google.api.field_behavior) = OPTIONAL];
1215}
1216
1217// The configuration settings for Cloud Composer maintenance window.
1218// The following example:
1219//
1220// ```
1221//    {
1222//      "startTime":"2019-08-01T01:00:00Z"
1223//      "endTime":"2019-08-01T07:00:00Z"
1224//      "recurrence":"FREQ=WEEKLY;BYDAY=TU,WE"
1225//    }
1226// ```
1227//
1228// would define a maintenance window between 01 and 07 hours UTC during
1229// each Tuesday and Wednesday.
1230message MaintenanceWindow {
1231  // Required. Start time of the first recurrence of the maintenance window.
1232  google.protobuf.Timestamp start_time = 1
1233      [(google.api.field_behavior) = REQUIRED];
1234
1235  // Required. Maintenance window end time. It is used only to calculate the
1236  // duration of the maintenance window. The value for end-time must be in the
1237  // future, relative to `start_time`.
1238  google.protobuf.Timestamp end_time = 2
1239      [(google.api.field_behavior) = REQUIRED];
1240
1241  // Required. Maintenance window recurrence. Format is a subset of
1242  // [RFC-5545](https://tools.ietf.org/html/rfc5545) `RRULE`. The only allowed
1243  // values for `FREQ` field are `FREQ=DAILY` and `FREQ=WEEKLY;BYDAY=...`
1244  // Example values: `FREQ=WEEKLY;BYDAY=TU,WE`, `FREQ=DAILY`.
1245  string recurrence = 3 [(google.api.field_behavior) = REQUIRED];
1246}
1247
1248// Specifies the selection and configuration of software inside the environment.
1249message SoftwareConfig {
1250  // Web server plugins mode of the Cloud Composer environment.
1251  enum WebServerPluginsMode {
1252    // Default mode.
1253    WEB_SERVER_PLUGINS_MODE_UNSPECIFIED = 0;
1254
1255    // Web server plugins are not supported.
1256    PLUGINS_DISABLED = 1;
1257
1258    // Web server plugins are supported.
1259    PLUGINS_ENABLED = 2;
1260  }
1261
1262  // The version of the software running in the environment.
1263  // This encapsulates both the version of Cloud Composer functionality and the
1264  // version of Apache Airflow. It must match the regular expression
1265  // `composer-([0-9]+(\.[0-9]+\.[0-9]+(-preview\.[0-9]+)?)?|latest)-airflow-([0-9]+(\.[0-9]+(\.[0-9]+)?)?)`.
1266  // When used as input, the server also checks if the provided version is
1267  // supported and denies the request for an unsupported version.
1268  //
1269  // The Cloud Composer portion of the image version is a full
1270  // [semantic version](https://semver.org), or an alias in the form of major
1271  // version number or `latest`. When an alias is provided, the server replaces
1272  // it with the current Cloud Composer version that satisfies the alias.
1273  //
1274  // The Apache Airflow portion of the image version is a full semantic version
1275  // that points to one of the supported Apache Airflow versions, or an alias in
1276  // the form of only major or major.minor versions specified. When an alias is
1277  // provided, the server replaces it with the latest Apache Airflow version
1278  // that satisfies the alias and is supported in the given Cloud Composer
1279  // version.
1280  //
1281  // In all cases, the resolved image version is stored in the same field.
1282  //
1283  // See also [version
1284  // list](/composer/docs/concepts/versioning/composer-versions) and [versioning
1285  // overview](/composer/docs/concepts/versioning/composer-versioning-overview).
1286  string image_version = 1;
1287
1288  // Optional. Apache Airflow configuration properties to override.
1289  //
1290  // Property keys contain the section and property names, separated by a
1291  // hyphen, for example "core-dags_are_paused_at_creation". Section names must
1292  // not contain hyphens ("-"), opening square brackets ("["),  or closing
1293  // square brackets ("]"). The property name must not be empty and must not
1294  // contain an equals sign ("=") or semicolon (";"). Section and property names
1295  // must not contain a period ("."). Apache Airflow configuration property
1296  // names must be written in
1297  // [snake_case](https://en.wikipedia.org/wiki/Snake_case). Property values can
1298  // contain any character, and can be written in any lower/upper case format.
1299  //
1300  // Certain Apache Airflow configuration property values are
1301  // [blocked](/composer/docs/concepts/airflow-configurations),
1302  // and cannot be overridden.
1303  map<string, string> airflow_config_overrides = 2;
1304
1305  // Optional. Custom Python Package Index (PyPI) packages to be installed in
1306  // the environment.
1307  //
1308  // Keys refer to the lowercase package name such as "numpy"
1309  // and values are the lowercase extras and version specifier such as
1310  // "==1.12.0", "[devel,gcp_api]", or "[devel]>=1.8.2, <1.9.2". To specify a
1311  // package without pinning it to a version specifier, use the empty string as
1312  // the value.
1313  map<string, string> pypi_packages = 3;
1314
1315  // Optional. Additional environment variables to provide to the Apache Airflow
1316  // scheduler, worker, and webserver processes.
1317  //
1318  // Environment variable names must match the regular expression
1319  // `[a-zA-Z_][a-zA-Z0-9_]*`. They cannot specify Apache Airflow
1320  // software configuration overrides (they cannot match the regular expression
1321  // `AIRFLOW__[A-Z0-9_]+__[A-Z0-9_]+`), and they cannot match any of the
1322  // following reserved names:
1323  //
1324  // * `AIRFLOW_HOME`
1325  // * `C_FORCE_ROOT`
1326  // * `CONTAINER_NAME`
1327  // * `DAGS_FOLDER`
1328  // * `GCP_PROJECT`
1329  // * `GCS_BUCKET`
1330  // * `GKE_CLUSTER_NAME`
1331  // * `SQL_DATABASE`
1332  // * `SQL_INSTANCE`
1333  // * `SQL_PASSWORD`
1334  // * `SQL_PROJECT`
1335  // * `SQL_REGION`
1336  // * `SQL_USER`
1337  map<string, string> env_variables = 4;
1338
1339  // Optional. The major version of Python used to run the Apache Airflow
1340  // scheduler, worker, and webserver processes.
1341  //
1342  // Can be set to '2' or '3'. If not specified, the default is '3'. Cannot be
1343  // updated.
1344  //
1345  // This field is only supported for Cloud Composer environments in versions
1346  // composer-1.*.*-airflow-*.*.*. Environments in newer versions always use
1347  // Python major version 3.
1348  string python_version = 6;
1349
1350  // Optional. The number of schedulers for Airflow.
1351  //
1352  // This field is supported for Cloud Composer environments in versions
1353  // composer-1.*.*-airflow-2.*.*.
1354  int32 scheduler_count = 7 [(google.api.field_behavior) = OPTIONAL];
1355
1356  // Optional. The configuration for Cloud Data Lineage integration.
1357  CloudDataLineageIntegration cloud_data_lineage_integration = 8
1358      [(google.api.field_behavior) = OPTIONAL];
1359
1360  // Optional. Whether or not the web server uses custom plugins.
1361  // If unspecified, the field defaults to `PLUGINS_ENABLED`.
1362  //
1363  // This field is supported for Cloud Composer environments in versions
1364  // composer-3.*.*-airflow-*.*.* and newer.
1365  WebServerPluginsMode web_server_plugins_mode = 10
1366      [(google.api.field_behavior) = OPTIONAL];
1367}
1368
1369// Configuration for controlling how IPs are allocated in the
1370// GKE cluster running the Apache Airflow software.
1371message IPAllocationPolicy {
1372  // Optional. Whether or not to enable Alias IPs in the GKE cluster.
1373  // If `true`, a VPC-native cluster is created.
1374  //
1375  // This field is only supported for Cloud Composer environments in versions
1376  // composer-1.*.*-airflow-*.*.*. Environments in newer versions always use
1377  // VPC-native GKE clusters.
1378  bool use_ip_aliases = 1 [(google.api.field_behavior) = OPTIONAL];
1379
1380  // Configuration of allocating IP addresses for pods in the GKE cluster.
1381  oneof cluster_ip_allocation {
1382    // Optional. The name of the GKE cluster's secondary range used to allocate
1383    // IP addresses to pods.
1384    //
1385    // For Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*,
1386    // this field is applicable only when `use_ip_aliases` is true.
1387    string cluster_secondary_range_name = 2
1388        [(google.api.field_behavior) = OPTIONAL];
1389
1390    // Optional. The IP address range used to allocate IP addresses to pods in
1391    // the GKE cluster.
1392    //
1393    // For Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*,
1394    // this field is applicable only when `use_ip_aliases` is true.
1395    //
1396    // Set to blank to have GKE choose a range with the default size.
1397    //
1398    // Set to /netmask (e.g. `/14`) to have GKE choose a range with a specific
1399    // netmask.
1400    //
1401    // Set to a
1402    // [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
1403    // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g.
1404    // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range
1405    // to use.
1406    string cluster_ipv4_cidr_block = 4 [(google.api.field_behavior) = OPTIONAL];
1407  }
1408
1409  // Configuration of allocating IP addresses for services in the GKE cluster.
1410  oneof services_ip_allocation {
1411    // Optional. The name of the services' secondary range used to allocate
1412    // IP addresses to the GKE cluster.
1413    //
1414    // For Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*,
1415    // this field is applicable only when `use_ip_aliases` is true.
1416    string services_secondary_range_name = 3
1417        [(google.api.field_behavior) = OPTIONAL];
1418
1419    // Optional. The IP address range of the services IP addresses in this
1420    // GKE cluster.
1421    //
1422    // For Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*,
1423    // this field is applicable only when `use_ip_aliases` is true.
1424    //
1425    // Set to blank to have GKE choose a range with the default size.
1426    //
1427    // Set to /netmask (e.g. `/14`) to have GKE choose a range with a specific
1428    // netmask.
1429    //
1430    // Set to a
1431    // [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
1432    // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g.
1433    // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range
1434    // to use.
1435    string services_ipv4_cidr_block = 5
1436        [(google.api.field_behavior) = OPTIONAL];
1437  }
1438}
1439
1440// The configuration information for the Kubernetes Engine nodes running
1441// the Apache Airflow software.
1442message NodeConfig {
1443  // Optional. The Compute Engine [zone](/compute/docs/regions-zones) in which
1444  // to deploy the VMs used to run the Apache Airflow software, specified as a
1445  // [relative resource
1446  // name](/apis/design/resource_names#relative_resource_name). For example:
1447  // "projects/{projectId}/zones/{zoneId}".
1448  //
1449  // This `location` must belong to the enclosing environment's project and
1450  // location. If both this field and `nodeConfig.machineType` are specified,
1451  // `nodeConfig.machineType` must belong to this `location`; if both are
1452  // unspecified, the service will pick a zone in the Compute Engine region
1453  // corresponding to the Cloud Composer location, and propagate that choice to
1454  // both fields. If only one field (`location` or `nodeConfig.machineType`) is
1455  // specified, the location information from the specified field will be
1456  // propagated to the unspecified field.
1457  //
1458  // This field is supported for Cloud Composer environments in versions
1459  // composer-1.*.*-airflow-*.*.*.
1460  string location = 1;
1461
1462  // Optional. The Compute Engine
1463  // [machine type](/compute/docs/machine-types) used for cluster instances,
1464  // specified as a
1465  // [relative resource
1466  // name](/apis/design/resource_names#relative_resource_name). For example:
1467  // "projects/{projectId}/zones/{zoneId}/machineTypes/{machineTypeId}".
1468  //
1469  // The `machineType` must belong to the enclosing environment's project and
1470  // location. If both this field and `nodeConfig.location` are specified,
1471  // this `machineType` must belong to the `nodeConfig.location`; if both are
1472  // unspecified, the service will pick a zone in the Compute Engine region
1473  // corresponding to the Cloud Composer location, and propagate that choice to
1474  // both fields. If exactly one of this field and `nodeConfig.location` is
1475  // specified, the location information from the specified field will be
1476  // propagated to the unspecified field.
1477  //
1478  // The `machineTypeId` must not be a [shared-core machine
1479  // type](/compute/docs/machine-types#sharedcore).
1480  //
1481  // If this field is unspecified, the `machineTypeId` defaults
1482  // to "n1-standard-1".
1483  //
1484  // This field is supported for Cloud Composer environments in versions
1485  // composer-1.*.*-airflow-*.*.*.
1486  string machine_type = 2;
1487
1488  // Optional. The Compute Engine network to be used for machine
1489  // communications, specified as a
1490  // [relative resource
1491  // name](/apis/design/resource_names#relative_resource_name). For example:
1492  // "projects/{projectId}/global/networks/{networkId}".
1493  //
1494  // If unspecified, the "default" network ID in the environment's project is
1495  // used. If a [Custom Subnet Network](/vpc/docs/vpc#vpc_networks_and_subnets)
1496  // is provided, `nodeConfig.subnetwork` must also be provided. For
1497  // [Shared VPC](/vpc/docs/shared-vpc) subnetwork requirements, see
1498  // `nodeConfig.subnetwork`.
1499  string network = 3;
1500
1501  // Optional. The Compute Engine subnetwork to be used for machine
1502  // communications, specified as a
1503  // [relative resource
1504  // name](/apis/design/resource_names#relative_resource_name). For example:
1505  // "projects/{projectId}/regions/{regionId}/subnetworks/{subnetworkId}"
1506  //
1507  // If a subnetwork is provided, `nodeConfig.network` must also be provided,
1508  // and the subnetwork must belong to the enclosing environment's project and
1509  // location.
1510  string subnetwork = 4;
1511
1512  // Optional. The disk size in GB used for node VMs. Minimum size is 30GB.
1513  // If unspecified, defaults to 100GB. Cannot be updated.
1514  //
1515  // This field is supported for Cloud Composer environments in versions
1516  // composer-1.*.*-airflow-*.*.*.
1517  int32 disk_size_gb = 5;
1518
1519  // Optional. The set of Google API scopes to be made available on all
1520  // node VMs. If `oauth_scopes` is empty, defaults to
1521  // ["https://www.googleapis.com/auth/cloud-platform"]. Cannot be updated.
1522  //
1523  // This field is supported for Cloud Composer environments in versions
1524  // composer-1.*.*-airflow-*.*.*.
1525  repeated string oauth_scopes = 6;
1526
1527  // Optional. The Google Cloud Platform Service Account to be used by the node
1528  // VMs. If a service account is not specified, the "default" Compute Engine
1529  // service account is used. Cannot be updated.
1530  string service_account = 7;
1531
1532  // Optional. The list of instance tags applied to all node VMs. Tags are used
1533  // to identify valid sources or targets for network firewalls. Each tag within
1534  // the list must comply with [RFC1035](https://www.ietf.org/rfc/rfc1035.txt).
1535  // Cannot be updated.
1536  repeated string tags = 8;
1537
1538  // Optional. The configuration for controlling how IPs are allocated in the
1539  // GKE cluster.
1540  IPAllocationPolicy ip_allocation_policy = 9
1541      [(google.api.field_behavior) = OPTIONAL];
1542
1543  // Optional. Deploys 'ip-masq-agent' daemon set in the GKE cluster and defines
1544  // nonMasqueradeCIDRs equals to pod IP range so IP masquerading is used for
1545  // all destination addresses, except between pods traffic.
1546  //
1547  // See:
1548  // https://cloud.google.com/kubernetes-engine/docs/how-to/ip-masquerade-agent
1549  bool enable_ip_masq_agent = 11 [(google.api.field_behavior) = OPTIONAL];
1550
1551  // Optional. Network Attachment that Cloud Composer environment is connected
1552  // to, which provides connectivity with a user's VPC network. Takes precedence
1553  // over network and subnetwork settings. If not provided, but network and
1554  // subnetwork are defined during environment, it will be provisioned. If not
1555  // provided and network and subnetwork are also empty, then connectivity to
1556  // user's VPC network is disabled. Network attachment must be provided in
1557  // format
1558  // projects/{project}/regions/{region}/networkAttachments/{networkAttachment}.
1559  //
1560  // This field is supported for Cloud Composer environments in versions
1561  // composer-3.*.*-airflow-*.*.* and newer.
1562  string composer_network_attachment = 12
1563      [(google.api.field_behavior) = OPTIONAL];
1564
1565  // Optional. The IP range in CIDR notation to use internally by Cloud
1566  // Composer. IP addresses are not reserved - and the same range can be used by
1567  // multiple Cloud Composer environments. In case of overlap, IPs from this
1568  // range will not be accessible in the user's VPC network. Cannot be updated.
1569  // If not specified, the default value of '100.64.128.0/20' is used.
1570  //
1571  // This field is supported for Cloud Composer environments in versions
1572  // composer-3.*.*-airflow-*.*.* and newer.
1573  string composer_internal_ipv4_cidr_block = 13
1574      [(google.api.field_behavior) = OPTIONAL];
1575}
1576
1577// Configuration options for the private GKE cluster in a Cloud Composer
1578// environment.
1579message PrivateClusterConfig {
1580  // Optional. If `true`, access to the public endpoint of the GKE cluster is
1581  // denied.
1582  bool enable_private_endpoint = 1 [(google.api.field_behavior) = OPTIONAL];
1583
1584  // Optional. The CIDR block from which IPv4 range for GKE master will be
1585  // reserved. If left blank, the default value of '172.16.0.0/23' is used.
1586  string master_ipv4_cidr_block = 2 [(google.api.field_behavior) = OPTIONAL];
1587
1588  // Output only. The IP range in CIDR notation to use for the hosted master
1589  // network. This range is used for assigning internal IP addresses to the GKE
1590  // cluster master or set of masters and to the internal load balancer virtual
1591  // IP. This range must not overlap with any other ranges in use within the
1592  // cluster's network.
1593  string master_ipv4_reserved_range = 3
1594      [(google.api.field_behavior) = OUTPUT_ONLY];
1595}
1596
1597// Configuration options for networking connections in the Composer 2
1598// environment.
1599message NetworkingConfig {
1600  // Represents connection type between Composer environment in Customer
1601  // Project and the corresponding Tenant project, from a predefined list
1602  // of available connection modes.
1603  enum ConnectionType {
1604    // No specific connection type was requested, so the environment uses
1605    // the default value corresponding to the rest of its configuration.
1606    CONNECTION_TYPE_UNSPECIFIED = 0;
1607
1608    // Requests the use of VPC peerings for connecting the Customer and Tenant
1609    // projects.
1610    VPC_PEERING = 1;
1611
1612    // Requests the use of Private Service Connect for connecting the Customer
1613    // and Tenant projects.
1614    PRIVATE_SERVICE_CONNECT = 2;
1615  }
1616
1617  // Optional. Indicates the user requested specifc connection type between
1618  // Tenant and Customer projects. You cannot set networking connection type in
1619  // public IP environment.
1620  ConnectionType connection_type = 1 [(google.api.field_behavior) = OPTIONAL];
1621}
1622
1623// The configuration information for configuring a Private IP Cloud Composer
1624// environment.
1625message PrivateEnvironmentConfig {
1626  // Optional. If `true`, a Private IP Cloud Composer environment is created.
1627  // If this field is set to true, `IPAllocationPolicy.use_ip_aliases` must be
1628  // set to true for Cloud Composer environments in versions
1629  // composer-1.*.*-airflow-*.*.*.
1630  bool enable_private_environment = 1 [(google.api.field_behavior) = OPTIONAL];
1631
1632  // Optional. If `true`, builds performed during operations that install Python
1633  // packages have only private connectivity to Google services (including
1634  // Artifact Registry) and VPC network (if either `NodeConfig.network` and
1635  // `NodeConfig.subnetwork` fields or `NodeConfig.composer_network_attachment`
1636  // field are specified). If `false`, the builds also have access to the
1637  // internet.
1638  //
1639  // This field is supported for Cloud Composer environments in versions
1640  // composer-3.*.*-airflow-*.*.* and newer.
1641  bool enable_private_builds_only = 11 [(google.api.field_behavior) = OPTIONAL];
1642
1643  // Optional. Configuration for the private GKE cluster for a Private IP
1644  // Cloud Composer environment.
1645  PrivateClusterConfig private_cluster_config = 2
1646      [(google.api.field_behavior) = OPTIONAL];
1647
1648  // Optional. The CIDR block from which IP range for web server will be
1649  // reserved. Needs to be disjoint from
1650  // `private_cluster_config.master_ipv4_cidr_block` and
1651  // `cloud_sql_ipv4_cidr_block`.
1652  //
1653  // This field is supported for Cloud Composer environments in versions
1654  // composer-1.*.*-airflow-*.*.*.
1655  string web_server_ipv4_cidr_block = 3
1656      [(google.api.field_behavior) = OPTIONAL];
1657
1658  // Optional. The CIDR block from which IP range in tenant project will be
1659  // reserved for Cloud SQL. Needs to be disjoint from
1660  // `web_server_ipv4_cidr_block`.
1661  string cloud_sql_ipv4_cidr_block = 4 [(google.api.field_behavior) = OPTIONAL];
1662
1663  // Output only. The IP range reserved for the tenant project's App Engine VMs.
1664  //
1665  // This field is supported for Cloud Composer environments in versions
1666  // composer-1.*.*-airflow-*.*.*.
1667  string web_server_ipv4_reserved_range = 5
1668      [(google.api.field_behavior) = OUTPUT_ONLY];
1669
1670  // Optional. The CIDR block from which IP range for Cloud Composer Network in
1671  // tenant project will be reserved. Needs to be disjoint from
1672  // private_cluster_config.master_ipv4_cidr_block and
1673  // cloud_sql_ipv4_cidr_block.
1674  //
1675  // This field is supported for Cloud Composer environments in versions
1676  // composer-2.*.*-airflow-*.*.* and newer.
1677  string cloud_composer_network_ipv4_cidr_block = 7
1678      [(google.api.field_behavior) = OPTIONAL];
1679
1680  // Output only. The IP range reserved for the tenant project's Cloud Composer
1681  // network.
1682  //
1683  // This field is supported for Cloud Composer environments in versions
1684  // composer-2.*.*-airflow-*.*.* and newer.
1685  string cloud_composer_network_ipv4_reserved_range = 8
1686      [(google.api.field_behavior) = OUTPUT_ONLY];
1687
1688  // Optional. When enabled, IPs from public (non-RFC1918) ranges can be used
1689  // for `IPAllocationPolicy.cluster_ipv4_cidr_block` and
1690  // `IPAllocationPolicy.service_ipv4_cidr_block`.
1691  bool enable_privately_used_public_ips = 6
1692      [(google.api.field_behavior) = OPTIONAL];
1693
1694  // Optional. When specified, the environment will use Private Service Connect
1695  // instead of VPC peerings to connect to Cloud SQL in the Tenant Project,
1696  // and the PSC endpoint in the Customer Project will use an IP address from
1697  // this subnetwork.
1698  string cloud_composer_connection_subnetwork = 9
1699      [(google.api.field_behavior) = OPTIONAL];
1700
1701  // Optional. Configuration for the network connections configuration in the
1702  // environment.
1703  NetworkingConfig networking_config = 10
1704      [(google.api.field_behavior) = OPTIONAL];
1705}
1706
1707// The Kubernetes workloads configuration for GKE cluster associated with the
1708// Cloud Composer environment. Supported for Cloud Composer environments in
1709// versions composer-2.*.*-airflow-*.*.* and newer.
1710message WorkloadsConfig {
1711  // Configuration for resources used by Airflow schedulers.
1712  message SchedulerResource {
1713    // Optional. CPU request and limit for a single Airflow scheduler replica.
1714    float cpu = 1 [(google.api.field_behavior) = OPTIONAL];
1715
1716    // Optional. Memory (GB) request and limit for a single Airflow scheduler
1717    // replica.
1718    float memory_gb = 2 [(google.api.field_behavior) = OPTIONAL];
1719
1720    // Optional. Storage (GB) request and limit for a single Airflow scheduler
1721    // replica.
1722    float storage_gb = 3 [(google.api.field_behavior) = OPTIONAL];
1723
1724    // Optional. The number of schedulers.
1725    int32 count = 4 [(google.api.field_behavior) = OPTIONAL];
1726  }
1727
1728  // Configuration for resources used by Airflow web server.
1729  message WebServerResource {
1730    // Optional. CPU request and limit for Airflow web server.
1731    float cpu = 1 [(google.api.field_behavior) = OPTIONAL];
1732
1733    // Optional. Memory (GB) request and limit for Airflow web server.
1734    float memory_gb = 2 [(google.api.field_behavior) = OPTIONAL];
1735
1736    // Optional. Storage (GB) request and limit for Airflow web server.
1737    float storage_gb = 3 [(google.api.field_behavior) = OPTIONAL];
1738  }
1739
1740  // Configuration for resources used by Airflow workers.
1741  message WorkerResource {
1742    // Optional. CPU request and limit for a single Airflow worker replica.
1743    float cpu = 1 [(google.api.field_behavior) = OPTIONAL];
1744
1745    // Optional. Memory (GB) request and limit for a single Airflow worker
1746    // replica.
1747    float memory_gb = 2 [(google.api.field_behavior) = OPTIONAL];
1748
1749    // Optional. Storage (GB) request and limit for a single Airflow worker
1750    // replica.
1751    float storage_gb = 3 [(google.api.field_behavior) = OPTIONAL];
1752
1753    // Optional. Minimum number of workers for autoscaling.
1754    int32 min_count = 4 [(google.api.field_behavior) = OPTIONAL];
1755
1756    // Optional. Maximum number of workers for autoscaling.
1757    int32 max_count = 5 [(google.api.field_behavior) = OPTIONAL];
1758  }
1759
1760  // Configuration for resources used by Airflow triggerers.
1761  message TriggererResource {
1762    // Optional. The number of triggerers.
1763    int32 count = 1 [(google.api.field_behavior) = OPTIONAL];
1764
1765    // Optional. CPU request and limit for a single Airflow triggerer replica.
1766    float cpu = 2 [(google.api.field_behavior) = OPTIONAL];
1767
1768    // Optional. Memory (GB) request and limit for a single Airflow triggerer
1769    // replica.
1770    float memory_gb = 3 [(google.api.field_behavior) = OPTIONAL];
1771  }
1772
1773  // Configuration for resources used by Airflow DAG processors.
1774  message DagProcessorResource {
1775    // Optional. CPU request and limit for a single Airflow DAG processor
1776    // replica.
1777    float cpu = 1 [(google.api.field_behavior) = OPTIONAL];
1778
1779    // Optional. Memory (GB) request and limit for a single Airflow DAG
1780    // processor replica.
1781    float memory_gb = 2 [(google.api.field_behavior) = OPTIONAL];
1782
1783    // Optional. Storage (GB) request and limit for a single Airflow DAG
1784    // processor replica.
1785    float storage_gb = 3 [(google.api.field_behavior) = OPTIONAL];
1786
1787    // Optional. The number of DAG processors. If not provided or set to 0, a
1788    // single DAG processor instance will be created.
1789    int32 count = 4 [(google.api.field_behavior) = OPTIONAL];
1790  }
1791
1792  // Optional. Resources used by Airflow schedulers.
1793  SchedulerResource scheduler = 1 [(google.api.field_behavior) = OPTIONAL];
1794
1795  // Optional. Resources used by Airflow web server.
1796  WebServerResource web_server = 2 [(google.api.field_behavior) = OPTIONAL];
1797
1798  // Optional. Resources used by Airflow workers.
1799  WorkerResource worker = 3 [(google.api.field_behavior) = OPTIONAL];
1800
1801  // Optional. Resources used by Airflow triggerers.
1802  TriggererResource triggerer = 4 [(google.api.field_behavior) = OPTIONAL];
1803
1804  // Optional. Resources used by Airflow DAG processors.
1805  //
1806  // This field is supported for Cloud Composer environments in versions
1807  // composer-3.*.*-airflow-*.*.* and newer.
1808  DagProcessorResource dag_processor = 5
1809      [(google.api.field_behavior) = OPTIONAL];
1810}
1811
1812// The Recovery settings of an environment.
1813message RecoveryConfig {
1814  // Optional. The configuration for scheduled snapshot creation mechanism.
1815  ScheduledSnapshotsConfig scheduled_snapshots_config = 1
1816      [(google.api.field_behavior) = OPTIONAL];
1817}
1818
1819// The configuration for scheduled snapshot creation mechanism.
1820message ScheduledSnapshotsConfig {
1821  // Optional. Whether scheduled snapshots creation is enabled.
1822  bool enabled = 1 [(google.api.field_behavior) = OPTIONAL];
1823
1824  // Optional. The Cloud Storage location for storing automatically created
1825  // snapshots.
1826  string snapshot_location = 6 [(google.api.field_behavior) = OPTIONAL];
1827
1828  // Optional. The cron expression representing the time when snapshots creation
1829  // mechanism runs. This field is subject to additional validation around
1830  // frequency of execution.
1831  string snapshot_creation_schedule = 3
1832      [(google.api.field_behavior) = OPTIONAL];
1833
1834  // Optional. Time zone that sets the context to interpret
1835  // snapshot_creation_schedule.
1836  string time_zone = 5 [(google.api.field_behavior) = OPTIONAL];
1837}
1838
1839// Configuration options for the master authorized networks feature. Enabled
1840// master authorized networks will disallow all external traffic to access
1841// Kubernetes master through HTTPS except traffic from the given CIDR blocks,
1842// Google Compute Engine Public IPs and Google Prod IPs.
1843message MasterAuthorizedNetworksConfig {
1844  // CIDR block with an optional name.
1845  message CidrBlock {
1846    // User-defined name that identifies the CIDR block.
1847    string display_name = 1;
1848
1849    // CIDR block that must be specified in CIDR notation.
1850    string cidr_block = 2;
1851  }
1852
1853  // Whether or not master authorized networks feature is enabled.
1854  bool enabled = 1;
1855
1856  // Up to 50 external networks that could access Kubernetes master through
1857  // HTTPS.
1858  repeated CidrBlock cidr_blocks = 2;
1859}
1860
1861// Configuration for Cloud Data Lineage integration.
1862message CloudDataLineageIntegration {
1863  // Optional. Whether or not Cloud Data Lineage integration is enabled.
1864  bool enabled = 1 [(google.api.field_behavior) = OPTIONAL];
1865}
1866
1867// An environment for running orchestration tasks.
1868message Environment {
1869  option (google.api.resource) = {
1870    type: "composer.googleapis.com/Environment"
1871    pattern: "projects/{project}/locations/{location}/environments/{environment}"
1872  };
1873
1874  // State of the environment.
1875  enum State {
1876    // The state of the environment is unknown.
1877    STATE_UNSPECIFIED = 0;
1878
1879    // The environment is in the process of being created.
1880    CREATING = 1;
1881
1882    // The environment is currently running and healthy. It is ready for use.
1883    RUNNING = 2;
1884
1885    // The environment is being updated. It remains usable but cannot receive
1886    // additional update requests or be deleted at this time.
1887    UPDATING = 3;
1888
1889    // The environment is undergoing deletion. It cannot be used.
1890    DELETING = 4;
1891
1892    // The environment has encountered an error and cannot be used.
1893    ERROR = 5;
1894  }
1895
1896  // The resource name of the environment, in the form:
1897  // "projects/{projectId}/locations/{locationId}/environments/{environmentId}"
1898  //
1899  // EnvironmentId must start with a lowercase letter followed by up to 63
1900  // lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
1901  string name = 1;
1902
1903  // Configuration parameters for this environment.
1904  EnvironmentConfig config = 2;
1905
1906  // Output only. The UUID (Universally Unique IDentifier) associated with this
1907  // environment. This value is generated when the environment is created.
1908  string uuid = 3;
1909
1910  // The current state of the environment.
1911  State state = 4;
1912
1913  // Output only. The time at which this environment was created.
1914  google.protobuf.Timestamp create_time = 5;
1915
1916  // Output only. The time at which this environment was last modified.
1917  google.protobuf.Timestamp update_time = 6;
1918
1919  // Optional. User-defined labels for this environment.
1920  // The labels map can contain no more than 64 entries. Entries of the labels
1921  // map are UTF8 strings that comply with the following restrictions:
1922  //
1923  // * Keys must conform to regexp: [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}
1924  // * Values must conform to regexp:  [\p{Ll}\p{Lo}\p{N}_-]{0,63}
1925  // * Both keys and values are additionally constrained to be <= 128 bytes in
1926  // size.
1927  map<string, string> labels = 7;
1928
1929  // Output only. Reserved for future use.
1930  bool satisfies_pzs = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
1931
1932  // Optional. Storage configuration for this environment.
1933  StorageConfig storage_config = 9 [(google.api.field_behavior) = OPTIONAL];
1934}
1935
1936// Message containing information about the result of an upgrade check
1937// operation.
1938message CheckUpgradeResponse {
1939  // Whether there were python modules conflict during image build.
1940  enum ConflictResult {
1941    // It is unknown whether build had conflicts or not.
1942    CONFLICT_RESULT_UNSPECIFIED = 0;
1943
1944    // There were python packages conflicts.
1945    CONFLICT = 1;
1946
1947    // There were no python packages conflicts.
1948    NO_CONFLICT = 2;
1949  }
1950
1951  // Output only. Url for a docker build log of an upgraded image.
1952  string build_log_uri = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
1953
1954  // Output only. Whether build has succeeded or failed on modules conflicts.
1955  ConflictResult contains_pypi_modules_conflict = 4
1956      [(google.api.field_behavior) = OUTPUT_ONLY];
1957
1958  // Output only. Extract from a docker image build log containing information
1959  // about pypi modules conflicts.
1960  string pypi_conflict_build_log_extract = 3
1961      [(google.api.field_behavior) = OUTPUT_ONLY];
1962
1963  // Composer image for which the build was happening.
1964  string image_version = 5;
1965
1966  // Pypi dependencies specified in the environment configuration, at the time
1967  // when the build was triggered.
1968  map<string, string> pypi_dependencies = 6;
1969}
1970
1971// The configuration setting for Airflow database data retention mechanism.
1972message DataRetentionConfig {
1973  // Optional. The configuration settings for task logs retention
1974  TaskLogsRetentionConfig task_logs_retention_config = 2
1975      [(google.api.field_behavior) = OPTIONAL];
1976}
1977
1978// The configuration setting for Task Logs.
1979message TaskLogsRetentionConfig {
1980  // The definition of task_logs_storage_mode.
1981  enum TaskLogsStorageMode {
1982    // This configuration is not specified by the user.
1983    TASK_LOGS_STORAGE_MODE_UNSPECIFIED = 0;
1984
1985    // Store task logs in Cloud Logging and in the environment's Cloud Storage
1986    // bucket.
1987    CLOUD_LOGGING_AND_CLOUD_STORAGE = 1;
1988
1989    // Store task logs in Cloud Logging only.
1990    CLOUD_LOGGING_ONLY = 2;
1991  }
1992
1993  // Optional. The mode of storage for Airflow workers task logs. For details,
1994  // see go/composer-store-task-logs-in-cloud-logging-only-design-doc
1995  TaskLogsStorageMode storage_mode = 2 [(google.api.field_behavior) = OPTIONAL];
1996}
1997