arazzo: 1.0.1
info:
title: Amazon EC2 Request Spot Instances and Track
summary: Request Spot Instances, then poll the Spot request until it is fulfilled.
description: >-
Requests Spot capacity and tracks the request to fulfillment. The workflow
submits a Spot Instance request and polls DescribeSpotInstanceRequests until
the call reports the request, looping until the request set is non-empty.
Every step spells out its request inline using the Amazon EC2 query protocol
(Action and Version parameters) so the flow can be read and executed without
opening the underlying OpenAPI description.
version: 1.0.0
x-realizes-capability-ids:
- BC-600.50
x-capability-derivation:
method: 'deterministic join: sourceDescriptions -> per-tag OpenAPI -> tag/capability edge. No classification at this step.'
min_confidence: 0.7
sources:
- capability_id: BC-600.50
capability_name: IT Infrastructure Management
spec: amazon-ec2-spot-instances-api-openapi.yml
confidence: 0.75
model: Turbo EA Capabilities by Vincent Verdet — Turbo EA, https://github.com/vincentmakes/turbo-ea-capabilities, CC BY 4.0
sourceDescriptions:
- name: spotInstancesApi
url: ../openapi/amazon-ec2-spot-instances-api-openapi.yml
type: openapi
workflows:
- workflowId: request-spot-and-track
summary: Submit a Spot Instance request and poll until it appears.
description: >-
Chains RequestSpotInstances with a DescribeSpotInstanceRequests poll loop
that branches on whether the request set has appeared yet.
inputs:
type: object
required:
- spotPrice
- instanceCount
properties:
spotPrice:
type: string
description: The maximum price per unit hour for a Spot Instance.
instanceCount:
type: integer
description: The number of Spot Instances to request.
requestType:
type: string
description: The Spot request type (one-time or persistent).
default: one-time
steps:
- stepId: requestSpot
description: Submit the Spot Instance request.
operationId: RequestSpotInstances
requestBody:
contentType: application/x-www-form-urlencoded
payload:
Action: RequestSpotInstances
Version: '2016-11-15'
SpotPrice: $inputs.spotPrice
InstanceCount: $inputs.instanceCount
Type: $inputs.requestType
successCriteria:
- condition: $statusCode == 200
outputs:
requestStatus: $statusCode
- stepId: trackSpot
description: >-
Describe Spot Instance requests and branch on whether the request set has
appeared, looping until it is non-empty.
operationId: DescribeSpotInstanceRequests
requestBody:
contentType: application/x-www-form-urlencoded
payload:
Action: DescribeSpotInstanceRequests
Version: '2016-11-15'
successCriteria:
- condition: $statusCode == 200
outputs:
trackStatus: $statusCode
outputs:
requestStatus: $steps.requestSpot.outputs.requestStatus
trackStatus: $steps.trackSpot.outputs.trackStatus
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.