/
config.proto
1910 lines (1586 loc) · 67.9 KB
/
config.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.config.v1;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/field_info.proto";
import "google/api/resource.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";
import "google/rpc/status.proto";
option csharp_namespace = "Google.Cloud.Config.V1";
option go_package = "cloud.google.com/go/config/apiv1/configpb;configpb";
option java_multiple_files = true;
option java_outer_classname = "ConfigProto";
option java_package = "com.google.cloud.config.v1";
option php_namespace = "Google\\Cloud\\Config\\V1";
option ruby_package = "Google::Cloud::ConfigService::V1";
option (google.api.resource_definition) = {
type: "iam.googleapis.com/ServiceAccount"
pattern: "projects/{project}/serviceAccounts/{service_account}"
};
option (google.api.resource_definition) = {
type: "cloudbuild.googleapis.com/WorkerPool"
pattern: "projects/{project}/locations/{location}/workerPools/{worker_pool}"
};
// Infrastructure Manager is a managed service that automates the deployment and
// management of Google Cloud infrastructure resources.
service Config {
option (google.api.default_host) = "config.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform";
// Lists [Deployment][google.cloud.config.v1.Deployment]s in a given project
// and location.
rpc ListDeployments(ListDeploymentsRequest)
returns (ListDeploymentsResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*}/deployments"
};
option (google.api.method_signature) = "parent";
}
// Gets details about a [Deployment][google.cloud.config.v1.Deployment].
rpc GetDeployment(GetDeploymentRequest) returns (Deployment) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/deployments/*}"
};
option (google.api.method_signature) = "name";
}
// Creates a [Deployment][google.cloud.config.v1.Deployment].
rpc CreateDeployment(CreateDeploymentRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*}/deployments"
body: "deployment"
};
option (google.api.method_signature) = "parent,deployment,deployment_id";
option (google.longrunning.operation_info) = {
response_type: "Deployment"
metadata_type: "OperationMetadata"
};
}
// Updates a [Deployment][google.cloud.config.v1.Deployment].
rpc UpdateDeployment(UpdateDeploymentRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
patch: "/v1/{deployment.name=projects/*/locations/*/deployments/*}"
body: "deployment"
};
option (google.api.method_signature) = "deployment,update_mask";
option (google.longrunning.operation_info) = {
response_type: "Deployment"
metadata_type: "OperationMetadata"
};
}
// Deletes a [Deployment][google.cloud.config.v1.Deployment].
rpc DeleteDeployment(DeleteDeploymentRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
delete: "/v1/{name=projects/*/locations/*/deployments/*}"
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "Deployment"
metadata_type: "OperationMetadata"
};
}
// Lists [Revision][google.cloud.config.v1.Revision]s of a deployment.
rpc ListRevisions(ListRevisionsRequest) returns (ListRevisionsResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*/deployments/*}/revisions"
};
option (google.api.method_signature) = "parent";
}
// Gets details about a [Revision][google.cloud.config.v1.Revision].
rpc GetRevision(GetRevisionRequest) returns (Revision) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/deployments/*/revisions/*}"
};
option (google.api.method_signature) = "name";
}
// Gets details about a [Resource][google.cloud.config.v1.Resource] deployed
// by Infra Manager.
rpc GetResource(GetResourceRequest) returns (Resource) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/deployments/*/revisions/*/resources/*}"
};
option (google.api.method_signature) = "name";
}
// Lists [Resource][google.cloud.config.v1.Resource]s in a given revision.
rpc ListResources(ListResourcesRequest) returns (ListResourcesResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*/deployments/*/revisions/*}/resources"
};
option (google.api.method_signature) = "parent";
}
// Exports Terraform state file from a given deployment.
rpc ExportDeploymentStatefile(ExportDeploymentStatefileRequest)
returns (Statefile) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*/deployments/*}:exportState"
body: "*"
};
}
// Exports Terraform state file from a given revision.
rpc ExportRevisionStatefile(ExportRevisionStatefileRequest)
returns (Statefile) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*/deployments/*/revisions/*}:exportState"
body: "*"
};
}
// Imports Terraform state file in a given deployment. The state file does not
// take effect until the Deployment has been unlocked.
rpc ImportStatefile(ImportStatefileRequest) returns (Statefile) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*/deployments/*}:importState"
body: "*"
};
option (google.api.method_signature) = "parent,lock_id";
}
// Deletes Terraform state file in a given deployment.
rpc DeleteStatefile(DeleteStatefileRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/v1/{name=projects/*/locations/*/deployments/*}:deleteState"
body: "*"
};
option (google.api.method_signature) = "name";
}
// Locks a deployment.
rpc LockDeployment(LockDeploymentRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{name=projects/*/locations/*/deployments/*}:lock"
body: "*"
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "Deployment"
metadata_type: "OperationMetadata"
};
}
// Unlocks a locked deployment.
rpc UnlockDeployment(UnlockDeploymentRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{name=projects/*/locations/*/deployments/*}:unlock"
body: "*"
};
option (google.api.method_signature) = "name,lock_id";
option (google.longrunning.operation_info) = {
response_type: "Deployment"
metadata_type: "OperationMetadata"
};
}
// Exports the lock info on a locked deployment.
rpc ExportLockInfo(ExportLockInfoRequest) returns (LockInfo) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/deployments/*}:exportLock"
};
option (google.api.method_signature) = "name";
}
// Creates a [Preview][google.cloud.config.v1.Preview].
rpc CreatePreview(CreatePreviewRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*}/previews"
body: "preview"
};
option (google.api.method_signature) = "parent,preview";
option (google.longrunning.operation_info) = {
response_type: "Preview"
metadata_type: "OperationMetadata"
};
}
// Gets details about a [Preview][google.cloud.config.v1.Preview].
rpc GetPreview(GetPreviewRequest) returns (Preview) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/previews/*}"
};
option (google.api.method_signature) = "name";
}
// Lists [Preview][google.cloud.config.v1.Preview]s in a given project and
// location.
rpc ListPreviews(ListPreviewsRequest) returns (ListPreviewsResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*}/previews"
};
option (google.api.method_signature) = "parent";
}
// Deletes a [Preview][google.cloud.config.v1.Preview].
rpc DeletePreview(DeletePreviewRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
delete: "/v1/{name=projects/*/locations/*/previews/*}"
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "Preview"
metadata_type: "OperationMetadata"
};
}
// Export [Preview][google.cloud.config.v1.Preview] results.
rpc ExportPreviewResult(ExportPreviewResultRequest)
returns (ExportPreviewResultResponse) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*/previews/*}:export"
body: "*"
};
}
// Lists [TerraformVersion][google.cloud.config.v1.TerraformVersion]s in a
// given project and location.
rpc ListTerraformVersions(ListTerraformVersionsRequest)
returns (ListTerraformVersionsResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*}/terraformVersions"
};
option (google.api.method_signature) = "parent";
}
// Gets details about a
// [TerraformVersion][google.cloud.config.v1.TerraformVersion].
rpc GetTerraformVersion(GetTerraformVersionRequest)
returns (TerraformVersion) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/terraformVersions/*}"
};
option (google.api.method_signature) = "name";
}
}
// Enum values to control quota checks for resources in terraform
// configuration files.
enum QuotaValidation {
// The default value.
// QuotaValidation on terraform configuration files will be disabled in
// this case.
QUOTA_VALIDATION_UNSPECIFIED = 0;
// Enable computing quotas for resources in terraform configuration files to
// get visibility on resources with insufficient quotas.
ENABLED = 1;
// Enforce quota checks so deployment fails if there isn't sufficient quotas
// available to deploy resources in terraform configuration files.
ENFORCED = 2;
}
// A Deployment is a group of resources and configs managed and provisioned by
// Infra Manager.
message Deployment {
option (google.api.resource) = {
type: "config.googleapis.com/Deployment"
pattern: "projects/{project}/locations/{location}/deployments/{deployment}"
};
// Possible states of a deployment.
enum State {
// The default value. This value is used if the state is omitted.
STATE_UNSPECIFIED = 0;
// The deployment is being created.
CREATING = 1;
// The deployment is healthy.
ACTIVE = 2;
// The deployment is being updated.
UPDATING = 3;
// The deployment is being deleted.
DELETING = 4;
// The deployment has encountered an unexpected error.
FAILED = 5;
// The deployment is no longer being actively reconciled.
// This may be the result of recovering the project after deletion.
SUSPENDED = 6;
// The deployment has been deleted.
DELETED = 7;
}
// Possible errors that can occur with deployments.
enum ErrorCode {
// No error code was specified.
ERROR_CODE_UNSPECIFIED = 0;
// The revision failed. See Revision for more details.
REVISION_FAILED = 1;
// Cloud Build failed due to a permission issue.
CLOUD_BUILD_PERMISSION_DENIED = 3;
// Cloud Build job associated with a deployment deletion could not be
// started.
DELETE_BUILD_API_FAILED = 5;
// Cloud Build job associated with a deployment deletion was started but
// failed.
DELETE_BUILD_RUN_FAILED = 6;
// Cloud Storage bucket creation failed due to a permission issue.
BUCKET_CREATION_PERMISSION_DENIED = 7;
// Cloud Storage bucket creation failed due to an issue unrelated to
// permissions.
BUCKET_CREATION_FAILED = 8;
}
// Possible lock states of a deployment.
enum LockState {
// The default value. This value is used if the lock state is omitted.
LOCK_STATE_UNSPECIFIED = 0;
// The deployment is locked.
LOCKED = 1;
// The deployment is unlocked.
UNLOCKED = 2;
// The deployment is being locked.
LOCKING = 3;
// The deployment is being unlocked.
UNLOCKING = 4;
// The deployment has failed to lock.
LOCK_FAILED = 5;
// The deployment has failed to unlock.
UNLOCK_FAILED = 6;
}
// Blueprint to deploy.
oneof blueprint {
// A blueprint described using Terraform's HashiCorp Configuration Language
// as a root module.
TerraformBlueprint terraform_blueprint = 6;
}
// Resource name of the deployment.
// Format: `projects/{project}/locations/{location}/deployments/{deployment}`
string name = 1;
// Output only. Time when the deployment was created.
google.protobuf.Timestamp create_time = 2
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Time when the deployment was last modified.
google.protobuf.Timestamp update_time = 3
[(google.api.field_behavior) = OUTPUT_ONLY];
// User-defined metadata for the deployment.
map<string, string> labels = 4;
// Output only. Current state of the deployment.
State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Revision name that was most recently applied.
// Format: `projects/{project}/locations/{location}/deployments/{deployment}/
// revisions/{revision}`
string latest_revision = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Additional information regarding the current state.
string state_detail = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Error code describing errors that may have occurred.
ErrorCode error_code = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Location of artifacts from a DeleteDeployment operation.
ApplyResults delete_results = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Cloud Build instance UUID associated with deleting this
// deployment.
string delete_build = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Location of Cloud Build logs in Google Cloud Storage,
// populated when deleting this deployment. Format: `gs://{bucket}/{object}`.
string delete_logs = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Errors encountered when deleting this deployment.
// Errors are truncated to 10 entries, see `delete_results` and `error_logs`
// for full details.
repeated TerraformError tf_errors = 13
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Location of Terraform error logs in Google Cloud Storage.
// Format: `gs://{bucket}/{object}`.
string error_logs = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
// Optional. User-defined location of Cloud Build logs and artifacts in Google
// Cloud Storage. Format: `gs://{bucket}/{folder}`
//
// A default bucket will be bootstrapped if the field is not set or empty.
// Default bucket format: `gs://<project number>-<region>-blueprint-config`
// Constraints:
// - The bucket needs to be in the same project as the deployment
// - The path cannot be within the path of `gcs_source`
// - The field cannot be updated, including changing its presence
optional string artifacts_gcs_bucket = 15
[(google.api.field_behavior) = OPTIONAL];
// Optional. User-specified Service Account (SA) credentials to be used when
// actuating resources.
// Format: `projects/{projectID}/serviceAccounts/{serviceAccount}`
optional string service_account = 16 [
(google.api.field_behavior) = OPTIONAL,
(google.api.resource_reference) = {
type: "iam.googleapis.com/ServiceAccount"
}
];
// By default, Infra Manager will return a failure when
// Terraform encounters a 409 code (resource conflict error) during actuation.
// If this flag is set to true, Infra Manager will instead
// attempt to automatically import the resource into the Terraform state (for
// supported resource types) and continue actuation.
//
// Not all resource types are supported, refer to documentation.
optional bool import_existing_resources = 17;
// Optional. The user-specified Cloud Build worker pool resource in which the
// Cloud Build job will execute. Format:
// `projects/{project}/locations/{location}/workerPools/{workerPoolId}`.
// If this field is unspecified, the default Cloud Build worker pool will be
// used.
optional string worker_pool = 19 [
(google.api.field_behavior) = OPTIONAL,
(google.api.resource_reference) = {
type: "cloudbuild.googleapis.com/WorkerPool"
}
];
// Output only. Current lock state of the deployment.
LockState lock_state = 20 [(google.api.field_behavior) = OUTPUT_ONLY];
// Optional. The user-specified Terraform version constraint.
// Example: "=1.3.10".
optional string tf_version_constraint = 21
[(google.api.field_behavior) = OPTIONAL];
// Output only. The current Terraform version set on the deployment.
// It is in the format of "Major.Minor.Patch", for example, "1.3.10".
string tf_version = 22 [(google.api.field_behavior) = OUTPUT_ONLY];
// Optional. Input to control quota checks for resources in terraform
// configuration files. There are limited resources on which quota validation
// applies.
QuotaValidation quota_validation = 23
[(google.api.field_behavior) = OPTIONAL];
}
// TerraformBlueprint describes the source of a Terraform root module which
// describes the resources and configs to be deployed.
message TerraformBlueprint {
// Location of the source configs.
oneof source {
// Required. URI of an object in Google Cloud Storage.
// Format: `gs://{bucket}/{object}`
//
// URI may also specify an object version for zipped objects.
// Format: `gs://{bucket}/{object}#{version}`
string gcs_source = 1 [(google.api.field_behavior) = REQUIRED];
// Required. URI of a public Git repo.
GitSource git_source = 2 [(google.api.field_behavior) = REQUIRED];
}
// Input variable values for the Terraform blueprint.
map<string, TerraformVariable> input_values = 4;
}
// A Terraform input variable.
message TerraformVariable {
// Input variable value.
google.protobuf.Value input_value = 5;
}
// Outputs and artifacts from applying a deployment.
message ApplyResults {
// Location of a blueprint copy and other manifests in Google Cloud Storage.
// Format: `gs://{bucket}/{object}`
string content = 1;
// Location of artifacts (e.g. logs) in Google Cloud Storage.
// Format: `gs://{bucket}/{object}`
string artifacts = 2;
// Map of output name to output info.
map<string, TerraformOutput> outputs = 3;
}
// Describes a Terraform output.
message TerraformOutput {
// Identifies whether Terraform has set this output as a potential
// sensitive value.
bool sensitive = 1;
// Value of output.
google.protobuf.Value value = 2;
}
message ListDeploymentsRequest {
// Required. The parent in whose context the Deployments are listed. The
// parent value is in the format:
// 'projects/{project_id}/locations/{location}'.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "locations.googleapis.com/Location"
}
];
// When requesting a page of resources, 'page_size' specifies number of
// resources to return. If unspecified, at most 500 will be returned. The
// maximum value is 1000.
int32 page_size = 2;
// Token returned by previous call to 'ListDeployments' which specifies the
// position in the list from where to continue listing the resources.
string page_token = 3;
// Lists the Deployments that match the filter expression. A filter
// expression filters the resources listed in the response. The expression
// must be of the form '{field} {operator} {value}' where operators: '<', '>',
// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
// operator which is roughly synonymous with equality). {field} can refer to a
// proto or JSON field, or a synthetic field. Field names can be camelCase or
// snake_case.
//
// Examples:
// - Filter by name:
// name = "projects/foo/locations/us-central1/deployments/bar
//
// - Filter by labels:
// - Resources that have a key called 'foo'
// labels.foo:*
// - Resources that have a key called 'foo' whose value is 'bar'
// labels.foo = bar
//
// - Filter by state:
// - Deployments in CREATING state.
// state=CREATING
string filter = 4;
// Field to use to sort the list.
string order_by = 5;
}
message ListDeploymentsResponse {
// List of [Deployment][google.cloud.config.v1.Deployment]s.
repeated Deployment deployments = 1;
// Token to be supplied to the next ListDeployments request via `page_token`
// to obtain the next set of results.
string next_page_token = 2;
// Locations that could not be reached.
repeated string unreachable = 3;
}
message GetDeploymentRequest {
// Required. The name of the deployment. Format:
// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "config.googleapis.com/Deployment"
}
];
}
// A request to list Revisions passed to a 'ListRevisions' call.
message ListRevisionsRequest {
// Required. The parent in whose context the Revisions are listed. The parent
// value is in the format:
// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "config.googleapis.com/Deployment"
}
];
// When requesting a page of resources, `page_size` specifies number of
// resources to return. If unspecified, at most 500 will be returned. The
// maximum value is 1000.
int32 page_size = 2;
// Token returned by previous call to 'ListRevisions' which specifies the
// position in the list from where to continue listing the resources.
string page_token = 3;
// Lists the Revisions that match the filter expression. A filter
// expression filters the resources listed in the response. The expression
// must be of the form '{field} {operator} {value}' where operators: '<', '>',
// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
// operator which is roughly synonymous with equality). {field} can refer to a
// proto or JSON field, or a synthetic field. Field names can be camelCase or
// snake_case.
//
// Examples:
// - Filter by name:
// name = "projects/foo/locations/us-central1/deployments/dep/revisions/bar
//
// - Filter by labels:
// - Resources that have a key called 'foo'
// labels.foo:*
// - Resources that have a key called 'foo' whose value is 'bar'
// labels.foo = bar
//
// - Filter by state:
// - Revisions in CREATING state.
// state=CREATING
string filter = 4;
// Field to use to sort the list.
string order_by = 5;
}
// A response to a 'ListRevisions' call. Contains a list of Revisions.
message ListRevisionsResponse {
// List of [Revision][google.cloud.config.v1.Revision]s.
repeated Revision revisions = 1;
// A token to request the next page of resources from the 'ListRevisions'
// method. The value of an empty string means that there are no more resources
// to return.
string next_page_token = 2;
// Locations that could not be reached.
repeated string unreachable = 3;
}
// A request to get a Revision from a 'GetRevision' call.
message GetRevisionRequest {
// Required. The name of the Revision in the format:
// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { type: "config.googleapis.com/Revision" }
];
}
message CreateDeploymentRequest {
// Required. The parent in whose context the Deployment is created. The parent
// value is in the format: 'projects/{project_id}/locations/{location}'.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "locations.googleapis.com/Location"
}
];
// Required. The Deployment ID.
string deployment_id = 2 [(google.api.field_behavior) = REQUIRED];
// Required. [Deployment][google.cloud.config.v1.Deployment] resource to be
// created.
Deployment deployment = 3 [(google.api.field_behavior) = REQUIRED];
// Optional. An optional request ID to identify requests. Specify a unique
// request ID so that if you must retry your request, the server will know to
// ignore the request if it has already been completed. The server will
// guarantee that for at least 60 minutes since the first request.
//
// For example, consider a situation where you make an initial request and the
// request times out. If you make the request again with the same request ID,
// the server can check if original operation with the same request ID was
// received, and if so, will ignore the second request. This prevents clients
// from accidentally creating duplicate commitments.
//
// The request ID must be a valid UUID with the exception that zero UUID is
// not supported (00000000-0000-0000-0000-000000000000).
string request_id = 4 [(google.api.field_behavior) = OPTIONAL];
}
message UpdateDeploymentRequest {
// Optional. Field mask used to specify the fields to be overwritten in the
// Deployment resource by the update.
//
// The fields specified in the update_mask are relative to the resource, not
// the full request. A field will be overwritten if it is in the mask. If the
// user does not provide a mask then all fields will be overwritten.
google.protobuf.FieldMask update_mask = 1
[(google.api.field_behavior) = OPTIONAL];
// Required. [Deployment][google.cloud.config.v1.Deployment] to update.
//
// The deployment's `name` field is used to identify the resource to be
// updated. Format:
// `projects/{project}/locations/{location}/deployments/{deployment}`
Deployment deployment = 2 [(google.api.field_behavior) = REQUIRED];
// Optional. An optional request ID to identify requests. Specify a unique
// request ID so that if you must retry your request, the server will know to
// ignore the request if it has already been completed. The server will
// guarantee that for at least 60 minutes since the first request.
//
// For example, consider a situation where you make an initial request and the
// request times out. If you make the request again with the same request ID,
// the server can check if original operation with the same request ID was
// received, and if so, will ignore the second request. This prevents clients
// from accidentally creating duplicate commitments.
//
// The request ID must be a valid UUID with the exception that zero UUID is
// not supported (00000000-0000-0000-0000-000000000000).
string request_id = 3 [(google.api.field_behavior) = OPTIONAL];
}
message DeleteDeploymentRequest {
// Policy on how resources actuated by the deployment should be deleted.
enum DeletePolicy {
// Unspecified policy, resources will be deleted.
DELETE_POLICY_UNSPECIFIED = 0;
// Deletes resources actuated by the deployment.
DELETE = 1;
// Abandons resources and only deletes the deployment and its metadata.
ABANDON = 2;
}
// Required. The name of the Deployment in the format:
// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "config.googleapis.com/Deployment"
}
];
// Optional. An optional request ID to identify requests. Specify a unique
// request ID so that if you must retry your request, the server will know to
// ignore the request if it has already been completed. The server will
// guarantee that for at least 60 minutes after the first request.
//
// For example, consider a situation where you make an initial request and the
// request times out. If you make the request again with the same request ID,
// the server can check if original operation with the same request ID was
// received, and if so, will ignore the second request. This prevents clients
// from accidentally creating duplicate commitments.
//
// The request ID must be a valid UUID with the exception that zero UUID is
// not supported (00000000-0000-0000-0000-000000000000).
string request_id = 2 [(google.api.field_behavior) = OPTIONAL];
// Optional. If set to true, any revisions for this deployment will also be
// deleted. (Otherwise, the request will only work if the deployment has no
// revisions.)
bool force = 3 [(google.api.field_behavior) = OPTIONAL];
// Optional. Policy on how resources actuated by the deployment should be
// deleted. If unspecified, the default behavior is to delete the underlying
// resources.
DeletePolicy delete_policy = 4 [(google.api.field_behavior) = OPTIONAL];
}
// Represents the metadata of the long-running operation.
message OperationMetadata {
// Ephemeral metadata about the state of an operation for a particular
// resource.
oneof resource_metadata {
// Output only. Metadata about the deployment operation state.
DeploymentOperationMetadata deployment_metadata = 8
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Metadata about the preview operation state.
PreviewOperationMetadata preview_metadata = 9
[(google.api.field_behavior) = OUTPUT_ONLY];
}
// Output only. Time when the operation was created.
google.protobuf.Timestamp create_time = 1
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Time when the operation finished running.
google.protobuf.Timestamp end_time = 2
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Server-defined resource path for the target of the operation.
string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Name of the verb executed by the operation.
string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Human-readable status of the operation, if any.
string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Identifies whether the user has requested cancellation of the
// operation. Operations that have successfully been cancelled have
// [Operation.error][] value with a
// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
// `Code.CANCELLED`.
bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. API version used to start the operation.
string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
}
// A child resource of a Deployment generated by a 'CreateDeployment' or
// 'UpdateDeployment' call. Each Revision contains metadata pertaining to a
// snapshot of a particular Deployment.
message Revision {
option (google.api.resource) = {
type: "config.googleapis.com/Revision"
pattern: "projects/{project}/locations/{location}/deployments/{deployment}/revisions/{revision}"
};
// Actions that generate a revision.
enum Action {
// The default value. This value is used if the action is omitted.
ACTION_UNSPECIFIED = 0;
// The revision was generated by creating a deployment.
CREATE = 1;
// The revision was generated by updating a deployment.
UPDATE = 2;
// The revision was deleted.
DELETE = 3;
}
// Possible states of a revision.
enum State {
// The default value. This value is used if the state is omitted.
STATE_UNSPECIFIED = 0;
// The revision is being applied.
APPLYING = 1;
// The revision was applied successfully.
APPLIED = 2;
// The revision could not be applied successfully.
FAILED = 3;
}
// Possible errors if Revision could not be created or updated successfully.
enum ErrorCode {
// No error code was specified.
ERROR_CODE_UNSPECIFIED = 0;
// Cloud Build failed due to a permission issue.
CLOUD_BUILD_PERMISSION_DENIED = 1;
// Cloud Build job associated with creating or updating a deployment could
// not be started.
APPLY_BUILD_API_FAILED = 4;
// Cloud Build job associated with creating or updating a deployment was
// started but failed.
APPLY_BUILD_RUN_FAILED = 5;
// quota validation failed for one or more resources in terraform
// configuration files.
QUOTA_VALIDATION_FAILED = 7;
}
// Blueprint that was deployed.
oneof blueprint {
// Output only. A blueprint described using Terraform's HashiCorp
// Configuration Language as a root module.
TerraformBlueprint terraform_blueprint = 6
[(google.api.field_behavior) = OUTPUT_ONLY];
}
// Revision name. Format:
// `projects/{project}/locations/{location}/deployments/{deployment}/
// revisions/{revision}`
string name = 1;
// Output only. Time when the revision was created.
google.protobuf.Timestamp create_time = 2
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Time when the revision was last modified.
google.protobuf.Timestamp update_time = 3
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The action which created this revision
Action action = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Current state of the revision.
State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Outputs and artifacts from applying a deployment.
ApplyResults apply_results = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Additional info regarding the current state.
string state_detail = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Code describing any errors that may have occurred.
ErrorCode error_code = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Cloud Build instance UUID associated with this revision.
string build = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Location of Revision operation logs in
// `gs://{bucket}/{object}` format.
string logs = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Errors encountered when creating or updating this deployment.
// Errors are truncated to 10 entries, see `delete_results` and `error_logs`
// for full details.
repeated TerraformError tf_errors = 12
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Location of Terraform error logs in Google Cloud Storage.
// Format: `gs://{bucket}/{object}`.
string error_logs = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. User-specified Service Account (SA) to be used as credential
// to manage resources. Format:
// `projects/{projectID}/serviceAccounts/{serviceAccount}`
string service_account = 14 [
(google.api.field_behavior) = OUTPUT_ONLY,
(google.api.resource_reference) = {
type: "iam.googleapis.com/ServiceAccount"
}
];
// Output only. By default, Infra Manager will return a failure when
// Terraform encounters a 409 code (resource conflict error) during actuation.
// If this flag is set to true, Infra Manager will instead
// attempt to automatically import the resource into the Terraform state (for
// supported resource types) and continue actuation.
//
// Not all resource types are supported, refer to documentation.
bool import_existing_resources = 15
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The user-specified Cloud Build worker pool resource in which
// the Cloud Build job will execute. Format:
// `projects/{project}/locations/{location}/workerPools/{workerPoolId}`.
// If this field is unspecified, the default Cloud Build worker pool will be