-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
run-gen.go
2755 lines (2419 loc) · 116 KB
/
run-gen.go
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 2022 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated file. DO NOT EDIT.
// Package run provides access to the Cloud Run Admin API.
//
// For product documentation, see: https://cloud.google.com/run/
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/run/v1alpha1"
// ...
// ctx := context.Background()
// runService, err := run.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for authentication.
//
// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// Other authentication options
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// runService, err := run.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// runService, err := run.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package run // import "google.golang.org/api/run/v1alpha1"
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"strings"
googleapi "google.golang.org/api/googleapi"
internal "google.golang.org/api/internal"
gensupport "google.golang.org/api/internal/gensupport"
option "google.golang.org/api/option"
internaloption "google.golang.org/api/option/internaloption"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = gensupport.MarshalJSON
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Canceled
var _ = internaloption.WithDefaultEndpoint
const apiId = "run:v1alpha1"
const apiName = "run"
const apiVersion = "v1alpha1"
const basePath = "https://run.googleapis.com/"
const mtlsBasePath = "https://run.mtls.googleapis.com/"
// OAuth2 scopes used by this API.
const (
// See, edit, configure, and delete your Google Cloud data and see the
// email address for your Google Account.
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := internaloption.WithDefaultScopes(
"https://www.googleapis.com/auth/cloud-platform",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Namespaces = NewNamespacesService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Namespaces *NamespacesService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewNamespacesService(s *Service) *NamespacesService {
rs := &NamespacesService{s: s}
rs.Jobs = NewNamespacesJobsService(s)
return rs
}
type NamespacesService struct {
s *Service
Jobs *NamespacesJobsService
}
func NewNamespacesJobsService(s *Service) *NamespacesJobsService {
rs := &NamespacesJobsService{s: s}
return rs
}
type NamespacesJobsService struct {
s *Service
}
// ConfigMapEnvSource: Not supported by Cloud Run ConfigMapEnvSource
// selects a ConfigMap to populate the environment variables with. The
// contents of the target ConfigMap's Data field will represent the
// key-value pairs as environment variables.
type ConfigMapEnvSource struct {
// LocalObjectReference: This field should not be used directly as it is
// meant to be inlined directly into the message. Use the "name" field
// instead.
LocalObjectReference *LocalObjectReference `json:"localObjectReference,omitempty"`
// Name: The ConfigMap to select from.
Name string `json:"name,omitempty"`
// Optional: (Optional) Specify whether the ConfigMap must be defined
Optional bool `json:"optional,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "LocalObjectReference") to unconditionally include in API requests.
// By default, fields with empty or default values are omitted from API
// requests. However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "LocalObjectReference") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *ConfigMapEnvSource) MarshalJSON() ([]byte, error) {
type NoMethod ConfigMapEnvSource
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ConfigMapKeySelector: Not supported by Cloud Run Selects a key from a
// ConfigMap.
type ConfigMapKeySelector struct {
// Key: The key to select.
Key string `json:"key,omitempty"`
// LocalObjectReference: This field should not be used directly as it is
// meant to be inlined directly into the message. Use the "name" field
// instead.
LocalObjectReference *LocalObjectReference `json:"localObjectReference,omitempty"`
// Name: The ConfigMap to select from.
Name string `json:"name,omitempty"`
// Optional: (Optional) Specify whether the ConfigMap or its key must be
// defined
Optional bool `json:"optional,omitempty"`
// ForceSendFields is a list of field names (e.g. "Key") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Key") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ConfigMapKeySelector) MarshalJSON() ([]byte, error) {
type NoMethod ConfigMapKeySelector
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ConfigMapVolumeSource: Not supported by Cloud Run Adapts a ConfigMap
// into a volume. The contents of the target ConfigMap's Data field will
// be presented in a volume as files using the keys in the Data field as
// the file names, unless the items element is populated with specific
// mappings of keys to paths.
type ConfigMapVolumeSource struct {
// DefaultMode: (Optional) Integer representation of mode bits to use on
// created files by default. Must be a value between 01 and 0777
// (octal). If 0 or not set, it will default to 0644. Directories within
// the path are not affected by this setting. Notes * Internally, a
// umask of 0222 will be applied to any non-zero value. * This is an
// integer representation of the mode bits. So, the octal integer value
// should look exactly as the chmod numeric notation with a leading
// zero. Some examples: for chmod 777 (a=rwx), set to 0777 (octal) or
// 511 (base-10). For chmod 640 (u=rw,g=r), set to 0640 (octal) or 416
// (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or
// 493 (base-10). * This might be in conflict with other options that
// affect the file mode, like fsGroup, and the result can be other mode
// bits set.
DefaultMode int64 `json:"defaultMode,omitempty"`
// Items: (Optional) If unspecified, each key-value pair in the Data
// field of the referenced Secret will be projected into the volume as a
// file whose name is the key and content is the value. If specified,
// the listed keys will be projected into the specified paths, and
// unlisted keys will not be present. If a key is specified that is not
// present in the Secret, the volume setup will error unless it is
// marked optional.
Items []*KeyToPath `json:"items,omitempty"`
// Name: Name of the config.
Name string `json:"name,omitempty"`
// Optional: (Optional) Specify whether the Secret or its keys must be
// defined.
Optional bool `json:"optional,omitempty"`
// ForceSendFields is a list of field names (e.g. "DefaultMode") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "DefaultMode") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ConfigMapVolumeSource) MarshalJSON() ([]byte, error) {
type NoMethod ConfigMapVolumeSource
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Container: A single application container. This specifies both the
// container to run, the command to run in the container and the
// arguments to supply to it. Note that additional arguments may be
// supplied by the system to the container at runtime.
type Container struct {
// Args: (Optional) Arguments to the entrypoint. The docker image's CMD
// is used if this is not provided. Variable references $(VAR_NAME) are
// expanded using the container's environment. If a variable cannot be
// resolved, the reference in the input string will be unchanged. The
// $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME).
// Escaped references will never be expanded, regardless of whether the
// variable exists or not. More info:
// https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
Args []string `json:"args,omitempty"`
Command []string `json:"command,omitempty"`
// Env: (Optional) List of environment variables to set in the
// container.
Env []*EnvVar `json:"env,omitempty"`
// EnvFrom: (Optional) List of sources to populate environment variables
// in the container. The keys defined within a source must be a
// C_IDENTIFIER. All invalid keys will be reported as an event when the
// container is starting. When a key exists in multiple sources, the
// value associated with the last source will take precedence. Values
// defined by an Env with a duplicate key will take precedence. Cannot
// be updated.
EnvFrom []*EnvFromSource `json:"envFrom,omitempty"`
// Image: Only supports containers from Google Container Registry or
// Artifact Registry URL of the Container image. More info:
// https://kubernetes.io/docs/concepts/containers/images
Image string `json:"image,omitempty"`
// ImagePullPolicy: (Optional) Image pull policy. One of Always, Never,
// IfNotPresent. Defaults to Always if :latest tag is specified, or
// IfNotPresent otherwise. More info:
// https://kubernetes.io/docs/concepts/containers/images#updating-images
ImagePullPolicy string `json:"imagePullPolicy,omitempty"`
// LivenessProbe: (Optional) Periodic probe of container liveness.
// Container will be restarted if the probe fails. More info:
// https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
LivenessProbe *Probe `json:"livenessProbe,omitempty"`
// Name: (Optional) Name of the container specified as a DNS_LABEL.
// Currently unused in Cloud Run. More info:
// https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-label-names
Name string `json:"name,omitempty"`
// Ports: (Optional) List of ports to expose from the container. Only a
// single port can be specified. The specified ports must be listening
// on all interfaces (0.0.0.0) within the container to be accessible. If
// omitted, a port number will be chosen and passed to the container
// through the PORT environment variable for the container to listen on.
Ports []*ContainerPort `json:"ports,omitempty"`
// ReadinessProbe: (Optional) Periodic probe of container service
// readiness. Container will be removed from service endpoints if the
// probe fails. More info:
// https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
ReadinessProbe *Probe `json:"readinessProbe,omitempty"`
// Resources: (Optional) Compute Resources required by this container.
// More info:
// https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources
Resources *ResourceRequirements `json:"resources,omitempty"`
// SecurityContext: (Optional) Security options the pod should run with.
// More info:
// https://kubernetes.io/docs/concepts/policy/security-context/ More
// info:
// https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
SecurityContext *SecurityContext `json:"securityContext,omitempty"`
// StartupProbe: (Optional) Startup probe of application within the
// container. All other probes are disabled if a startup probe is
// provided, until it succeeds. Container will not be added to service
// endpoints if the probe fails. More info:
// https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
StartupProbe *Probe `json:"startupProbe,omitempty"`
// TerminationMessagePath: (Optional) Path at which the file to which
// the container's termination message will be written is mounted into
// the container's filesystem. Message written is intended to be brief
// final status, such as an assertion failure message. Will be truncated
// by the node if greater than 4096 bytes. The total message length
// across all containers will be limited to 12kb. Defaults to
// /dev/termination-log.
TerminationMessagePath string `json:"terminationMessagePath,omitempty"`
// TerminationMessagePolicy: (Optional) Indicate how the termination
// message should be populated. File will use the contents of
// terminationMessagePath to populate the container status message on
// both success and failure. FallbackToLogsOnError will use the last
// chunk of container log output if the termination message file is
// empty and the container exited with an error. The log output is
// limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to
// File. Cannot be updated.
TerminationMessagePolicy string `json:"terminationMessagePolicy,omitempty"`
// VolumeMounts: (Optional) Volume to mount into the container's
// filesystem. Only supports SecretVolumeSources. Pod volumes to mount
// into the container's filesystem.
VolumeMounts []*VolumeMount `json:"volumeMounts,omitempty"`
// WorkingDir: (Optional) Container's working directory. If not
// specified, the container runtime's default will be used, which might
// be configured in the container image.
WorkingDir string `json:"workingDir,omitempty"`
// ForceSendFields is a list of field names (e.g. "Args") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Args") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Container) MarshalJSON() ([]byte, error) {
type NoMethod Container
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ContainerPort: ContainerPort represents a network port in a single
// container.
type ContainerPort struct {
// ContainerPort: (Optional) Port number the container listens on. This
// must be a valid port number, 0 < x < 65536.
ContainerPort int64 `json:"containerPort,omitempty"`
// Name: (Optional) If specified, used to specify which protocol to use.
// Allowed values are "http1" and "h2c".
Name string `json:"name,omitempty"`
// Protocol: (Optional) Protocol for port. Must be "TCP". Defaults to
// "TCP".
Protocol string `json:"protocol,omitempty"`
// ForceSendFields is a list of field names (e.g. "ContainerPort") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ContainerPort") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ContainerPort) MarshalJSON() ([]byte, error) {
type NoMethod ContainerPort
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Empty: A generic empty message that you can re-use to avoid defining
// duplicated empty messages in your APIs. A typical example is to use
// it as the request or the response type of an API method. For
// instance: service Foo { rpc Bar(google.protobuf.Empty) returns
// (google.protobuf.Empty); }
type Empty struct {
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
}
// EnvFromSource: Not supported by Cloud Run EnvFromSource represents
// the source of a set of ConfigMaps
type EnvFromSource struct {
// ConfigMapRef: (Optional) The ConfigMap to select from
ConfigMapRef *ConfigMapEnvSource `json:"configMapRef,omitempty"`
// Prefix: (Optional) An optional identifier to prepend to each key in
// the ConfigMap. Must be a C_IDENTIFIER.
Prefix string `json:"prefix,omitempty"`
// SecretRef: (Optional) The Secret to select from
SecretRef *SecretEnvSource `json:"secretRef,omitempty"`
// ForceSendFields is a list of field names (e.g. "ConfigMapRef") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ConfigMapRef") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *EnvFromSource) MarshalJSON() ([]byte, error) {
type NoMethod EnvFromSource
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// EnvVar: EnvVar represents an environment variable present in a
// Container.
type EnvVar struct {
// Name: Name of the environment variable. Must be a C_IDENTIFIER.
Name string `json:"name,omitempty"`
// Value: (Optional) Variable references $(VAR_NAME) are expanded using
// the previous defined environment variables in the container and any
// route environment variables. If a variable cannot be resolved, the
// reference in the input string will be unchanged. The $(VAR_NAME)
// syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped
// references will never be expanded, regardless of whether the variable
// exists or not. Defaults to "".
Value string `json:"value,omitempty"`
// ValueFrom: (Optional) Source for the environment variable's value.
// Only supports secret_key_ref. Source for the environment variable's
// value. Cannot be used if value is not empty.
ValueFrom *EnvVarSource `json:"valueFrom,omitempty"`
// ForceSendFields is a list of field names (e.g. "Name") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Name") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *EnvVar) MarshalJSON() ([]byte, error) {
type NoMethod EnvVar
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// EnvVarSource: EnvVarSource represents a source for the value of an
// EnvVar.
type EnvVarSource struct {
// ConfigMapKeyRef: (Optional) Not supported by Cloud Run Selects a key
// of a ConfigMap.
ConfigMapKeyRef *ConfigMapKeySelector `json:"configMapKeyRef,omitempty"`
// SecretKeyRef: (Optional) Selects a key (version) of a secret in
// Secret Manager.
SecretKeyRef *SecretKeySelector `json:"secretKeyRef,omitempty"`
// ForceSendFields is a list of field names (e.g. "ConfigMapKeyRef") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ConfigMapKeyRef") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *EnvVarSource) MarshalJSON() ([]byte, error) {
type NoMethod EnvVarSource
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ExecAction: Not supported by Cloud Run ExecAction describes a "run in
// container" action.
type ExecAction struct {
// Command: (Optional) Command is the command line to execute inside the
// container, the working directory for the command is root ('/') in the
// container's filesystem. The command is simply exec'd, it is not run
// inside a shell, so traditional shell instructions ('|', etc) won't
// work. To use a shell, you need to explicitly call out to that shell.
// Exit status of 0 is treated as live/healthy and non-zero is
// unhealthy.
Command []string `json:"command,omitempty"`
// ForceSendFields is a list of field names (e.g. "Command") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Command") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ExecAction) MarshalJSON() ([]byte, error) {
type NoMethod ExecAction
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GRPCAction: Not supported by Cloud Run GRPCAction describes an action
// involving a GRPC port.
type GRPCAction struct {
// Port: Port number of the gRPC service. Number must be in the range 1
// to 65535.
Port int64 `json:"port,omitempty"`
// Service: Service is the name of the service to place in the gRPC
// HealthCheckRequest (see
// https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If
// this is not specified, the default behavior is defined by gRPC.
Service string `json:"service,omitempty"`
// ForceSendFields is a list of field names (e.g. "Port") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Port") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GRPCAction) MarshalJSON() ([]byte, error) {
type NoMethod GRPCAction
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleRpcStatus: The `Status` type defines a logical error model that
// is suitable for different programming environments, including REST
// APIs and RPC APIs. It is used by gRPC (https://github.com/grpc). Each
// `Status` message contains three pieces of data: error code, error
// message, and error details. You can find out more about this error
// model and how to work with it in the API Design Guide
// (https://cloud.google.com/apis/design/errors).
type GoogleRpcStatus struct {
// Code: The status code, which should be an enum value of
// google.rpc.Code.
Code int64 `json:"code,omitempty"`
// Details: A list of messages that carry the error details. There is a
// common set of message types for APIs to use.
Details []googleapi.RawMessage `json:"details,omitempty"`
// Message: A developer-facing error message, which should be in
// English. Any user-facing error message should be localized and sent
// in the google.rpc.Status.details field, or localized by the client.
Message string `json:"message,omitempty"`
// ForceSendFields is a list of field names (e.g. "Code") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Code") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleRpcStatus) MarshalJSON() ([]byte, error) {
type NoMethod GoogleRpcStatus
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// HTTPGetAction: Not supported by Cloud Run HTTPGetAction describes an
// action based on HTTP Get requests.
type HTTPGetAction struct {
// Host: (Optional) Host name to connect to, defaults to the pod IP. You
// probably want to set "Host" in httpHeaders instead.
Host string `json:"host,omitempty"`
// HttpHeaders: (Optional) Custom headers to set in the request. HTTP
// allows repeated headers.
HttpHeaders []*HTTPHeader `json:"httpHeaders,omitempty"`
// Path: (Optional) Path to access on the HTTP server.
Path string `json:"path,omitempty"`
// Scheme: (Optional) Scheme to use for connecting to the host. Defaults
// to HTTP.
Scheme string `json:"scheme,omitempty"`
// ForceSendFields is a list of field names (e.g. "Host") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Host") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *HTTPGetAction) MarshalJSON() ([]byte, error) {
type NoMethod HTTPGetAction
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// HTTPHeader: Not supported by Cloud Run HTTPHeader describes a custom
// header to be used in HTTP probes
type HTTPHeader struct {
// Name: The header field name
Name string `json:"name,omitempty"`
// Value: The header field value
Value string `json:"value,omitempty"`
// ForceSendFields is a list of field names (e.g. "Name") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Name") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *HTTPHeader) MarshalJSON() ([]byte, error) {
type NoMethod HTTPHeader
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// InstanceAttemptResult: Result of an instance attempt.
type InstanceAttemptResult struct {
// ExitCode: Optional. The exit code of this attempt. This may be unset
// if the container was unable to exit cleanly with a code due to some
// other failure. See status field for possible failure details.
ExitCode int64 `json:"exitCode,omitempty"`
// Status: Optional. The status of this attempt. If the status code is
// OK, then the attempt succeeded.
Status *GoogleRpcStatus `json:"status,omitempty"`
// ForceSendFields is a list of field names (e.g. "ExitCode") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ExitCode") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *InstanceAttemptResult) MarshalJSON() ([]byte, error) {
type NoMethod InstanceAttemptResult
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// InstanceSpec: InstanceSpec is a description of an instance.
type InstanceSpec struct {
// ActiveDeadlineSeconds: Optional. Optional duration in seconds the
// instance may be active relative to StartTime before the system will
// actively try to mark it failed and kill associated containers. If set
// to zero, the system will never attempt to kill an instance based on
// time. Otherwise, value must be a positive integer. +optional
ActiveDeadlineSeconds int64 `json:"activeDeadlineSeconds,omitempty,string"`
// Containers: Optional. List of containers belonging to the instance.
// We disallow a number of fields on this Container. Only a single
// container may be provided.
Containers []*Container `json:"containers,omitempty"`
// RestartPolicy: Optional. Restart policy for all containers within the
// instance. Allowed values are: - OnFailure: Instances will always be
// restarted on failure if the backoffLimit has not been reached. -
// Never: Instances are never restarted and all failures are permanent.
// Cannot be used if backoffLimit is set. +optional
RestartPolicy string `json:"restartPolicy,omitempty"`
// ServiceAccountName: Optional. Email address of the IAM service
// account associated with the instance of a Job. The service account
// represents the identity of the running instance, and determines what
// permissions the instance has. If not provided, the instance will use
// the project's default service account. +optional
ServiceAccountName string `json:"serviceAccountName,omitempty"`
// TerminationGracePeriodSeconds: Optional. Optional duration in seconds
// the instance needs to terminate gracefully. Value must be
// non-negative integer. The value zero indicates delete immediately.
// The grace period is the duration in seconds after the processes
// running in the instance are sent a termination signal and the time
// when the processes are forcibly halted with a kill signal. Set this
// value longer than the expected cleanup time for your process.
// +optional
TerminationGracePeriodSeconds int64 `json:"terminationGracePeriodSeconds,omitempty,string"`
// Volumes: Optional. List of volumes that can be mounted by containers
// belonging to the instance. More info:
// https://kubernetes.io/docs/concepts/storage/volumes +optional
Volumes []*Volume `json:"volumes,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "ActiveDeadlineSeconds") to unconditionally include in API requests.
// By default, fields with empty or default values are omitted from API
// requests. However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ActiveDeadlineSeconds") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *InstanceSpec) MarshalJSON() ([]byte, error) {
type NoMethod InstanceSpec
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// InstanceStatus: Instance represents the status of an instance of a
// Job.
type InstanceStatus struct {
// CompletionTime: Optional. Represents time when the instance was
// completed. It is not guaranteed to be set in happens-before order
// across separate operations. It is represented in RFC3339 form and is
// in UTC. +optional
CompletionTime string `json:"completionTime,omitempty"`
// Failed: Optional. The number of times this instance exited with code
// > 0; +optional
Failed int64 `json:"failed,omitempty"`
// Index: Required. Index of the instance, unique per Job, and beginning
// at 0.
Index int64 `json:"index,omitempty"`
// LastAttemptResult: Optional. Result of the last attempt of this
// instance. +optional
LastAttemptResult *InstanceAttemptResult `json:"lastAttemptResult,omitempty"`
// LastExitCode: Optional. Last exit code seen for this instance.
// +optional
LastExitCode int64 `json:"lastExitCode,omitempty"`
// Restarted: Optional. The number of times this instance was restarted.
// Instances are restarted according the restartPolicy configured in the
// Job template. +optional
Restarted int64 `json:"restarted,omitempty"`
// StartTime: Optional. Represents time when the instance was created by
// the job controller. It is not guaranteed to be set in happens-before
// order across separate operations. It is represented in RFC3339 form
// and is in UTC. +optional
StartTime string `json:"startTime,omitempty"`
// Succeeded: Optional. The number of times this instance exited with
// code == 0. +optional
Succeeded int64 `json:"succeeded,omitempty"`
// ForceSendFields is a list of field names (e.g. "CompletionTime") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "CompletionTime") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *InstanceStatus) MarshalJSON() ([]byte, error) {
type NoMethod InstanceStatus
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// InstanceTemplateSpec: InstanceTemplateSpec describes the data an
// instance should have when created from a template.
type InstanceTemplateSpec struct {
// Spec: Optional. Specification of the desired behavior of the
// instance. More info:
// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
// +optional
Spec *InstanceSpec `json:"spec,omitempty"`
// ForceSendFields is a list of field names (e.g. "Spec") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Spec") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *InstanceTemplateSpec) MarshalJSON() ([]byte, error) {
type NoMethod InstanceTemplateSpec
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Job: Job represents the configuration of a single job. A job an
// immutable resource that references a container image which is run to
// completion.
type Job struct {
// ApiVersion: Optional. APIVersion defines the versioned schema of this
// representation of an object. Servers should convert recognized
// schemas to the latest internal value, and may reject unrecognized
// values. More info:
// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
// +optional
ApiVersion string `json:"apiVersion,omitempty"`
// Kind: Optional. Kind is a string value representing the REST resource
// this object represents. Servers may infer this from the endpoint the