Oracle Cloud Infrastructure · Arazzo Workflow

Oracle Cloud Stop And Terminate Instance

Version 1.0.0

Gracefully stop a running instance, confirm it stopped, then terminate it.

1 workflow 1 source API 1 provider
View Spec View on GitHub Cloud ComputingEnterprise CloudInfrastructure as a ServiceOraclePlatform as a ServiceArazzoWorkflows

Provider

oracle-cloud

Workflows

stop-and-terminate-instance
Stop a running instance, wait for STOPPED, then terminate it.
Confirms the instance, performs a STOP action, polls getInstance until the instance is STOPPED, and terminates it preserving the boot volume.
4 steps inputs: instanceId, preserveBootVolume outputs: finalState, instanceId
1
getInstance
getInstance
Confirm the instance exists before issuing lifecycle actions.
2
stopInstance
instanceAction
Issue a STOP action to gracefully power down the instance.
3
pollStopped
getInstance
Poll the instance until it reports the STOPPED lifecycle state.
4
terminateInstance
terminateInstance
Terminate the stopped instance, preserving the boot volume.

Source API Descriptions

Arazzo Workflow Specification

oracle-cloud-stop-and-terminate-instance-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Oracle Cloud Stop And Terminate Instance
  summary: Gracefully stop a running instance, confirm it stopped, then terminate it.
  description: >-
    Safely decommissions a compute instance. The workflow reads the instance to
    confirm it exists, issues a STOP instance action, polls until the lifecycle
    state reaches STOPPED, and then terminates the instance while preserving the
    boot volume. Every step spells out its request inline so the teardown flow
    can be read and executed without opening the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: computeApi
  url: ../openapi/oracle-cloud-compute-openapi.yaml
  type: openapi
workflows:
- workflowId: stop-and-terminate-instance
  summary: Stop a running instance, wait for STOPPED, then terminate it.
  description: >-
    Confirms the instance, performs a STOP action, polls getInstance until the
    instance is STOPPED, and terminates it preserving the boot volume.
  inputs:
    type: object
    required:
    - instanceId
    properties:
      instanceId:
        type: string
        description: The OCID of the instance to stop and terminate.
      preserveBootVolume:
        type: boolean
        description: Whether to preserve the boot volume on termination.
  steps:
  - stepId: getInstance
    description: Confirm the instance exists before issuing lifecycle actions.
    operationId: getInstance
    parameters:
    - name: instanceId
      in: path
      value: $inputs.instanceId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      currentState: $response.body#/lifecycleState
  - stepId: stopInstance
    description: Issue a STOP action to gracefully power down the instance.
    operationId: instanceAction
    parameters:
    - name: instanceId
      in: path
      value: $inputs.instanceId
    - name: action
      in: path
      value: STOP
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      actionState: $response.body#/lifecycleState
  - stepId: pollStopped
    description: Poll the instance until it reports the STOPPED lifecycle state.
    operationId: getInstance
    parameters:
    - name: instanceId
      in: path
      value: $inputs.instanceId
    successCriteria:
    - condition: $statusCode == 200
    - context: $response.body
      condition: $.lifecycleState == "STOPPED"
      type: jsonpath
    outputs:
      lifecycleState: $response.body#/lifecycleState
  - stepId: terminateInstance
    description: Terminate the stopped instance, preserving the boot volume.
    operationId: terminateInstance
    parameters:
    - name: instanceId
      in: path
      value: $inputs.instanceId
    - name: preserveBootVolume
      in: query
      value: $inputs.preserveBootVolume
    successCriteria:
    - condition: $statusCode == 204
  outputs:
    instanceId: $inputs.instanceId
    finalState: $steps.pollStopped.outputs.lifecycleState