xref: /aosp_15_r20/external/aws-sdk-java-v2/services/batch/src/main/resources/codegen-resources/examples-1.json (revision 8a52c7834d808308836a99fc2a6e0ed8db339086)
1{
2  "version": "1.0",
3  "examples": {
4    "CancelJob": [
5      {
6        "input": {
7          "jobId": "1d828f65-7a4d-42e8-996d-3b900ed59dc4",
8          "reason": "Cancelling job."
9        },
10        "output": {
11        },
12        "comments": {
13          "input": {
14          },
15          "output": {
16          }
17        },
18        "description": "This example cancels a job with the specified job ID.",
19        "id": "to-cancel-a-job-1481152314733",
20        "title": "To cancel a job"
21      }
22    ],
23    "CreateComputeEnvironment": [
24      {
25        "input": {
26          "type": "MANAGED",
27          "computeEnvironmentName": "C4OnDemand",
28          "computeResources": {
29            "type": "EC2",
30            "desiredvCpus": 48,
31            "ec2KeyPair": "id_rsa",
32            "instanceRole": "ecsInstanceRole",
33            "instanceTypes": [
34              "c4.large",
35              "c4.xlarge",
36              "c4.2xlarge",
37              "c4.4xlarge",
38              "c4.8xlarge"
39            ],
40            "maxvCpus": 128,
41            "minvCpus": 0,
42            "securityGroupIds": [
43              "sg-cf5093b2"
44            ],
45            "subnets": [
46              "subnet-220c0e0a",
47              "subnet-1a95556d",
48              "subnet-978f6dce"
49            ],
50            "tags": {
51              "Name": "Batch Instance - C4OnDemand"
52            }
53          },
54          "serviceRole": "arn:aws:iam::012345678910:role/AWSBatchServiceRole",
55          "state": "ENABLED"
56        },
57        "output": {
58          "computeEnvironmentArn": "arn:aws:batch:us-east-1:012345678910:compute-environment/C4OnDemand",
59          "computeEnvironmentName": "C4OnDemand"
60        },
61        "comments": {
62          "input": {
63          },
64          "output": {
65          }
66        },
67        "description": "This example creates a managed compute environment with specific C4 instance types that are launched on demand. The compute environment is called C4OnDemand.",
68        "id": "to-create-a-managed-ec2-compute-environment-1481152600017",
69        "title": "To create a managed EC2 compute environment"
70      },
71      {
72        "input": {
73          "type": "MANAGED",
74          "computeEnvironmentName": "M4Spot",
75          "computeResources": {
76            "type": "SPOT",
77            "bidPercentage": 20,
78            "desiredvCpus": 4,
79            "ec2KeyPair": "id_rsa",
80            "instanceRole": "ecsInstanceRole",
81            "instanceTypes": [
82              "m4"
83            ],
84            "maxvCpus": 128,
85            "minvCpus": 0,
86            "securityGroupIds": [
87              "sg-cf5093b2"
88            ],
89            "spotIamFleetRole": "arn:aws:iam::012345678910:role/aws-ec2-spot-fleet-role",
90            "subnets": [
91              "subnet-220c0e0a",
92              "subnet-1a95556d",
93              "subnet-978f6dce"
94            ],
95            "tags": {
96              "Name": "Batch Instance - M4Spot"
97            }
98          },
99          "serviceRole": "arn:aws:iam::012345678910:role/AWSBatchServiceRole",
100          "state": "ENABLED"
101        },
102        "output": {
103          "computeEnvironmentArn": "arn:aws:batch:us-east-1:012345678910:compute-environment/M4Spot",
104          "computeEnvironmentName": "M4Spot"
105        },
106        "comments": {
107          "input": {
108          },
109          "output": {
110          }
111        },
112        "description": "This example creates a managed compute environment with the M4 instance type that is launched when the Spot bid price is at or below 20% of the On-Demand price for the instance type. The compute environment is called M4Spot.",
113        "id": "to-create-a-managed-ec2-spot-compute-environment-1481152844190",
114        "title": "To create a managed EC2 Spot compute environment"
115      }
116    ],
117    "CreateJobQueue": [
118      {
119        "input": {
120          "computeEnvironmentOrder": [
121            {
122              "computeEnvironment": "M4Spot",
123              "order": 1
124            }
125          ],
126          "jobQueueName": "LowPriority",
127          "priority": 1,
128          "state": "ENABLED"
129        },
130        "output": {
131          "jobQueueArn": "arn:aws:batch:us-east-1:012345678910:job-queue/LowPriority",
132          "jobQueueName": "LowPriority"
133        },
134        "comments": {
135          "input": {
136          },
137          "output": {
138          }
139        },
140        "description": "This example creates a job queue called LowPriority that uses the M4Spot compute environment.",
141        "id": "to-create-a-job-queue-with-a-single-compute-environment-1481152967946",
142        "title": "To create a job queue with a single compute environment"
143      },
144      {
145        "input": {
146          "computeEnvironmentOrder": [
147            {
148              "computeEnvironment": "C4OnDemand",
149              "order": 1
150            },
151            {
152              "computeEnvironment": "M4Spot",
153              "order": 2
154            }
155          ],
156          "jobQueueName": "HighPriority",
157          "priority": 10,
158          "state": "ENABLED"
159        },
160        "output": {
161          "jobQueueArn": "arn:aws:batch:us-east-1:012345678910:job-queue/HighPriority",
162          "jobQueueName": "HighPriority"
163        },
164        "comments": {
165          "input": {
166          },
167          "output": {
168          }
169        },
170        "description": "This example creates a job queue called HighPriority that uses the C4OnDemand compute environment with an order of 1 and the M4Spot compute environment with an order of 2.",
171        "id": "to-create-a-job-queue-with-multiple-compute-environments-1481153027051",
172        "title": "To create a job queue with multiple compute environments"
173      }
174    ],
175    "DeleteComputeEnvironment": [
176      {
177        "input": {
178          "computeEnvironment": "P2OnDemand"
179        },
180        "output": {
181        },
182        "comments": {
183          "input": {
184          },
185          "output": {
186          }
187        },
188        "description": "This example deletes the P2OnDemand compute environment.",
189        "id": "to-delete-a-compute-environment-1481153105644",
190        "title": "To delete a compute environment"
191      }
192    ],
193    "DeleteJobQueue": [
194      {
195        "input": {
196          "jobQueue": "GPGPU"
197        },
198        "output": {
199        },
200        "comments": {
201          "input": {
202          },
203          "output": {
204          }
205        },
206        "description": "This example deletes the GPGPU job queue.",
207        "id": "to-delete-a-job-queue-1481153508134",
208        "title": "To delete a job queue"
209      }
210    ],
211    "DeregisterJobDefinition": [
212      {
213        "input": {
214          "jobDefinition": "sleep10"
215        },
216        "output": {
217        },
218        "comments": {
219          "input": {
220          },
221          "output": {
222          }
223        },
224        "description": "This example deregisters a job definition called sleep10.",
225        "id": "to-deregister-a-job-definition-1481153579565",
226        "title": "To deregister a job definition"
227      }
228    ],
229    "DescribeComputeEnvironments": [
230      {
231        "input": {
232          "computeEnvironments": [
233            "P2OnDemand"
234          ]
235        },
236        "output": {
237          "computeEnvironments": [
238            {
239              "type": "MANAGED",
240              "computeEnvironmentArn": "arn:aws:batch:us-east-1:012345678910:compute-environment/P2OnDemand",
241              "computeEnvironmentName": "P2OnDemand",
242              "computeResources": {
243                "type": "EC2",
244                "desiredvCpus": 48,
245                "ec2KeyPair": "id_rsa",
246                "instanceRole": "ecsInstanceRole",
247                "instanceTypes": [
248                  "p2"
249                ],
250                "maxvCpus": 128,
251                "minvCpus": 0,
252                "securityGroupIds": [
253                  "sg-cf5093b2"
254                ],
255                "subnets": [
256                  "subnet-220c0e0a",
257                  "subnet-1a95556d",
258                  "subnet-978f6dce"
259                ],
260                "tags": {
261                  "Name": "Batch Instance - P2OnDemand"
262                }
263              },
264              "ecsClusterArn": "arn:aws:ecs:us-east-1:012345678910:cluster/P2OnDemand_Batch_2c06f29d-d1fe-3a49-879d-42394c86effc",
265              "serviceRole": "arn:aws:iam::012345678910:role/AWSBatchServiceRole",
266              "state": "ENABLED",
267              "status": "VALID",
268              "statusReason": "ComputeEnvironment Healthy"
269            }
270          ]
271        },
272        "comments": {
273          "input": {
274          },
275          "output": {
276          }
277        },
278        "description": "This example describes the P2OnDemand compute environment.",
279        "id": "to-describe-a-compute-environment-1481153713334",
280        "title": "To describe a compute environment"
281      }
282    ],
283    "DescribeJobDefinitions": [
284      {
285        "input": {
286          "status": "ACTIVE"
287        },
288        "output": {
289          "jobDefinitions": [
290            {
291              "type": "container",
292              "containerProperties": {
293                "command": [
294                  "sleep",
295                  "60"
296                ],
297                "environment": [
298
299                ],
300                "image": "busybox",
301                "memory": 128,
302                "mountPoints": [
303
304                ],
305                "ulimits": [
306
307                ],
308                "vcpus": 1,
309                "volumes": [
310
311                ]
312              },
313              "jobDefinitionArn": "arn:aws:batch:us-east-1:012345678910:job-definition/sleep60:1",
314              "jobDefinitionName": "sleep60",
315              "revision": 1,
316              "status": "ACTIVE"
317            }
318          ]
319        },
320        "comments": {
321          "input": {
322          },
323          "output": {
324          }
325        },
326        "description": "This example describes all of your active job definitions.",
327        "id": "to-describe-active-job-definitions-1481153895831",
328        "title": "To describe active job definitions"
329      }
330    ],
331    "DescribeJobQueues": [
332      {
333        "input": {
334          "jobQueues": [
335            "HighPriority"
336          ]
337        },
338        "output": {
339          "jobQueues": [
340            {
341              "computeEnvironmentOrder": [
342                {
343                  "computeEnvironment": "arn:aws:batch:us-east-1:012345678910:compute-environment/C4OnDemand",
344                  "order": 1
345                }
346              ],
347              "jobQueueArn": "arn:aws:batch:us-east-1:012345678910:job-queue/HighPriority",
348              "jobQueueName": "HighPriority",
349              "priority": 1,
350              "state": "ENABLED",
351              "status": "VALID",
352              "statusReason": "JobQueue Healthy"
353            }
354          ]
355        },
356        "comments": {
357          "input": {
358          },
359          "output": {
360          }
361        },
362        "description": "This example describes the HighPriority job queue.",
363        "id": "to-describe-a-job-queue-1481153995804",
364        "title": "To describe a job queue"
365      }
366    ],
367    "DescribeJobs": [
368      {
369        "input": {
370          "jobs": [
371            "24fa2d7a-64c4-49d2-8b47-f8da4fbde8e9"
372          ]
373        },
374        "output": {
375          "jobs": [
376            {
377              "container": {
378                "command": [
379                  "sleep",
380                  "60"
381                ],
382                "containerInstanceArn": "arn:aws:ecs:us-east-1:012345678910:container-instance/5406d7cd-58bd-4b8f-9936-48d7c6b1526c",
383                "environment": [
384
385                ],
386                "exitCode": 0,
387                "image": "busybox",
388                "memory": 128,
389                "mountPoints": [
390
391                ],
392                "ulimits": [
393
394                ],
395                "vcpus": 1,
396                "volumes": [
397
398                ]
399              },
400              "createdAt": 1480460782010,
401              "dependsOn": [
402
403              ],
404              "jobDefinition": "sleep60",
405              "jobId": "24fa2d7a-64c4-49d2-8b47-f8da4fbde8e9",
406              "jobName": "example",
407              "jobQueue": "arn:aws:batch:us-east-1:012345678910:job-queue/HighPriority",
408              "parameters": {
409              },
410              "startedAt": 1480460816500,
411              "status": "SUCCEEDED",
412              "stoppedAt": 1480460880699
413            }
414          ]
415        },
416        "comments": {
417          "input": {
418          },
419          "output": {
420          }
421        },
422        "description": "This example describes a job with the specified job ID.",
423        "id": "to-describe-a-specific-job-1481154090490",
424        "title": "To describe a specific job"
425      }
426    ],
427    "ListJobs": [
428      {
429        "input": {
430          "jobQueue": "HighPriority"
431        },
432        "output": {
433          "jobSummaryList": [
434            {
435              "jobId": "e66ff5fd-a1ff-4640-b1a2-0b0a142f49bb",
436              "jobName": "example"
437            }
438          ]
439        },
440        "comments": {
441          "input": {
442          },
443          "output": {
444          }
445        },
446        "description": "This example lists the running jobs in the HighPriority job queue.",
447        "id": "to-list-running-jobs-1481154202164",
448        "title": "To list running jobs"
449      },
450      {
451        "input": {
452          "jobQueue": "HighPriority",
453          "jobStatus": "SUBMITTED"
454        },
455        "output": {
456          "jobSummaryList": [
457            {
458              "jobId": "68f0c163-fbd4-44e6-9fd1-25b14a434786",
459              "jobName": "example"
460            }
461          ]
462        },
463        "comments": {
464          "input": {
465          },
466          "output": {
467          }
468        },
469        "description": "This example lists jobs in the HighPriority job queue that are in the SUBMITTED job status.",
470        "id": "to-list-submitted-jobs-1481154251623",
471        "title": "To list submitted jobs"
472      }
473    ],
474    "RegisterJobDefinition": [
475      {
476        "input": {
477          "type": "container",
478          "containerProperties": {
479            "command": [
480              "sleep",
481              "10"
482            ],
483            "image": "busybox",
484            "memory": 128,
485            "vcpus": 1
486          },
487          "jobDefinitionName": "sleep10"
488        },
489        "output": {
490          "jobDefinitionArn": "arn:aws:batch:us-east-1:012345678910:job-definition/sleep10:1",
491          "jobDefinitionName": "sleep10",
492          "revision": 1
493        },
494        "comments": {
495          "input": {
496          },
497          "output": {
498          }
499        },
500        "description": "This example registers a job definition for a simple container job.",
501        "id": "to-register-a-job-definition-1481154325325",
502        "title": "To register a job definition"
503      }
504    ],
505    "SubmitJob": [
506      {
507        "input": {
508          "jobDefinition": "sleep60",
509          "jobName": "example",
510          "jobQueue": "HighPriority"
511        },
512        "output": {
513          "jobId": "876da822-4198-45f2-a252-6cea32512ea8",
514          "jobName": "example"
515        },
516        "comments": {
517          "input": {
518          },
519          "output": {
520          }
521        },
522        "description": "This example submits a simple container job called example to the HighPriority job queue.",
523        "id": "to-submit-a-job-to-a-queue-1481154481673",
524        "title": "To submit a job to a queue"
525      }
526    ],
527    "TerminateJob": [
528      {
529        "input": {
530          "jobId": "61e743ed-35e4-48da-b2de-5c8333821c84",
531          "reason": "Terminating job."
532        },
533        "output": {
534        },
535        "comments": {
536          "input": {
537          },
538          "output": {
539          }
540        },
541        "description": "This example terminates a job with the specified job ID.",
542        "id": "to-terminate-a-job-1481154558276",
543        "title": "To terminate a job"
544      }
545    ],
546    "UpdateComputeEnvironment": [
547      {
548        "input": {
549          "computeEnvironment": "P2OnDemand",
550          "state": "DISABLED"
551        },
552        "output": {
553          "computeEnvironmentArn": "arn:aws:batch:us-east-1:012345678910:compute-environment/P2OnDemand",
554          "computeEnvironmentName": "P2OnDemand"
555        },
556        "comments": {
557          "input": {
558          },
559          "output": {
560          }
561        },
562        "description": "This example disables the P2OnDemand compute environment so it can be deleted.",
563        "id": "to-update-a-compute-environment-1481154702731",
564        "title": "To update a compute environment"
565      }
566    ],
567    "UpdateJobQueue": [
568      {
569        "input": {
570          "jobQueue": "GPGPU",
571          "state": "DISABLED"
572        },
573        "output": {
574          "jobQueueArn": "arn:aws:batch:us-east-1:012345678910:job-queue/GPGPU",
575          "jobQueueName": "GPGPU"
576        },
577        "comments": {
578          "input": {
579          },
580          "output": {
581          }
582        },
583        "description": "This example disables a job queue so that it can be deleted.",
584        "id": "to-update-a-job-queue-1481154806981",
585        "title": "To update a job queue"
586      }
587    ]
588  }
589}
590