-
Notifications
You must be signed in to change notification settings - Fork 2.4k
/
batch_v1.projects.locations.state.html
253 lines (231 loc) 路 15.5 KB
/
batch_v1.projects.locations.state.html
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
<html><body>
<style>
body, h1, h2, h3, div, span, p, pre, a {
margin: 0;
padding: 0;
border: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
font-family: inherit;
vertical-align: baseline;
}
body {
font-size: 13px;
padding: 1em;
}
h1 {
font-size: 26px;
margin-bottom: 1em;
}
h2 {
font-size: 24px;
margin-bottom: 1em;
}
h3 {
font-size: 20px;
margin-bottom: 1em;
margin-top: 1em;
}
pre, code {
line-height: 1.5;
font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
}
pre {
margin-top: 0.5em;
}
h1, h2, h3, p {
font-family: Arial, sans serif;
}
h1, h2, h3 {
border-bottom: solid #CCC 1px;
}
.toc_element {
margin-top: 0.5em;
}
.firstline {
margin-left: 2 em;
}
.method {
margin-top: 1em;
border: solid 1px #CCC;
padding: 1em;
background: #EEE;
}
.details {
font-weight: bold;
font-size: 14px;
}
</style>
<h1><a href="batch_v1.html">Batch API</a> . <a href="batch_v1.projects.html">projects</a> . <a href="batch_v1.projects.locations.html">locations</a> . <a href="batch_v1.projects.locations.state.html">state</a></h1>
<h2>Instance Methods</h2>
<p class="toc_element">
<code><a href="#close">close()</a></code></p>
<p class="firstline">Close httplib2 connections.</p>
<p class="toc_element">
<code><a href="#report">report(parent, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Report agent's state, e.g. agent status and tasks information</p>
<h3>Method Details</h3>
<div class="method">
<code class="details" id="close">close()</code>
<pre>Close httplib2 connections.</pre>
</div>
<div class="method">
<code class="details" id="report">report(parent, body=None, x__xgafv=None)</code>
<pre>Report agent's state, e.g. agent status and tasks information
Args:
parent: string, Required. Format: projects/{project}/locations/{location} {project} should be a project number. (required)
body: object, The request body.
The object takes the form of:
{ # Request to report agent's state. The Request itself implies the agent is healthy.
"agentInfo": { # VM Agent Info. # Agent info.
"jobId": "A String", # The assigned Job ID
"reportTime": "A String", # When the AgentInfo is generated.
"state": "A String", # Agent state.
"taskGroupId": "A String", # The assigned task group ID.
"tasks": [ # Task Info.
{ # Task Info
"runnable": "A String", # The highest index of a runnable started by the agent for this task. The runnables are indexed from 1. Value 0 is undefined.
"taskId": "A String", # ID of the Task
"taskStatus": { # Status of a task # 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.
"state": "A String", # Task state
"statusEvents": [ # Detailed info about why the state is reached.
{ # Status event
"description": "A String", # Description of the event.
"eventTime": "A String", # The time this event occurred.
"taskExecution": { # This Task Execution field includes detail information for task execution procedures, based on StatusEvent types. # Task Execution
"exitCode": 42, # When task is completed as the status of FAILED or SUCCEEDED, exit code is for one task execution result, default is 0 as success.
},
"type": "A String", # Type of the event.
},
],
},
},
],
},
"agentTimingInfo": { # VM timing information # Agent timing info.
"agentStartupTime": "A String", # Agent startup time
"bootTime": "A String", # Boot timestamp of the VM OS
"scriptStartupTime": "A String", # Startup time of the Batch VM script.
},
"metadata": { # AgentMetadata never changes for a single instance of VM agent. # Agent metadata.
"creationTime": "A String", # When the VM agent started. Use agent_startup_time instead.
"creator": "A String", # 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".
"imageVersion": "A String", # image version for the VM that this agent is installed on.
"instance": "A String", # GCP instance name (go/instance-name).
"instanceId": "A String", # GCP instance ID (go/instance-id).
"osRelease": { # parsed contents of /etc/os-release
"a_key": "A String",
},
"version": "A String", # agent binary version running on VM
"zone": "A String", # Agent zone.
},
}
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Response to ReportAgentStateRequest.
"minReportInterval": "A String", # Minimum report interval override
"tasks": [ # Tasks assigned to the agent
{ # TODO(b/182501497) The message needs to be redefined when the Agent API server updates data in storage per the backend design.
"intendedState": "A String", # The intended state of the task.
"reachedBarrier": "A String", # The highest barrier reached by all tasks in the task's TaskGroup.
"spec": { # Spec of a task # Task Spec.
"computeResource": { # Compute resource requirements # ComputeResource requirements.
"bootDiskMib": "A String", # Extra boot disk size in MiB for each task.
"cpuMilli": "A String", # The milliCPU count.
"memoryMib": "A String", # Memory in MiB.
},
"environment": { # An Environment describes a collection of environment variables to set when executing Tasks. # Environment variables to set before running the Task.
"variables": { # A map of environment variable names to values.
"a_key": "A String",
},
},
"environments": { # Deprecated: please use environment(non-plural) instead.
"a_key": "A String",
},
"lifecyclePolicies": [ # Lifecycle management schema when any task in a task group is failed. The valid size of lifecycle policies are [0, 10]. For each lifecycle policy, when the condition is met, the action in that policy will execute. If there are multiple policies that the task execution result matches, we use the action from the first matched policy. If task execution result does not meet with any of the defined lifecycle policy, we consider it as the default policy. Default policy means if the exit code is 0, exit task. If task ends with non-zero exit code, retry the task with max_retry_count.
{ # LifecyclePolicy describes how to deal with task failures based on different conditions.
"action": "A String", # Action to execute when ActionCondition is true.
"actionCondition": { # Conditions for actions to deal with task failures. # Conditions that decide why a task failure is dealt with a specific action.
"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.
42,
],
},
},
],
"maxRetryCount": 42, # Maximum number of retries on failures. The default, 0, which means never retry. The valid value range is [0, 10].
"maxRunDuration": "A String", # Maximum duration the task should run. The task will be killed and marked as FAILED if over this limit.
"runnables": [ # The sequence of scripts or containers to run for this Task. Each Task using this TaskSpec executes its list of runnables in order. The Task succeeds if all of its runnables either exit with a zero status or any that exit with a non-zero status have the ignore_exit_status flag. Background runnables are killed automatically (if they have not already exited) a short time after all foreground runnables have completed. Even though this is likely to result in a non-zero exit status for the background runnable, these automatic kills are not treated as Task failures.
{ # Runnable describes instructions for executing a specific script or container as part of a Task.
"alwaysRun": True or False, # By default, after a Runnable fails, no further Runnable are executed. This flag indicates that this Runnable must be run even if the Task has already failed. This is useful for Runnables that copy output files off of the VM or for debugging. The always_run flag does not override the Task's overall max_run_duration. If the max_run_duration has expired then no further Runnables will execute, not even always_run Runnables.
"background": True or False, # This flag allows a Runnable to continue running in the background while the Task executes subsequent Runnables. This is useful to provide services to other Runnables (or to provide debugging support tools like SSH servers).
"barrier": { # Barrier runnable blocks until all tasks in a taskgroup reach it. # Barrier runnable.
"name": "A String", # Barriers are identified by their index in runnable list. Names are not required, but if present should be an identifier.
},
"container": { # Container runnable. # Container runnable.
"blockExternalNetwork": True or False, # If set to true, external network access to and from container will be blocked. The container will use the default internal network 'goog-internal'.
"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.
"A String",
],
"entrypoint": "A String", # Overrides the `ENTRYPOINT` specified in the container.
"imageUri": "A String", # The URI to pull the container image from.
"options": "A String", # Arbitrary additional options to include in the "docker run" command when running this container, e.g. "--network host".
"password": "A String", # 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;
"username": "A String", # 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.
"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
"A String",
],
},
"environment": { # An Environment describes a collection of environment variables to set when executing Tasks. # Environment variables for this Runnable (overrides variables set for the whole Task or TaskGroup).
"variables": { # A map of environment variable names to values.
"a_key": "A String",
},
},
"ignoreExitStatus": True or False, # Normally, a non-zero exit status causes the Task to fail. This flag allows execution of other Runnables to continue instead.
"script": { # Script runnable. # Script runnable.
"path": "A String", # Script file path on the host VM.
"text": "A String", # Shell script text.
},
"timeout": "A String", # Timeout for this Runnable.
},
],
"volumes": [ # Volumes to mount before running Tasks using this TaskSpec.
{ # Volume describes a volume and parameters for it to be mounted to a VM.
"deviceName": "A String", # Device name of an attached disk volume, which should align with a device_name specified by job.allocation_policy.instances[0].policy.disks[i].device_name or defined by the given instance template in job.allocation_policy.instances[0].instance_template.
"gcs": { # Represents a Google Cloud Storage volume. # A Google Cloud Storage (GCS) volume.
"remotePath": "A String", # Remote path, either a bucket name or a subdirectory of a bucket, e.g.: bucket_name, bucket_name/subdirectory/
},
"mountOptions": [ # For Google Cloud Storage (GCS), mount options are the options supported by the gcsfuse tool (https://github.com/GoogleCloudPlatform/gcsfuse). For existing persistent disks, mount options provided by the mount command (https://man7.org/linux/man-pages/man8/mount.8.html) except writing are supported. This is due to restrictions of multi-writer mode (https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms). For other attached disks and Network File System (NFS), mount options are these supported by the mount command (https://man7.org/linux/man-pages/man8/mount.8.html).
"A String",
],
"mountPath": "A String", # The mount path for the volume, e.g. /mnt/disks/share.
"nfs": { # Represents an NFS volume. # A Network File System (NFS) volume. For example, a Filestore file share.
"remotePath": "A String", # Remote source path exported from the NFS, e.g., "/share".
"server": "A String", # The IP address of the NFS.
},
},
],
},
"status": { # Status of a task # Task status.
"state": "A String", # Task state
"statusEvents": [ # Detailed info about why the state is reached.
{ # Status event
"description": "A String", # Description of the event.
"eventTime": "A String", # The time this event occurred.
"taskExecution": { # This Task Execution field includes detail information for task execution procedures, based on StatusEvent types. # Task Execution
"exitCode": 42, # When task is completed as the status of FAILED or SUCCEEDED, exit code is for one task execution result, default is 0 as success.
},
"type": "A String", # Type of the event.
},
],
},
"task": "A String", # Task name.
},
],
}</pre>
</div>
</body></html>