Oracle · Arazzo Workflow

Oracle OCI Select Shape and Image then Launch

Version 1.0.0

List available shapes, find a matching image, then launch an instance using both.

1 workflow 1 source API 1 provider
View Spec View on GitHub CloudDatabaseEnterpriseInfrastructureSaaSArazzoWorkflows

Provider

oracle

Workflows

select-shape-and-launch
Discover a shape and image then launch an instance from them.
Lists shapes and images in the compartment, then launches an instance using the first shape and first matching image returned.
3 steps inputs: authToken, availabilityDomain, compartmentId, displayName, operatingSystem, subnetId outputs: imageId, instanceId, shape
1
listShapes
listShapes
List the shapes available to launch an instance within the compartment and availability domain.
2
listImages
listImages
List images in the compartment filtered to the requested operating system, taking the first available image.
3
launchInstance
launchInstance
Launch a new instance wired to the discovered shape and image, attaching its primary VNIC to the supplied subnet.

Source API Descriptions

Arazzo Workflow Specification

oracle-select-shape-and-launch-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Oracle OCI Select Shape and Image then Launch
  summary: List available shapes, find a matching image, then launch an instance using both.
  description: >-
    Discovers the compute resources available in a compartment and provisions an
    instance from them. The workflow lists the shapes available in the
    availability domain, lists images filtered by operating system, and then
    launches a new instance wired to the first discovered shape and image. This
    chains a discovery pass into a create so callers do not need to know shape or
    image OCIDs in advance. Every step spells out its request inline so the flow
    can be read and executed without opening the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: ociComputeApi
  url: ../openapi/oci-compute-api-openapi.yml
  type: openapi
workflows:
- workflowId: select-shape-and-launch
  summary: Discover a shape and image then launch an instance from them.
  description: >-
    Lists shapes and images in the compartment, then launches an instance using
    the first shape and first matching image returned.
  inputs:
    type: object
    required:
    - compartmentId
    - availabilityDomain
    - subnetId
    - operatingSystem
    properties:
      compartmentId:
        type: string
        description: The OCID of the compartment to discover resources and launch into.
      availabilityDomain:
        type: string
        description: The availability domain to scope discovery and launch to.
      subnetId:
        type: string
        description: The OCID of the subnet the primary VNIC will attach to.
      operatingSystem:
        type: string
        description: The operating system to filter images by (e.g. Oracle Linux).
      displayName:
        type: string
        description: An optional user-friendly name for the launched instance.
      authToken:
        type: string
        description: OCI request-signing bearer credential for the Authorization header.
  steps:
  - stepId: listShapes
    description: >-
      List the shapes available to launch an instance within the compartment and
      availability domain.
    operationId: listShapes
    parameters:
    - name: compartmentId
      in: query
      value: $inputs.compartmentId
    - name: availabilityDomain
      in: query
      value: $inputs.availabilityDomain
    - name: limit
      in: query
      value: 1
    - name: Authorization
      in: header
      value: $inputs.authToken
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      selectedShape: $response.body#/0/shape
  - stepId: listImages
    description: >-
      List images in the compartment filtered to the requested operating system,
      taking the first available image.
    operationId: listImages
    parameters:
    - name: compartmentId
      in: query
      value: $inputs.compartmentId
    - name: operatingSystem
      in: query
      value: $inputs.operatingSystem
    - name: lifecycleState
      in: query
      value: AVAILABLE
    - name: limit
      in: query
      value: 1
    - name: Authorization
      in: header
      value: $inputs.authToken
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      selectedImageId: $response.body#/0/id
  - stepId: launchInstance
    description: >-
      Launch a new instance wired to the discovered shape and image, attaching
      its primary VNIC to the supplied subnet.
    operationId: launchInstance
    parameters:
    - name: Authorization
      in: header
      value: $inputs.authToken
    requestBody:
      contentType: application/json
      payload:
        compartmentId: $inputs.compartmentId
        availabilityDomain: $inputs.availabilityDomain
        shape: $steps.listShapes.outputs.selectedShape
        displayName: $inputs.displayName
        sourceDetails:
          sourceType: image
          imageId: $steps.listImages.outputs.selectedImageId
        createVnicDetails:
          subnetId: $inputs.subnetId
          assignPublicIp: true
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      instanceId: $response.body#/id
      lifecycleState: $response.body#/lifecycleState
  outputs:
    instanceId: $steps.launchInstance.outputs.instanceId
    shape: $steps.listShapes.outputs.selectedShape
    imageId: $steps.listImages.outputs.selectedImageId