batch-2016-08-10.examples.json 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711
  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. "image": "busybox",
  300. "mountPoints": [
  301. ],
  302. "resourceRequirements": [
  303. {
  304. "type": "MEMORY",
  305. "value": "128"
  306. },
  307. {
  308. "type": "VCPU",
  309. "value": "1"
  310. }
  311. ],
  312. "ulimits": [
  313. ],
  314. "volumes": [
  315. ]
  316. },
  317. "jobDefinitionArn": "arn:aws:batch:us-east-1:012345678910:job-definition/sleep60:1",
  318. "jobDefinitionName": "sleep60",
  319. "revision": 1,
  320. "status": "ACTIVE"
  321. }
  322. ]
  323. },
  324. "comments": {
  325. "input": {
  326. },
  327. "output": {
  328. }
  329. },
  330. "description": "This example describes all of your active job definitions.",
  331. "id": "to-describe-active-job-definitions-1481153895831",
  332. "title": "To describe active job definitions"
  333. }
  334. ],
  335. "DescribeJobQueues": [
  336. {
  337. "input": {
  338. "jobQueues": [
  339. "HighPriority"
  340. ]
  341. },
  342. "output": {
  343. "jobQueues": [
  344. {
  345. "computeEnvironmentOrder": [
  346. {
  347. "computeEnvironment": "arn:aws:batch:us-east-1:012345678910:compute-environment/C4OnDemand",
  348. "order": 1
  349. }
  350. ],
  351. "jobQueueArn": "arn:aws:batch:us-east-1:012345678910:job-queue/HighPriority",
  352. "jobQueueName": "HighPriority",
  353. "priority": 1,
  354. "state": "ENABLED",
  355. "status": "VALID",
  356. "statusReason": "JobQueue Healthy"
  357. }
  358. ]
  359. },
  360. "comments": {
  361. "input": {
  362. },
  363. "output": {
  364. }
  365. },
  366. "description": "This example describes the HighPriority job queue.",
  367. "id": "to-describe-a-job-queue-1481153995804",
  368. "title": "To describe a job queue"
  369. }
  370. ],
  371. "DescribeJobs": [
  372. {
  373. "input": {
  374. "jobs": [
  375. "24fa2d7a-64c4-49d2-8b47-f8da4fbde8e9"
  376. ]
  377. },
  378. "output": {
  379. "jobs": [
  380. {
  381. "container": {
  382. "command": [
  383. "sleep",
  384. "60"
  385. ],
  386. "containerInstanceArn": "arn:aws:ecs:us-east-1:012345678910:container-instance/5406d7cd-58bd-4b8f-9936-48d7c6b1526c",
  387. "environment": [
  388. ],
  389. "exitCode": 0,
  390. "image": "busybox",
  391. "memory": 128,
  392. "mountPoints": [
  393. ],
  394. "ulimits": [
  395. ],
  396. "vcpus": 1,
  397. "volumes": [
  398. ]
  399. },
  400. "createdAt": 1480460782010,
  401. "dependsOn": [
  402. ],
  403. "jobDefinition": "sleep60",
  404. "jobId": "24fa2d7a-64c4-49d2-8b47-f8da4fbde8e9",
  405. "jobName": "example",
  406. "jobQueue": "arn:aws:batch:us-east-1:012345678910:job-queue/HighPriority",
  407. "parameters": {
  408. },
  409. "startedAt": 1480460816500,
  410. "status": "SUCCEEDED",
  411. "stoppedAt": 1480460880699
  412. }
  413. ]
  414. },
  415. "comments": {
  416. "input": {
  417. },
  418. "output": {
  419. }
  420. },
  421. "description": "This example describes a job with the specified job ID.",
  422. "id": "to-describe-a-specific-job-1481154090490",
  423. "title": "To describe a specific job"
  424. }
  425. ],
  426. "ListJobs": [
  427. {
  428. "input": {
  429. "jobQueue": "HighPriority"
  430. },
  431. "output": {
  432. "jobSummaryList": [
  433. {
  434. "jobId": "e66ff5fd-a1ff-4640-b1a2-0b0a142f49bb",
  435. "jobName": "example"
  436. }
  437. ]
  438. },
  439. "comments": {
  440. "input": {
  441. },
  442. "output": {
  443. }
  444. },
  445. "description": "This example lists the running jobs in the HighPriority job queue.",
  446. "id": "to-list-running-jobs-1481154202164",
  447. "title": "To list running jobs"
  448. },
  449. {
  450. "input": {
  451. "jobQueue": "HighPriority",
  452. "jobStatus": "SUBMITTED"
  453. },
  454. "output": {
  455. "jobSummaryList": [
  456. {
  457. "jobId": "68f0c163-fbd4-44e6-9fd1-25b14a434786",
  458. "jobName": "example"
  459. }
  460. ]
  461. },
  462. "comments": {
  463. "input": {
  464. },
  465. "output": {
  466. }
  467. },
  468. "description": "This example lists jobs in the HighPriority job queue that are in the SUBMITTED job status.",
  469. "id": "to-list-submitted-jobs-1481154251623",
  470. "title": "To list submitted jobs"
  471. }
  472. ],
  473. "ListTagsForResource": [
  474. {
  475. "input": {
  476. "resourceArn": "arn:aws:batch:us-east-1:123456789012:job-definition/sleep30:1"
  477. },
  478. "output": {
  479. "tags": {
  480. "Department": "Engineering",
  481. "Stage": "Alpha",
  482. "User": "JaneDoe"
  483. }
  484. },
  485. "comments": {
  486. "input": {
  487. },
  488. "output": {
  489. }
  490. },
  491. "description": "This demonstrates calling the ListTagsForResource action.",
  492. "id": "listtagsforresource-example-1591293003710",
  493. "title": "ListTagsForResource Example"
  494. }
  495. ],
  496. "RegisterJobDefinition": [
  497. {
  498. "input": {
  499. "type": "container",
  500. "containerProperties": {
  501. "command": [
  502. "sleep",
  503. "10"
  504. ],
  505. "image": "busybox",
  506. "resourceRequirements": [
  507. {
  508. "type": "MEMORY",
  509. "value": "128"
  510. },
  511. {
  512. "type": "VCPU",
  513. "value": "1"
  514. }
  515. ]
  516. },
  517. "jobDefinitionName": "sleep10"
  518. },
  519. "output": {
  520. "jobDefinitionArn": "arn:aws:batch:us-east-1:012345678910:job-definition/sleep10:1",
  521. "jobDefinitionName": "sleep10",
  522. "revision": 1
  523. },
  524. "comments": {
  525. "input": {
  526. },
  527. "output": {
  528. }
  529. },
  530. "description": "This example registers a job definition for a simple container job.",
  531. "id": "to-register-a-job-definition-1481154325325",
  532. "title": "To register a job definition"
  533. },
  534. {
  535. "input": {
  536. "type": "container",
  537. "containerProperties": {
  538. "command": [
  539. "sleep",
  540. "30"
  541. ],
  542. "image": "busybox",
  543. "resourceRequirements": [
  544. {
  545. "type": "MEMORY",
  546. "value": "128"
  547. },
  548. {
  549. "type": "VCPU",
  550. "value": "1"
  551. }
  552. ]
  553. },
  554. "jobDefinitionName": "sleep30",
  555. "tags": {
  556. "Department": "Engineering",
  557. "User": "JaneDoe"
  558. }
  559. },
  560. "output": {
  561. "jobDefinitionArn": "arn:aws:batch:us-east-1:012345678910:job-definition/sleep30:1",
  562. "jobDefinitionName": "sleep30",
  563. "revision": 1
  564. },
  565. "comments": {
  566. "input": {
  567. },
  568. "output": {
  569. }
  570. },
  571. "description": "This demonstrates calling the RegisterJobDefinition action, including tags.",
  572. "id": "registerjobdefinition-with-tags-1591290509028",
  573. "title": "RegisterJobDefinition with tags"
  574. }
  575. ],
  576. "SubmitJob": [
  577. {
  578. "input": {
  579. "jobDefinition": "sleep60",
  580. "jobName": "example",
  581. "jobQueue": "HighPriority"
  582. },
  583. "output": {
  584. "jobId": "876da822-4198-45f2-a252-6cea32512ea8",
  585. "jobName": "example"
  586. },
  587. "comments": {
  588. "input": {
  589. },
  590. "output": {
  591. }
  592. },
  593. "description": "This example submits a simple container job called example to the HighPriority job queue.",
  594. "id": "to-submit-a-job-to-a-queue-1481154481673",
  595. "title": "To submit a job to a queue"
  596. }
  597. ],
  598. "TagResource": [
  599. {
  600. "input": {
  601. "resourceArn": "arn:aws:batch:us-east-1:123456789012:job-definition/sleep30:1",
  602. "tags": {
  603. "Stage": "Alpha"
  604. }
  605. },
  606. "output": {
  607. },
  608. "comments": {
  609. "input": {
  610. },
  611. "output": {
  612. }
  613. },
  614. "description": "This demonstrates calling the TagResource action.",
  615. "id": "tagresource-example-1591291959952",
  616. "title": "TagResource Example"
  617. }
  618. ],
  619. "TerminateJob": [
  620. {
  621. "input": {
  622. "jobId": "61e743ed-35e4-48da-b2de-5c8333821c84",
  623. "reason": "Terminating job."
  624. },
  625. "output": {
  626. },
  627. "comments": {
  628. "input": {
  629. },
  630. "output": {
  631. }
  632. },
  633. "description": "This example terminates a job with the specified job ID.",
  634. "id": "to-terminate-a-job-1481154558276",
  635. "title": "To terminate a job"
  636. }
  637. ],
  638. "UntagResource": [
  639. {
  640. "input": {
  641. "resourceArn": "arn:aws:batch:us-east-1:123456789012:job-definition/sleep30:1",
  642. "tagKeys": [
  643. "Stage"
  644. ]
  645. },
  646. "output": {
  647. },
  648. "comments": {
  649. "input": {
  650. },
  651. "output": {
  652. }
  653. },
  654. "description": "This demonstrates calling the UntagResource action.",
  655. "id": "untagresource-example-1591292811042",
  656. "title": "UntagResource Example"
  657. }
  658. ],
  659. "UpdateComputeEnvironment": [
  660. {
  661. "input": {
  662. "computeEnvironment": "P2OnDemand",
  663. "state": "DISABLED"
  664. },
  665. "output": {
  666. "computeEnvironmentArn": "arn:aws:batch:us-east-1:012345678910:compute-environment/P2OnDemand",
  667. "computeEnvironmentName": "P2OnDemand"
  668. },
  669. "comments": {
  670. "input": {
  671. },
  672. "output": {
  673. }
  674. },
  675. "description": "This example disables the P2OnDemand compute environment so it can be deleted.",
  676. "id": "to-update-a-compute-environment-1481154702731",
  677. "title": "To update a compute environment"
  678. }
  679. ],
  680. "UpdateJobQueue": [
  681. {
  682. "input": {
  683. "jobQueue": "GPGPU",
  684. "state": "DISABLED"
  685. },
  686. "output": {
  687. "jobQueueArn": "arn:aws:batch:us-east-1:012345678910:job-queue/GPGPU",
  688. "jobQueueName": "GPGPU"
  689. },
  690. "comments": {
  691. "input": {
  692. },
  693. "output": {
  694. }
  695. },
  696. "description": "This example disables a job queue so that it can be deleted.",
  697. "id": "to-update-a-job-queue-1481154806981",
  698. "title": "To update a job queue"
  699. }
  700. ]
  701. }
  702. }