/
batch-gen.go
4730 lines (4198 loc) · 181 KB
/
batch-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 2023 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 batch provides access to the Batch API.
//
// For product documentation, see: https://cloud.google.com/batch/
//
// # Creating a client
//
// Usage example:
//
// import "google.golang.org/api/batch/v1"
// ...
// ctx := context.Background()
// batchService, err := batch.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:
//
// batchService, err := batch.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, ...)
// batchService, err := batch.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package batch // import "google.golang.org/api/batch/v1"
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
var _ = internal.Version
const apiId = "batch:v1"
const apiName = "batch"
const apiVersion = "v1"
const basePath = "https://batch.googleapis.com/"
const mtlsBasePath = "https://batch.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.Projects = NewProjectsService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Projects *ProjectsService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewProjectsService(s *Service) *ProjectsService {
rs := &ProjectsService{s: s}
rs.Locations = NewProjectsLocationsService(s)
return rs
}
type ProjectsService struct {
s *Service
Locations *ProjectsLocationsService
}
func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
rs := &ProjectsLocationsService{s: s}
rs.Jobs = NewProjectsLocationsJobsService(s)
rs.Operations = NewProjectsLocationsOperationsService(s)
rs.State = NewProjectsLocationsStateService(s)
return rs
}
type ProjectsLocationsService struct {
s *Service
Jobs *ProjectsLocationsJobsService
Operations *ProjectsLocationsOperationsService
State *ProjectsLocationsStateService
}
func NewProjectsLocationsJobsService(s *Service) *ProjectsLocationsJobsService {
rs := &ProjectsLocationsJobsService{s: s}
rs.TaskGroups = NewProjectsLocationsJobsTaskGroupsService(s)
return rs
}
type ProjectsLocationsJobsService struct {
s *Service
TaskGroups *ProjectsLocationsJobsTaskGroupsService
}
func NewProjectsLocationsJobsTaskGroupsService(s *Service) *ProjectsLocationsJobsTaskGroupsService {
rs := &ProjectsLocationsJobsTaskGroupsService{s: s}
rs.Tasks = NewProjectsLocationsJobsTaskGroupsTasksService(s)
return rs
}
type ProjectsLocationsJobsTaskGroupsService struct {
s *Service
Tasks *ProjectsLocationsJobsTaskGroupsTasksService
}
func NewProjectsLocationsJobsTaskGroupsTasksService(s *Service) *ProjectsLocationsJobsTaskGroupsTasksService {
rs := &ProjectsLocationsJobsTaskGroupsTasksService{s: s}
return rs
}
type ProjectsLocationsJobsTaskGroupsTasksService struct {
s *Service
}
func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
rs := &ProjectsLocationsOperationsService{s: s}
return rs
}
type ProjectsLocationsOperationsService struct {
s *Service
}
func NewProjectsLocationsStateService(s *Service) *ProjectsLocationsStateService {
rs := &ProjectsLocationsStateService{s: s}
return rs
}
type ProjectsLocationsStateService struct {
s *Service
}
// Accelerator: Accelerator describes Compute Engine accelerators to be
// attached to the VM.
type Accelerator struct {
// Count: The number of accelerators of this type.
Count int64 `json:"count,omitempty,string"`
// InstallGpuDrivers: Deprecated: please use
// instances[0].install_gpu_drivers instead.
InstallGpuDrivers bool `json:"installGpuDrivers,omitempty"`
// Type: The accelerator type. For example, "nvidia-tesla-t4". See
// `gcloud compute accelerator-types list`.
Type string `json:"type,omitempty"`
// ForceSendFields is a list of field names (e.g. "Count") 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. "Count") 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 *Accelerator) MarshalJSON() ([]byte, error) {
type NoMethod Accelerator
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ActionCondition: Conditions for actions to deal with task failures.
type ActionCondition struct {
// ExitCodes: Exit codes of a task execution. If there are more than 1
// exit codes, when task executes with any of the exit code in the list,
// the condition is met and the action will be executed.
ExitCodes []int64 `json:"exitCodes,omitempty"`
// ForceSendFields is a list of field names (e.g. "ExitCodes") 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. "ExitCodes") 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 *ActionCondition) MarshalJSON() ([]byte, error) {
type NoMethod ActionCondition
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// AgentInfo: VM Agent Info.
type AgentInfo struct {
// JobId: The assigned Job ID
JobId string `json:"jobId,omitempty"`
// ReportTime: When the AgentInfo is generated.
ReportTime string `json:"reportTime,omitempty"`
// State: Agent state.
//
// Possible values:
// "AGENT_STATE_UNSPECIFIED" - Unspecified state.
// "AGENT_STARTING" - The agent is starting on the VM instance.
// "AGENT_RUNNING" - The agent is running. The agent in the RUNNING
// state can never go back to the STARTING state.
// "AGENT_STOPPED" - The agent has stopped, either on request or due
// to a failure.
State string `json:"state,omitempty"`
// TaskGroupId: The assigned task group ID.
TaskGroupId string `json:"taskGroupId,omitempty"`
// Tasks: Task Info.
Tasks []*AgentTaskInfo `json:"tasks,omitempty"`
// ForceSendFields is a list of field names (e.g. "JobId") 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. "JobId") 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 *AgentInfo) MarshalJSON() ([]byte, error) {
type NoMethod AgentInfo
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// AgentMetadata: VM Agent Metadata.
type AgentMetadata struct {
// CreationTime: When the VM agent started. Use agent_startup_time
// instead.
CreationTime string `json:"creationTime,omitempty"`
// Creator: Full name of the entity that created this vm. For MIG, this
// path is:
// projects/{project}/regions/{region}/InstanceGroupManagers/{igm} The
// value is retrieved from the vm metadata key of "created-by".
Creator string `json:"creator,omitempty"`
// ImageVersion: image version for the VM that this agent is installed
// on.
ImageVersion string `json:"imageVersion,omitempty"`
// Instance: GCP instance name (go/instance-name).
Instance string `json:"instance,omitempty"`
// InstanceId: GCP instance ID (go/instance-id).
InstanceId uint64 `json:"instanceId,omitempty,string"`
// InstancePreemptionNoticeReceived: If the GCP instance has received
// preemption notice.
InstancePreemptionNoticeReceived bool `json:"instancePreemptionNoticeReceived,omitempty"`
// OsRelease: parsed contents of /etc/os-release
OsRelease map[string]string `json:"osRelease,omitempty"`
// Version: agent binary version running on VM
Version string `json:"version,omitempty"`
// Zone: Agent zone.
Zone string `json:"zone,omitempty"`
// ForceSendFields is a list of field names (e.g. "CreationTime") 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. "CreationTime") 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 *AgentMetadata) MarshalJSON() ([]byte, error) {
type NoMethod AgentMetadata
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// AgentTask: TODO(b/182501497) The message needs to be redefined when
// the Agent API server updates data in storage per the backend design.
type AgentTask struct {
// IntendedState: The intended state of the task.
//
// Possible values:
// "INTENDED_STATE_UNSPECIFIED" - Unspecified state.
// "ASSIGNED" - Assigned state (includes running and finished).
// "CANCELLED" - The agent should cancel the execution of this task.
// "DELETED" - Delete task from agent storage, stop reporting its
// state.
IntendedState string `json:"intendedState,omitempty"`
// ReachedBarrier: The highest barrier reached by all tasks in the
// task's TaskGroup.
ReachedBarrier int64 `json:"reachedBarrier,omitempty,string"`
// Spec: Task Spec.
Spec *TaskSpec `json:"spec,omitempty"`
// Status: Task status.
Status *TaskStatus `json:"status,omitempty"`
// Task: Task name.
Task string `json:"task,omitempty"`
// TaskSource: TaskSource represents the source of the task.
//
// Possible values:
// "TASK_SOURCE_UNSPECIFIED" - Unspecified task source.
// "BATCH_INTERNAL" - The AgentTask from this source is generated by
// Batch server. E.g. all the VMActions are from this source. When Batch
// Agent execute AgentTask from BATCH_INTERNAL, it will log stdout/err
// with "batch_agent_logs" log name.
// "USER" - The AgentTask from this source is provided by Batch users.
// When Batch Agent execute AgentTask from USER, it will log stdout/err
// with "batch_task_logs" log name.
TaskSource string `json:"taskSource,omitempty"`
// ForceSendFields is a list of field names (e.g. "IntendedState") 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. "IntendedState") 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 *AgentTask) MarshalJSON() ([]byte, error) {
type NoMethod AgentTask
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// AgentTaskInfo: Task Info
type AgentTaskInfo struct {
// Runnable: The highest index of a runnable started by the agent for
// this task. The runnables are indexed from 1. Value 0 is undefined.
Runnable int64 `json:"runnable,omitempty,string"`
// TaskId: ID of the Task
TaskId string `json:"taskId,omitempty"`
// TaskStatus: The status of the Task. If we need agent specific fields
// we should fork the public TaskStatus into an agent specific one. Or
// add them below.
TaskStatus *TaskStatus `json:"taskStatus,omitempty"`
// ForceSendFields is a list of field names (e.g. "Runnable") 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. "Runnable") 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 *AgentTaskInfo) MarshalJSON() ([]byte, error) {
type NoMethod AgentTaskInfo
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// AgentTimingInfo: VM timing information
type AgentTimingInfo struct {
// AgentStartupTime: Agent startup time
AgentStartupTime string `json:"agentStartupTime,omitempty"`
// BootTime: Boot timestamp of the VM OS
BootTime string `json:"bootTime,omitempty"`
// ScriptStartupTime: Startup time of the Batch VM script.
ScriptStartupTime string `json:"scriptStartupTime,omitempty"`
// ForceSendFields is a list of field names (e.g. "AgentStartupTime") 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. "AgentStartupTime") 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 *AgentTimingInfo) MarshalJSON() ([]byte, error) {
type NoMethod AgentTimingInfo
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// AllocationPolicy: A Job's resource allocation policy describes when,
// where, and how compute resources should be allocated for the Job.
type AllocationPolicy struct {
// Instances: Describe instances that can be created by this
// AllocationPolicy. Only instances[0] is supported now.
Instances []*InstancePolicyOrTemplate `json:"instances,omitempty"`
// Labels: Labels applied to all VM instances and other resources
// created by AllocationPolicy. Labels could be user provided or system
// generated. You can assign up to 64 labels. Google Compute Engine
// label restrictions
// (https://cloud.google.com/compute/docs/labeling-resources#restrictions)
// apply. Label names that start with "goog-" or "google-" are reserved.
Labels map[string]string `json:"labels,omitempty"`
// Location: Location where compute resources should be allocated for
// the Job.
Location *LocationPolicy `json:"location,omitempty"`
// Network: The network policy.
Network *NetworkPolicy `json:"network,omitempty"`
// Placement: The placement policy.
Placement *PlacementPolicy `json:"placement,omitempty"`
// ServiceAccount: Service account that VMs will run as.
ServiceAccount *ServiceAccount `json:"serviceAccount,omitempty"`
// ForceSendFields is a list of field names (e.g. "Instances") 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. "Instances") 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 *AllocationPolicy) MarshalJSON() ([]byte, error) {
type NoMethod AllocationPolicy
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// AttachedDisk: A new or an existing persistent disk (PD) or a local
// ssd attached to a VM instance.
type AttachedDisk struct {
// DeviceName: Device name that the guest operating system will see. It
// is used by Runnable.volumes field to mount disks. So please specify
// the device_name if you want Batch to help mount the disk, and it
// should match the device_name field in volumes.
DeviceName string `json:"deviceName,omitempty"`
// ExistingDisk: Name of an existing PD.
ExistingDisk string `json:"existingDisk,omitempty"`
NewDisk *Disk `json:"newDisk,omitempty"`
// ForceSendFields is a list of field names (e.g. "DeviceName") 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. "DeviceName") 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 *AttachedDisk) MarshalJSON() ([]byte, error) {
type NoMethod AttachedDisk
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Barrier: Barrier runnable blocks until all tasks in a taskgroup reach
// it.
type Barrier struct {
// Name: Barriers are identified by their index in runnable list. Names
// are not required, but if present should be an identifier.
Name string `json:"name,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 *Barrier) MarshalJSON() ([]byte, error) {
type NoMethod Barrier
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CancelOperationRequest: The request message for
// Operations.CancelOperation.
type CancelOperationRequest struct {
}
// ComputeResource: Compute resource requirements
type ComputeResource struct {
// BootDiskMib: Extra boot disk size in MiB for each task.
BootDiskMib int64 `json:"bootDiskMib,omitempty,string"`
// CpuMilli: The milliCPU count.
CpuMilli int64 `json:"cpuMilli,omitempty,string"`
// MemoryMib: Memory in MiB.
MemoryMib int64 `json:"memoryMib,omitempty,string"`
// ForceSendFields is a list of field names (e.g. "BootDiskMib") 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. "BootDiskMib") 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 *ComputeResource) MarshalJSON() ([]byte, error) {
type NoMethod ComputeResource
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Container: Container runnable.
type Container struct {
// BlockExternalNetwork: If set to true, external network access to and
// from container will be blocked, containers that are with
// block_external_network as true can still communicate with each other,
// network cannot be specified in the `container.options` field.
BlockExternalNetwork bool `json:"blockExternalNetwork,omitempty"`
// Commands: Overrides the `CMD` specified in the container. If there is
// an ENTRYPOINT (either in the container image or with the entrypoint
// field below) then commands are appended as arguments to the
// ENTRYPOINT.
Commands []string `json:"commands,omitempty"`
// Entrypoint: Overrides the `ENTRYPOINT` specified in the container.
Entrypoint string `json:"entrypoint,omitempty"`
// ImageUri: The URI to pull the container image from.
ImageUri string `json:"imageUri,omitempty"`
// Options: Arbitrary additional options to include in the "docker run"
// command when running this container, e.g. "--network host".
Options string `json:"options,omitempty"`
// Password: Optional password for logging in to a docker registry. If
// password matches `projects/*/secrets/*/versions/*` then Batch will
// read the password from the Secret Manager;
Password string `json:"password,omitempty"`
// Username: Optional username for logging in to a docker registry. If
// username matches `projects/*/secrets/*/versions/*` then Batch will
// read the username from the Secret Manager.
Username string `json:"username,omitempty"`
// Volumes: Volumes to mount (bind mount) from the host machine files or
// directories into the container, formatted to match docker run's
// --volume option, e.g. /foo:/bar, or /foo:/bar:ro
Volumes []string `json:"volumes,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "BlockExternalNetwork") 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. "BlockExternalNetwork") 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)
}
// Disk: A new persistent disk or a local ssd. A VM can only have one
// local SSD setting but multiple local SSD partitions. See
// https://cloud.google.com/compute/docs/disks#pdspecs and
// https://cloud.google.com/compute/docs/disks#localssds.
type Disk struct {
// DiskInterface: Local SSDs are available through both "SCSI" and
// "NVMe" interfaces. If not indicated, "NVMe" will be the default one
// for local ssds. We only support "SCSI" for persistent disks now.
DiskInterface string `json:"diskInterface,omitempty"`
// Image: Name of a public or custom image used as the data source. For
// example, the following are all valid URLs: * Specify the image by its
// family name: projects/{project}/global/images/family/{image_family} *
// Specify the image version:
// projects/{project}/global/images/{image_version} You can also use
// Batch customized image in short names. The following image values are
// supported for a boot disk: * "batch-debian": use Batch Debian images.
// * "batch-centos": use Batch CentOS images. * "batch-cos": use Batch
// Container-Optimized images.
Image string `json:"image,omitempty"`
// SizeGb: Disk size in GB. For persistent disk, this field is ignored
// if `data_source` is `image` or `snapshot`. For local SSD, size_gb
// should be a multiple of 375GB, otherwise, the final size will be the
// next greater multiple of 375 GB. For boot disk, Batch will calculate
// the boot disk size based on source image and task requirements if you
// do not speicify the size. If both this field and the boot_disk_mib
// field in task spec's compute_resource are defined, Batch will only
// honor this field.
SizeGb int64 `json:"sizeGb,omitempty,string"`
// Snapshot: Name of a snapshot used as the data source. Snapshot is not
// supported as boot disk now.
Snapshot string `json:"snapshot,omitempty"`
// Type: Disk type as shown in `gcloud compute disk-types list`. For
// example, local SSD uses type "local-ssd". Persistent disks and boot
// disks use "pd-balanced", "pd-extreme", "pd-ssd" or "pd-standard".
Type string `json:"type,omitempty"`
// ForceSendFields is a list of field names (e.g. "DiskInterface") 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. "DiskInterface") 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 *Disk) MarshalJSON() ([]byte, error) {
type NoMethod Disk
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:"-"`
}
// Environment: An Environment describes a collection of environment
// variables to set when executing Tasks.
type Environment struct {
// EncryptedVariables: An encrypted JSON dictionary where the key/value
// pairs correspond to environment variable names and their values.
EncryptedVariables *KMSEnvMap `json:"encryptedVariables,omitempty"`
// SecretVariables: A map of environment variable names to Secret
// Manager secret names. The VM will access the named secrets to set the
// value of each environment variable.
SecretVariables map[string]string `json:"secretVariables,omitempty"`
// Variables: A map of environment variable names to values.
Variables map[string]string `json:"variables,omitempty"`
// ForceSendFields is a list of field names (e.g. "EncryptedVariables")
// 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. "EncryptedVariables") 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 *Environment) MarshalJSON() ([]byte, error) {
type NoMethod Environment
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GCS: Represents a Google Cloud Storage volume.
type GCS struct {
// RemotePath: Remote path, either a bucket name or a subdirectory of a
// bucket, e.g.: bucket_name, bucket_name/subdirectory/
RemotePath string `json:"remotePath,omitempty"`
// ForceSendFields is a list of field names (e.g. "RemotePath") 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. "RemotePath") 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 *GCS) MarshalJSON() ([]byte, error) {
type NoMethod GCS
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// InstancePolicy: InstancePolicy describes an instance type and
// resources attached to each VM created by this InstancePolicy.
type InstancePolicy struct {
// Accelerators: The accelerators attached to each VM instance.
Accelerators []*Accelerator `json:"accelerators,omitempty"`
// BootDisk: Boot disk to be created and attached to each VM by this
// InstancePolicy. Boot disk will be deleted when the VM is deleted.
// Batch API now only supports booting from image.
BootDisk *Disk `json:"bootDisk,omitempty"`
// Disks: Non-boot disks to be attached for each VM created by this
// InstancePolicy. New disks will be deleted when the VM is deleted.
Disks []*AttachedDisk `json:"disks,omitempty"`
// MachineType: The Compute Engine machine type.
MachineType string `json:"machineType,omitempty"`
// MinCpuPlatform: The minimum CPU platform. See
// https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform.
// Not yet implemented.
MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
// ProvisioningModel: The provisioning model.
//
// Possible values:
// "PROVISIONING_MODEL_UNSPECIFIED" - Unspecified.
// "STANDARD" - Standard VM.
// "SPOT" - SPOT VM.
// "PREEMPTIBLE" - Preemptible VM (PVM). Above SPOT VM is the
// preferable model for preemptible VM instances: the old preemptible VM
// model (indicated by this field) is the older model, and has been
// migrated to use the SPOT model as the underlying technology. This old
// model will still be supported.
ProvisioningModel string `json:"provisioningModel,omitempty"`
// ForceSendFields is a list of field names (e.g. "Accelerators") 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. "Accelerators") 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 *InstancePolicy) MarshalJSON() ([]byte, error) {
type NoMethod InstancePolicy
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// InstancePolicyOrTemplate: Either an InstancePolicy or an instance
// template.
type InstancePolicyOrTemplate struct {
// InstallGpuDrivers: Set this field true if users want Batch to help
// fetch drivers from a third party location and install them for GPUs
// specified in policy.accelerators or instance_template on their
// behalf. Default is false.
InstallGpuDrivers bool `json:"installGpuDrivers,omitempty"`
// InstanceTemplate: Name of an instance template used to create VMs.
// Named the field as 'instance_template' instead of 'template' to avoid
// c++ keyword conflict.
InstanceTemplate string `json:"instanceTemplate,omitempty"`
// Policy: InstancePolicy.
Policy *InstancePolicy `json:"policy,omitempty"`
// ForceSendFields is a list of field names (e.g. "InstallGpuDrivers")
// 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. "InstallGpuDrivers") 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 *InstancePolicyOrTemplate) MarshalJSON() ([]byte, error) {
type NoMethod InstancePolicyOrTemplate
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// InstanceStatus: VM instance status.
type InstanceStatus struct {
// BootDisk: The VM boot disk.
BootDisk *Disk `json:"bootDisk,omitempty"`
// MachineType: The Compute Engine machine type.
MachineType string `json:"machineType,omitempty"`
// ProvisioningModel: The VM instance provisioning model.