arazzo: 1.0.1 info: title: Google Cloud Platform Delete and Restore Project summary: Mark a project for deletion, confirm DELETE_REQUESTED, then undelete it back to active. description: >- Exercises the project deletion grace period. The workflow reads the project, marks it for deletion (which moves it to DELETE_REQUESTED), polls the delete operation until done, and then restores the project with undelete before polling that operation to completion. 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: cloudResourceManagerApi url: ../openapi/cloud-resource-manager-openapi.yml type: openapi workflows: - workflowId: delete-and-restore-project summary: Delete a project then restore it within the grace period. description: >- Marks a project for deletion, waits for the delete operation, then undeletes it and waits for the restore operation. inputs: type: object required: - projectId properties: projectId: type: string description: The project id to delete and restore (e.g. my-app-prod-123). steps: - stepId: getProject description: >- Read the project to confirm it exists and capture its starting state. operationId: cloudresourcemanager.projects.get parameters: - name: projectId in: path value: $inputs.projectId successCriteria: - condition: $statusCode == 200 outputs: startingState: $response.body#/state - stepId: deleteProject description: >- Mark the project for deletion. Returns a long-running Operation whose name is used to poll for completion. operationId: cloudresourcemanager.projects.delete parameters: - name: projectId in: path value: $inputs.projectId successCriteria: - condition: $statusCode == 200 outputs: operationName: $response.body#/name - stepId: pollDelete description: >- Poll the delete operation by name until the done flag is true. operationId: cloudresourcemanager.operations.get parameters: - name: name in: path value: $steps.deleteProject.outputs.operationName successCriteria: - condition: $statusCode == 200 outputs: done: $response.body#/done onSuccess: - name: deleteComplete type: goto stepId: undeleteProject criteria: - context: $response.body condition: $.done == true type: jsonpath - name: deleteRunning type: goto stepId: pollDelete criteria: - context: $response.body condition: $.done == false type: jsonpath - stepId: undeleteProject description: >- Restore the project from DELETE_REQUESTED within the grace period. Returns a long-running Operation whose name is used to poll. operationId: cloudresourcemanager.projects.undelete parameters: - name: projectId in: path value: $inputs.projectId requestBody: contentType: application/json payload: {} successCriteria: - condition: $statusCode == 200 outputs: operationName: $response.body#/name - stepId: pollUndelete description: >- Poll the undelete operation by name until the done flag is true. operationId: cloudresourcemanager.operations.get parameters: - name: name in: path value: $steps.undeleteProject.outputs.operationName successCriteria: - condition: $statusCode == 200 outputs: done: $response.body#/done onSuccess: - name: undeleteComplete type: end criteria: - context: $response.body condition: $.done == true type: jsonpath - name: undeleteRunning type: goto stepId: pollUndelete criteria: - context: $response.body condition: $.done == false type: jsonpath outputs: deleteOperation: $steps.deleteProject.outputs.operationName undeleteOperation: $steps.undeleteProject.outputs.operationName